Skip to content
Permalink
master

Commits on Apr 22, 2021

  1. bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed…

    … an invalid filename (GH-25529)
    zooba committed Apr 22, 2021
  2. bpo-38822: Fixed os.stat failing on inaccessible directories. (GH-25527)

    It would just fail if the path was inaccessible and had a trailing slash. It should fall back to the parent directory's metadata.
    zooba committed Apr 22, 2021
  3. bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of sy…

    …s.getwindowsversion() (GH-25500)
    
    The sys module uses the kernel32.dll version number, which can vary from the "actual" Windows version.
    Since the best option for getting the version is WMI (which is expensive), we switch back to launching cmd.exe (which is also expensive, but a lot less code on our part).
    sys.getwindowsversion() is not updated to avoid launching executables from that module.
    shreyanavigyan committed Apr 22, 2021
  4. bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493

    )
    rhettinger committed Apr 22, 2021
  5. Fix typo in the documentation (GH-24703)

    Missing multiply symbol added
    
    Automerge-Triggered-By: GH:merwok
    Sekomer committed Apr 22, 2021
  6. bpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to righ…

    …t section (GH-22608)
    gousaiyang committed Apr 22, 2021
  7. bpo-38659: Properly re-intialize module variables in test_enum (GH-25516

    )
    
    Previously TestIntEnumConvert and TestStrEnumConvert would end up
    converting the module level variables from their regular int form
    to a `test.test_enum.X` instance after _convert would run. This
    meant that after a single test ran, the next set of _convert
    functions would be operating on the enum instances rather than
    ints. This would cause some tests such as the one involving format
    to fail when running under a mode that repeatedly runs test such
    as the refleak finder.
    ammaraskar committed Apr 22, 2021

Commits on Apr 21, 2021

  1. bpo-26227: Fixes decoding of host names on Windows from ANSI instead …

    …of UTF-8 (GH-25510)
    zooba committed Apr 21, 2021
  2. bpo-40137: Add pycore_moduleobject.h internal header (GH-25507)

    Add pycore_moduleobject.h internal header file with static inline
    functions to access module members:
    
    * _PyModule_GetDict()
    * _PyModule_GetDef()
    * _PyModule_GetState()
    
    These functions don't check at runtime if their argument has a valid
    type and can be inlined even if Python is not built with LTO.
    
    _PyType_GetModuleByDef() uses _PyModule_GetDef().
    
    Replace PyModule_GetState() with _PyModule_GetState() in the
    extension modules, considered as performance sensitive:
    
    * _abc
    * _functools
    * _operator
    * _pickle
    * _queue
    * _random
    * _sre
    * _struct
    * _thread
    * _winapi
    * array
    * posix
    
    The following extensions are now built with the Py_BUILD_CORE_MODULE
    macro defined, to be able to use the internal pycore_moduleobject.h
    header: _abc, array, _operator, _queue, _sre, _struct.
    vstinner committed Apr 21, 2021
  3. bpo-43472: Ensure PyInterpreterState_New audit events are raised when…

    … called through _xxsubinterpreters module (GH-25506)
    zooba committed Apr 21, 2021
  4. bpo-40137: Optimize _PyType_GetModuleByDef() loop (GH-25505)

    PyType_Ready() now ensures that a type MRO cannot be empty.
    
    _PyType_GetModuleByDef() no longer checks "i < PyTuple_GET_SIZE(mro)"
    at the first loop iteration to optimize the most common case, when
    the argument is the defining class.
    vstinner committed Apr 21, 2021
  5. bpo-40137: _PyType_GetModuleByDef() doesn't check tp_flags (GH-25504)

    _PyType_GetModuleByDef() no longer checks if types are heap types.
    
    _PyType_GetModuleByDef() must only be called on a heap type created
    by PyType_FromModuleAndSpec() or on its subclasses.
    type_ready_mro() ensures that a static type cannot inherit from a
    heap type.
    vstinner committed Apr 21, 2021
  6. doc: Sync some missing 3.10 changes with the What's New (GH-25503)

    Automerge-Triggered-By: GH:isidentical
    isidentical committed Apr 21, 2021
  7. Fix typo in whatsnew/3.10.rst (GH-25498)

    krnick committed Apr 21, 2021
  8. bpo-38659: [Enum] add _simple_enum decorator (GH-25497)

    add:
    
    * `_simple_enum` decorator to transform a normal class into an enum
    * `_test_simple_enum` function to compare
    * `_old_convert_` to enable checking `_convert_` generated enums
    
    `_simple_enum` takes a normal class and converts it into an enum:
    
        @simple_enum(Enum)
        class Color:
            RED = 1
            GREEN = 2
            BLUE = 3
    
    `_old_convert_` works much like` _convert_` does, using the original logic:
    
        # in a test file
        import socket, enum
        CheckedAddressFamily = enum._old_convert_(
                enum.IntEnum, 'AddressFamily', 'socket',
                lambda C: C.isupper() and C.startswith('AF_'),
                source=_socket,
                )
    
    `_test_simple_enum` takes a traditional enum and a simple enum and
    compares the two:
    
        # in the REPL or the same module as Color
        class CheckedColor(Enum):
            RED = 1
            GREEN = 2
            BLUE = 3
    
        _test_simple_enum(CheckedColor, Color)
    
        _test_simple_enum(CheckedAddressFamily, socket.AddressFamily)
    
    Any important differences will raise a TypeError
    ethanfurman committed Apr 21, 2021
  9. bpo-38605: Revert making 'from __future__ import annotations' the def…

    …ault (GH-25490)
    
    This reverts commits 044a104 and 1be456a, adapting the code to changes that happened after it.
    pablogsal committed Apr 21, 2021

