summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-43795: PEP-652: Simplify headers for easier static analysis (GH-25483)Petr Viktorin2021-04-232-1/+4
| | | | | | | | | | | | | | | | | | | | As part of the PEP-652 implementation, I'll tighten the CI check for functions/data defined with `Py_LIMITED_API`. Discussion in https://discuss.python.org/t/pep-652-maintaining-the-stable-abi/6986 suggests that parsing C headers is OK (though personally I'd rather generate it...), but writing a full C parser is a monumental task and adding an existing one as a dependency brings too many vendoring/bootstraping issues. So, for the check I'll use a "simple" regex on preprocessor output, and adapt the few trivial places where the regex won't work. - Keep declarations in the limited API to one item per line - Make it possible to override `_Py_NO_RETURN`, so the annotation can be removed from preprocessor output. https://bugs.python.org/issue43795
* bpo-41282: (PEP 632) Deprecate distutils.sysconfig (partial implementation ↵Lumír 'Frenzy' Balhar2021-04-2315-446/+212
| | | | | | | | | | of the PEP) (GH-23142) This change: * merges `distutils.sysconfig` into `sysconfig` while keeping the original functionality and * marks `distutils.sysconfig` as deprecated https://bugs.python.org/issue41282
* bpo-43920: Make load_verify_locations(cadata) error message consistent ↵Christian Heimes2021-04-233-10/+26
| | | | | (GH-25554) Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43852: Improve tuple creation in sqlite3 (GH-25421)Erlend Egeberg Aasland2021-04-232-18/+10
|
* bpo-37363: Add audit events to the `http.client` module (GH-21321)Saiyang Gou2021-04-235-0/+41
| | | | | Add audit events to the `http.client` module Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-37751: Document codecs.lookup() change in What's New in Python 3.9 ↵Hai Shi2021-04-231-0/+6
| | | | (GH-23096)
* Add more tests. Fix code excerpt. (GH-25549)Raymond Hettinger2021-04-231-3/+18
|
* Reformat idlelib colorizer (GH-25479)E-Paine2021-04-231-16/+20
| | | | | Also replace if-then and and-or with conditional expressions. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-43917: Fix pure python equivalent for classmethod (GH-25544)Raymond Hettinger2021-04-232-2/+14
| | | Reported by Yahor Harunovich.
* bpo-39572: Address typo in CHANGELOG. (GH-24999)Simon Charette2021-04-231-1/+1
|
* bpo-38222: Check specifically for a drive, not just a colon (GH-25540)Steve Dower2021-04-221-2/+2
|
* bpo-35306: Avoid raising OSError from pathlib.Path.exists when passed an ↵Steve Dower2021-04-222-0/+3
| | | | invalid filename (GH-25529)
* bpo-43915: Add PCbuild/blurb.bat to simplify Windows contributors (GH-25528)Steve Dower2021-04-221-0/+28
|
* bpo-38822: Fixed os.stat failing on inaccessible directories. (GH-25527)Steve Dower2021-04-222-2/+24
| | | It would just fail if the path was inaccessible and had a trailing slash. It should fall back to the parent directory's metadata.
* bpo-43284: Update platform.win32_ver to use _syscmd_ver instead of ↵Shreyan Avigyan2021-04-223-11/+23
| | | | | | | sys.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.
* bpo-43475: Fix worst case collision behavior for NaN instances (GH-25493)Raymond Hettinger2021-04-2210-21/+25
|
* Fix typo in the documentation (GH-24703)Alperen Serkan Aksöz2021-04-220-0/+0
| | | | | Missing multiply symbol added Automerge-Triggered-By: GH:merwok
* bpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to right ↵Saiyang Gou2021-04-222-24/+27
| | | | section (GH-22608)
* bpo-38659: Properly re-intialize module variables in test_enum (GH-25516)Ammar Askar2021-04-221-2/+13
| | | | | | | | | | 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.
* bpo-26227: Fixes decoding of host names on Windows from ANSI instead of ↵Steve Dower2021-04-212-1/+3
| | | | UTF-8 (GH-25510)
* bpo-40137: Add pycore_moduleobject.h internal header (GH-25507)Victor Stinner2021-04-2121-47/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bpo-43756: Add new audit event for new arguments added to glob.glob (GH-25239)Saiyang Gou2021-04-213-1/+11
|
* bpo-43472: Ensure PyInterpreterState_New audit events are raised when called ↵Steve Dower2021-04-213-3/+6
| | | | through _xxsubinterpreters module (GH-25506)
* bpo-40137: Move state lookups out of the critical path (GH-25492)Raymond Hettinger2021-04-211-28/+36
|
* bpo-40137: Optimize _PyType_GetModuleByDef() loop (GH-25505)Victor Stinner2021-04-211-5/+21
| | | | | | | 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.
* bpo-40137: _PyType_GetModuleByDef() doesn't check tp_flags (GH-25504)Victor Stinner2021-04-211-15/+14
| | | | | | | | _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.
* doc: Sync some missing 3.10 changes with the What's New (GH-25503)Batuhan Taskaya2021-04-211-1/+27
| | | Automerge-Triggered-By: GH:isidentical
* Fix typo in whatsnew/3.10.rst (GH-25498)JunWei Song2021-04-211-2/+2
|
* bpo-38659: [Enum] add _simple_enum decorator (GH-25497)Ethan Furman2021-04-2120-34/+870
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* bpo-43859: Improve the error message for IndentationError exceptions (GH-25431)Pablo Galindo2021-04-216-554/+2185
|
* bpo-38605: Revert making 'from __future__ import annotations' the default ↵Pablo Galindo2021-04-2132-523/+436
| | | | | | (GH-25490) This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it.
* Update Sphinx directive for super from function to class (GH-25489)Géry Ogam2021-04-201-1/+1
|
* bpo-43888: Reduce coverage collection timeout to 1h40m in GHA (GH-25471)Sviatoslav Sydorenko2021-04-201-0/+1
| | | | | Ref: Signed-off-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
* docs: clarify what patterns Path.glob accepts (GH-25486)Ned Batchelder2021-04-201-2/+3
| | | Automerge-Triggered-By: GH:Yhg1s
* bpo-43799: Also define SSLv3_method() (GH-25481)Christian Heimes2021-04-202-8/+3
| | | Signed-off-by: Christian Heimes <christian@python.org>
* Document that random.gauss is normal distribution (GH-24935)Joonas Paalasmaa2021-04-201-3/+3
|
* Improve the error message for choices(population, 10) (GH-25267)Raymond Hettinger2021-04-201-1/+9
|
* Revert "bpo-38659: [Enum] add _simple_enum decorator (GH-25285)" (GH-25476)Ethan Furman2021-04-2020-871/+34
| | | This reverts commit dbac8f40e81eb0a29dc833e6409a1abf47467da6.
* bpo-38659: [Enum] add _simple_enum decorator (GH-25285)Ethan Furman2021-04-2020-34/+871
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* bpo-25460: Surround suggestions by quotes (GH-25473)Pablo Galindo2021-04-192-16/+16
|
* Add doctests (GH-25474)Raymond Hettinger2021-04-191-3/+45
|
* bpo-43837: Reverse order of precedence table to show tightly binding ↵Ammar Askar2021-04-191-29/+29
| | | | operators first (GH-25469)
* bpo-40849: Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag (GH-20463)l0x2021-04-194-0/+18
| | | 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 990fcaac3c428569697f62a80fd95ab4d4b93151.
* bpo-43669: More test_ssl cleanups (GH-25470)Christian Heimes2021-04-191-78/+21
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43880: Show DeprecationWarnings for deprecated ssl module features ↵Christian Heimes2021-04-1914-201/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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>
* bpo-42854: Use SSL_read/write_ex() (GH-25468)Christian Heimes2021-04-194-18/+34
| | | | | | | | 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>
* bpo-36076: Add SNI support to ssl.get_server_certificate. (GH-16820)juhovh2021-04-184-2/+28
| | | | | | | | | | | | | | Many servers in the cloud environment require SNI to be used during the SSL/TLS handshake, therefore it is not possible to fetch their certificates using the ssl.get_server_certificate interface. This change adds an additional optional hostname argument that can be used to set the SNI. Note that it is intentionally a separate argument instead of using the host part of the addr tuple, because one might want to explicitly fetch the default certificate or fetch a certificate from a specific IP address with the specified SNI hostname. A separate argument also works better for backwards compatibility. Automerge-Triggered-By: GH:tiran
* bpo-43641: Stop stating that TLS 1.2 is the most modern version in docs ↵Illia Volochii2021-04-181-3/+2
| | | | | (GH-25041) Automerge-Triggered-By: GH:tiran
* bpo-43362: Fix invalid free and return check in _sha3 module (GH-25463)Christian Heimes2021-04-182-3/+11
| | | | | | | | | | | Commit 93d50a6a8d0c5d332c11aef267e66573a09765ac / GH-21855 changed the order of variable definitions, which introduced a potential invalid free bug. Py_buffer object is now initialized earlier and the result of Keccak initialize is verified. Co-authored-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Christian Heimes <christian@python.org> Co-authored-by: Alex Henrie <alexhenrie24@gmail.com>
* Fix type group capture in the PEG highlight tool (GH-25464)Pablo Galindo2021-04-171-2/+7
|