Skip to content
Permalink
main
Loading

Commits on Nov 27, 2021

  1. bpo-45876: Improve accuracy for stdev() and pstdev() in statistics (G…

    …H-29736)
    
    * Inlined code from variance functions
    
    * Added helper functions for the float square root of a fraction
    
    * Call helper functions
    
    * Add blurb
    
    * Fix over-specified test
    
    * Add a test for the _sqrt_frac() helper function
    
    * Increase the tested range
    
    * Add type hints to the internal function.
    
    * Fix test for correct rounding
    
    * Simplify ⌊√(n/m)⌋ calculation
    
    Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
    
    * Add comment and beef-up tests
    
    * Test for zero denominator
    
    * Add algorithmic references
    
    * Add test for the _isqrt_frac_rto() helper function.
    
    * Compute the 109 instead of hard-wiring it
    
    * Stronger test for _isqrt_frac_rto()
    
    * Bigger range
    
    * Bigger range
    
    * Replace float() call with int/int division to be parallel with the other code path.
    
    * Factor out division. Update proof link. Remove internal type declaration
    
    Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
    rhettinger and mdickinson committed Nov 27, 2021
  2. bpo-41735: Fix thread lock in zlib.Decompress.flush() may go wrong (G…

    …H-29587)
    
    * Fix thread lock in zlib.Decompress.flush() may go wrong
    
    Getting `.unconsumed_tail` before acquiring the thread lock may mix up decompress state.
    animalize committed Nov 27, 2021