Commits on Apr 20, 2021

  1. bpo-43888: Reduce coverage collection timeout to 1h40m in GHA (GH-25471)

    Ref: 
    
    Signed-off-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
    webknjaz committed Apr 20, 2021
  2. docs: clarify what patterns Path.glob accepts (GH-25486)

    Automerge-Triggered-By: GH:Yhg1s
    nedbat committed Apr 20, 2021
  3. bpo-43799: Also define SSLv3_method() (GH-25481)

    Signed-off-by: Christian Heimes <christian@python.org>
    tiran committed Apr 20, 2021
  4. Document that random.gauss is normal distribution (GH-24935)

    jpaalasm committed Apr 20, 2021
  5. Improve the error message for choices(population, 10) (GH-25267)

    rhettinger committed Apr 20, 2021
  6. Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-…

    …25476)
    
    This reverts commit dbac8f4.
    ethanfurman committed Apr 20, 2021
  7. bpo-38659: [Enum] add _simple_enum decorator (GH-25285)

    add:
    
    _simple_enum decorator to transform a normal class into an enum
    _test_simple_enum function to compare
    _old_convert_ to enable checking _convert_ generated enums
    _simple_enum takes a normal class and converts it into an enum:
    
    @simple_enum(Enum)
    class Color:
        RED = 1
        GREEN = 2
        BLUE = 3
    
    _old_convert_ works much like _convert_ does, using the original logic:
    
    # in a test file
    import socket, enum
    CheckedAddressFamily = enum._old_convert_(
            enum.IntEnum, 'AddressFamily', 'socket',
            lambda C: C.isupper() and C.startswith('AF_'),
            source=_socket,
            )
    
    test_simple_enum takes a traditional enum and a simple enum and
    compares the two:
    
    # in the REPL or the same module as Color
    class CheckedColor(Enum):
        RED = 1
        GREEN = 2
        BLUE = 3
    
    _test_simple_enum(CheckedColor, Color)
    
    _test_simple_enum(CheckedAddressFamily, socket.AddressFamily)
    
    Any important differences will raise a TypeError
    ethanfurman committed Apr 20, 2021

Commits on Apr 19, 2021

  1. bpo-25460: Surround suggestions by quotes (GH-25473)

    pablogsal committed Apr 19, 2021
  2. Add doctests (GH-25474)

    rhettinger committed Apr 19, 2021
  3. bpo-43837: Reverse order of precedence table to show tightly binding …

    …operators first (GH-25469)
    ammaraskar committed Apr 19, 2021
  4. bpo-40849: Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag (GH-20463)

    This short PR exposes an openssl flag that  wasn't exposed. I've also updated to doc to reflect the change. It's heavily inspired by 990fcaa.
    l0x-c0d3z committed Apr 19, 2021
  5. bpo-43669: More test_ssl cleanups (GH-25470)

    Signed-off-by: Christian Heimes <christian@python.org>
    tiran committed Apr 19, 2021
  6. bpo-43880: Show DeprecationWarnings for deprecated ssl module features (

    GH-25455)
    
    * ssl.OP_NO_SSLv2
    * ssl.OP_NO_SSLv3
    * ssl.OP_NO_TLSv1
    * ssl.OP_NO_TLSv1_1
    * ssl.OP_NO_TLSv1_2
    * ssl.OP_NO_TLSv1_3
    * ssl.PROTOCOL_SSLv2
    * ssl.PROTOCOL_SSLv3
    * ssl.PROTOCOL_SSLv23 (alias for PROTOCOL_TLS)
    * ssl.PROTOCOL_TLS
    * ssl.PROTOCOL_TLSv1
    * ssl.PROTOCOL_TLSv1_1
    * ssl.PROTOCOL_TLSv1_2
    * ssl.TLSVersion.SSLv3
    * ssl.TLSVersion.TLSv1
    * ssl.TLSVersion.TLSv1_1
    * ssl.wrap_socket()
    * ssl.RAND_pseudo_bytes()
    * ssl.RAND_egd() (already removed since it's not supported by OpenSSL 1.1.1)
    * ssl.SSLContext() without a protocol argument
    * ssl.match_hostname()
    * hashlib.pbkdf2_hmac() (pure Python implementation, fast OpenSSL
      function will stay)
    
    Signed-off-by: Christian Heimes <christian@python.org>
    tiran committed Apr 19, 2021
  7. bpo-42854: Use SSL_read/write_ex() (GH-25468)

    The ssl module now uses ``SSL_read_ex`` and ``SSL_write_ex``
    internally. The functions support reading and writing of data larger
    than 2 GB. Writing zero-length data no longer fails with a protocol
    violation error.
    
    Signed-off-by: Christian Heimes <christian@python.org>
    tiran committed Apr 19, 2021
Older