Commits on Nov 26, 2021

  1. bpo-45901: Fixes argument passing when invoking .py files directly th…

    …rough the Store package (GH-29799)
    zooba committed Nov 26, 2021
  2. bpo-40280: Move hard-coded feature checks to configure (GH-29789)

    Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
    tiran and erlend-aasland committed Nov 26, 2021
  3. bpo-45886: Fix OOT build when srcdir has frozen module headers (GH-29793

    )
    
    The presence of frozen module headers in srcdir interfers with OOT
    build. Make considers headers in srcdir up to date, but later builds do
    not use VPATH to locate files. make clean now removes the headers, too.
    
    Also remove stale ``_bootstrap_python`` from .gitignore.
    tiran committed Nov 26, 2021
  4. bpo-45866: pegen strips directory of "generated from" header (GH-29777)

    "make regen-all" now produces the same output when run from a
    directory other than the source tree: when building Python out of the
    source tree.
    vstinner committed Nov 26, 2021
  5. bpo-40280: Use Setup.stdlib static for wasm builds (GH-29784)

    ``Modules/Setup.stdlib`` contains ``Setup`` lines for all stdlib extension modules for which ``configure`` has detected their dependencies. The file is not used yet and still under development. To use the file, do ``ln -sfr Modules/Setup.stdlib Modules/Setup.local``.
    tiran committed Nov 26, 2021
  6. bpo-45619: documentation of execution model: clarify and update bindi…

    …ng summary (#29232)
    
    This does two changes that are quite related.
    
    0. it add that variable binding can occur in pattern matching, an update of 3.10
    which seems to have been omitted from the list of bindings
    1. Given how long the sentence already was, with even subcases in the middle of
    the sentence, the commit breaks the sentence into an actual list.
    Arthur-Milchior committed Nov 26, 2021
  7. bpo-44353: Correct docstring for NewType (#29785)

    The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function
    AlexWaygood committed Nov 26, 2021

Commits on Nov 25, 2021

  1. bpo-43137: webbrowser: Replace gvfs-open and gnome-open with "gio ope…

    …n" (GH-29154)
    
    * [bpo-43137](): webbrowser: Prefer gio open over gvfs-open
        
        gvfs-open(1) was superseded by gio(1) in 2015, and removed from GNOME
        releases in 2018. Debian and its derivatives like Ubuntu currently still
        have a compatibility shim for gvfs-open, but we plan to remove it.
        
        webbrowser prefers xdg-settings and xdg-open over gvfs-open, so this
        will only have any practical effect on systems where the xdg-utils
        package is not installed.
        
        Note that we don't check for GNOME_DESKTOP_SESSION_ID before using gio.
        gio does the right thing on any desktop environment that follows
        freedesktop.org specifications, similar to xdg-settings, so it's
        unnecessary to guard in this way. GNOME_DESKTOP_SESSION_ID was deprecated
        in 2008 and removed from upstream gnome-session in 2018 (it's still
        present in Debian/Ubuntu for backward compatibility, but probably
        shouldn't be). The replacement way to detect a desktop environment is
        the XDG_CURRENT_DESKTOP environment variable, which is a colon-separated
        sequence where the first item is the current desktop environment and the
        second and subsequent items (if present) are other desktop environments
        that it resembles or is based on.
        
        Resolves: 
    
    * [bpo-43137](): webbrowser: Never invoke gnome-open
        
        gnome-open was part of GNOME 2, which was superseded in around 2010 and
        is unmaintained. The replacement was gvfs-open, which was subsequently
        replaced by gio(1) (as used in the previous commit).
    
    * [bpo-43137](): webbrowser: Don't run gvfs-open on GNOME
        
        gvfs-open was deprecated in 2015 and removed in 2018. The replacement
        is gio(1) (as used in a previous commit).
        
        GNOME_DESKTOP_SESSION_ID was deprecated in 2008 and removed in 2018.
        The replacement is XDG_CURRENT_DESKTOP (as mentioned in a previous
        commit).
    
    ---
    
    To test this on a typical modern Linux system, it is necessary to disable the `xdg-settings` and `xdg-open` code paths, for example with this hack:
    
    <details><summary>Hack to disable use of xdg-settings and xdg-open</summary>
    
    ```diff
    diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
    index 3244f206aa..8f6c09d1d2 100755
    --- a/Lib/webbrowser.py
    +++ b/Lib/webbrowser.py
    @@ -459,7 +459,7 @@ def open(self, url, new=0, autoraise=True):
     def register_X_browsers():
     
         # use xdg-open if around
    -    if shutil.which("xdg-open"):
    +    if 0 and shutil.which("xdg-open"):
             register("xdg-open", None, BackgroundBrowser("xdg-open"))
     
         # Opens an appropriate browser for the URL scheme according to
    @@ -549,7 +549,7 @@ def register_standard_browsers():
             # Prefer X browsers if present
             if os.environ.get("DISPLAY") or os.environ.get("WAYLAND_DISPLAY"):
                 try:
    -                cmd = "xdg-settings get default-web-browser".split()
    +                cmd = "false xdg-settings get default-web-browser".split()
                     raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
                     result = raw_result.decode().strip()
                 except (FileNotFoundError, subprocess.CalledProcessError, PermissionError, NotADirectoryError) :
    ```
    
    </details>
    
    I haven't attempted to assess which of the specific web browsers such as Galeon are still extant, and which ones disappeared years ago. They could almost certainly be cleaned up, but that's beyond the scope of this PR.
    smcv committed Nov 25, 2021
  2. Add missing 'await writer.drain()' call to example (GH-29162)

    Automerge-Triggered-By: GH:asvetlov
    SCORE1387 committed Nov 25, 2021
  3. bpo-45568: Actually use @asynccontextmanager in usage example (GH-29151)

    Automerge-Triggered-By: GH:asvetlov
    zsiciarz committed Nov 25, 2021
  4. bpo-45711: use exc_value instead of exc_type to determine if exc_info…

    … is valid. Add more assertions. (GH-29627)
    iritkatriel committed Nov 25, 2021

Commits on Nov 24, 2021

  1. bpo-45893: Add missing extern C to initconfig.h (GH-29761)

    Co-authored-by: Steve Dower <steve.dower@python.org>
    tiran and zooba committed Nov 24, 2021
  2. bpo-45693: Document port parameter to loop.create_server (GH-29760)

    Document the `port` parameter to `loop.create_server` in `asyncio`. In
    particular, note that if `host` resolves to multiple network interfaces,
    passing in `port=0` will result in a different random unused port being
    used for each interface.
    
    Automerge-Triggered-By: GH:ericvsmith
    jcrist committed Nov 24, 2021
  3. bpo-45514: Deprecate importlib resources legacy functions. (GH-29036)

    * bpo-45514: Apply changes from importlib_resources@a3ef4128c6
    
    * Mark legacy functions as deprecated in the docs and link to the migration docs in importlib_resources docs.
    
    * Apply changes from importlib_resources@329ae9d5f2c.
    
    * Indicate importlib.resources as a module.
    
    Co-authored-by: Filipe Laíns <lains@riseup.net>
    jaraco and FFY00 committed Nov 24, 2021
Older