]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
11 days agogh-137337: Clarify import statement namespace binding (GH-144607)
Kit Dallege [Mon, 4 May 2026 14:45:00 +0000 (16:45 +0200)] 
gh-137337: Clarify import statement namespace binding (GH-144607)

It is not always in the local namespace.

11 days agogh-148292: Remove shutdown() test in test_ssl.test_got_eof() (#149366)
Victor Stinner [Mon, 4 May 2026 14:20:25 +0000 (16:20 +0200)] 
gh-148292: Remove shutdown() test in test_ssl.test_got_eof() (#149366)

The shutdown() behavior depends too much on the operating system and
it's unrelated to the got_eof_error change.

11 days agogh-148675: Add Zd/Zf formats to array, ctypes, memoryview, struct (#148676)
Victor Stinner [Mon, 4 May 2026 14:14:23 +0000 (16:14 +0200)] 
gh-148675: Add Zd/Zf formats to array, ctypes, memoryview, struct (#148676)

* Add Zd/Zf format support to array, memoryview and struct.
* ctypes: Replace F/D/G complex format with Zf/Zd/Zg.
* Modify array, ctypes and struct modules to support format strings
  longer than 1 character (such as "Zd").
* Change array.typecodes type from str to tuple.

11 days agogh-147998: Fix possible memory leak in _pop_preserved (crossinterp.c) (GH-147999)
Maurycy Pawłowski-Wieroński [Mon, 4 May 2026 13:45:31 +0000 (15:45 +0200)] 
gh-147998: Fix possible memory leak in _pop_preserved (crossinterp.c) (GH-147999)

11 days agogh-149010: Improve reliability of inspect CLI (#149357)
Alyssa Coghlan [Mon, 4 May 2026 13:42:20 +0000 (20:42 +0700)] 
gh-149010: Improve reliability of inspect CLI (#149357)

* Handle non-source modules more gracefully (and consistently)
* Improve handling of frozen modules (which may or may not have source)
* Avoid reporting misleading info when looking up objects via aliases
* Refactor CLI implementation to improve testability
* Add several more test cases

Closes #149010

11 days agogh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream...
Wulian233 [Mon, 4 May 2026 13:42:02 +0000 (21:42 +0800)] 
gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream (GH-148419)

11 days agogh-146063: Add PyObject_CallFinalizerFromDealloc() to the limited C API (#146172)
Victor Stinner [Mon, 4 May 2026 13:37:45 +0000 (15:37 +0200)] 
gh-146063: Add PyObject_CallFinalizerFromDealloc() to the limited C API (#146172)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
11 days agogh-148600: Add OpenSSL 4.0.0 support to test configurations (#149356)
Victor Stinner [Mon, 4 May 2026 13:21:04 +0000 (15:21 +0200)] 
gh-148600: Add OpenSSL 4.0.0 support to test configurations (#149356)

Co-authored-by: Charlie Lin <tuug@gmx.us>
11 days agogh-87245: Improve IPv6Address.ipv4_mapped documentation (#92572)
wouter bolsterlee [Mon, 4 May 2026 13:03:20 +0000 (15:03 +0200)] 
gh-87245: Improve IPv6Address.ipv4_mapped documentation (#92572)

Avoid the phrasing ‘starting with ::FFFF/96’, which is confusing since
it seems to mix a prefix and a range. Instead, make it clear what the
actual range is, and refer to the relevant RFC.

Closes #87245.

11 days agogh-148352: Add more colour to `calendar` CLI output (#148354)
Hugo van Kemenade [Mon, 4 May 2026 12:14:57 +0000 (15:14 +0300)] 
gh-148352: Add more colour to `calendar` CLI output (#148354)

Co-authored-by: Rihaan Meher <sharktidedev@gmail.com>
11 days agogh-149351: Avoid possible broken macOS framework install names when DESTDIR is speci...
Ned Deily [Mon, 4 May 2026 11:55:06 +0000 (07:55 -0400)] 
gh-149351:  Avoid possible broken macOS framework install names when DESTDIR is specified during builds (#149352)

11 days agogh-148292: Update _ssl._SSLSocket for OpenSSL 4 (#149102)
Victor Stinner [Mon, 4 May 2026 11:52:57 +0000 (13:52 +0200)] 
gh-148292: Update _ssl._SSLSocket for OpenSSL 4 (#149102)

The _SSLSocket object now remembers if it gets an EOF error. In this
case, read(), sendfile(), write() and do_handshake method calls fail
with SSLEOFError without calling the underlying OpenSSL function.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
11 days agogh-149231: tomllib: Limit the number of parts in a key (GH-149233)
Petr Viktorin [Mon, 4 May 2026 11:49:07 +0000 (13:49 +0200)] 
gh-149231: tomllib: Limit the number of parts in a key (GH-149233)

Co-authored-by: Stan Ulbrych <stan@python.org>
11 days agogh-148849: Deprecate http.cookies.BaseCookie.js_output() (GH-148978)
kishorhange111 [Mon, 4 May 2026 09:51:17 +0000 (15:21 +0530)] 
gh-148849: Deprecate http.cookies.BaseCookie.js_output() (GH-148978)

11 days agogh-148093: Raise binascii.Error from binascii.a2b_uu() on empty input (GH-149077)
Maurycy Pawłowski-Wieroński [Mon, 4 May 2026 09:40:52 +0000 (11:40 +0200)] 
gh-148093: Raise binascii.Error from binascii.a2b_uu() on empty input (GH-149077)

Instead of reading past the end of the empty buffer.

11 days agogh-146609: Use argparse for colour help timeit CLI (#149334)
Hugo van Kemenade [Mon, 4 May 2026 08:44:37 +0000 (11:44 +0300)] 
gh-146609: Use argparse for colour help timeit CLI (#149334)

Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 days agogh-143732: allow dict subclasses to be specialized (GH-148128)
Kumar Aditya [Mon, 4 May 2026 08:39:03 +0000 (14:09 +0530)] 
gh-143732: allow dict subclasses to be specialized  (GH-148128)

11 days agogh-142389: Add colour to regrtest and pdb's help descriptions (#149332)
Hugo van Kemenade [Mon, 4 May 2026 07:20:23 +0000 (10:20 +0300)] 
gh-142389: Add colour to regrtest and pdb's help descriptions (#149332)

12 days agogh-149296: Add `dump` subcommand to sampling profiler for one-shot stack snapshots...
Pablo Galindo Salgado [Mon, 4 May 2026 00:02:33 +0000 (01:02 +0100)] 
gh-149296: Add `dump` subcommand to sampling profiler for one-shot stack snapshots (#149297)

Adds `python -m profiling.sampling dump <pid>`, which prints a single
traceback-style snapshot of a running process's Python stack via the
existing `_remote_debugging` unwinder. Supports per-thread status,
source line highlighting, optional bytecode opcodes, and async-aware
task reconstruction (`--async-aware`, default `--async-mode=all`).

12 days agogh-145521: Add 'infer_variance' parameter to ParamSpec class (#145522)
Kai (Kazuya Ito) [Sun, 3 May 2026 23:08:38 +0000 (08:08 +0900)] 
gh-145521: Add 'infer_variance' parameter to ParamSpec class (#145522)

12 days agogh-133956 fix bug where `dataclass` wouldn't detect `ClassVar` fields if `ClassVar...
Tamika Nomara [Sun, 3 May 2026 22:59:18 +0000 (02:59 +0400)] 
gh-133956 fix bug where `dataclass` wouldn't detect `ClassVar` fields if `ClassVar` was re-exported from a module other than `typing` (#140541)

Co-authored-by: Dmitrii Zherbin <zherbin.dima@yandex.ru>
12 days agogh-149254: Update CI to use latest OpenSSL and AWS-LC versions (GH-149330)
Zachary Ware [Sun, 3 May 2026 20:20:51 +0000 (15:20 -0500)] 
gh-149254: Update CI to use latest OpenSSL and AWS-LC versions (GH-149330)

Also update Modules/_ssl_data_36.h to include an added symbol from OpenSSL 3.6.2.

12 days agogh-149254: Update Windows builds to use OpenSSL 3.5.6 (GH-149326)
Zachary Ware [Sun, 3 May 2026 20:04:30 +0000 (15:04 -0500)] 
gh-149254: Update Windows builds to use OpenSSL 3.5.6 (GH-149326)

12 days agogh-148641: Implement PEP 829 - startup configuration files (#149109)
Barry Warsaw [Sun, 3 May 2026 17:17:29 +0000 (10:17 -0700)] 
gh-148641: Implement PEP 829 - startup configuration files (#149109)

Implement PEP 829 - startup configuration files
Also add `pkgutil.resolve_name(..., strict=True)`

Co-authored-by: Brett Cannon <brett@python.org>
12 days agogh-135056: Fix teardown order for Windows in `test_httpservers` (#149320)
Hugo van Kemenade [Sun, 3 May 2026 16:42:42 +0000 (19:42 +0300)] 
gh-135056: Fix teardown order for Windows in `test_httpservers` (#149320)

12 days agogh-135056: Add a `--header` CLI option to `http.server` (#135057)
Anton Ian Sipos [Sun, 3 May 2026 11:01:37 +0000 (04:01 -0700)] 
gh-135056: Add a `--header` CLI option to `http.server` (#135057)

Support custom headers in `python -m http.server` and `http.server.SimpleHTTPRequestHandler`.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
12 days agogh-149243: Check for recursion limits in `CALL_ALLOC_AND_ENTER_INIT` (#149310)
sobolevn [Sun, 3 May 2026 10:26:05 +0000 (13:26 +0300)] 
gh-149243: Check for recursion limits in `CALL_ALLOC_AND_ENTER_INIT` (#149310)

12 days agogh-143231: Do not swallow not matched warnings in assertWarns*() (GH-149229)
Serhiy Storchaka [Sun, 3 May 2026 10:24:57 +0000 (13:24 +0300)] 
gh-143231: Do not swallow not matched warnings in assertWarns*() (GH-149229)

unittest.TestCase methods assertWarns() and assertWarnsRegex() no longer
swallow warnings that do not match the specified category or regex.
Nested context managers are now supported.

12 days agogh-149217: Avoid adding dependencies on immutable, immortal classes in the JIT (GH149256)
Wulian233 [Sun, 3 May 2026 10:06:39 +0000 (18:06 +0800)] 
gh-149217: Avoid adding dependencies on immutable, immortal classes in the JIT (GH149256)

12 days agogh-143231: Add the module attribute to warnings.WarningMessage (GH-149298)
Serhiy Storchaka [Sun, 3 May 2026 09:35:47 +0000 (12:35 +0300)] 
gh-143231: Add the module attribute to warnings.WarningMessage (GH-149298)

12 days agoIgnore `/jit_unwind_info*.h` from git (#149311)
sobolevn [Sun, 3 May 2026 09:31:53 +0000 (12:31 +0300)] 
Ignore `/jit_unwind_info*.h` from git (#149311)

13 days agoGH-148189: Fix miscalculation of type-specific free list memory use (#148190)
Mazin Sharaf [Sun, 3 May 2026 03:03:13 +0000 (13:03 +1000)] 
GH-148189: Fix miscalculation of  type-specific free list memory use (#148190)

* Fix calculation of PyListObject size in allocator

* Fix size calculation in _PyDict_DebugMallocStats

* Fix memory size calculation in tupleobject.c

Adjusted memory calculation for PyTupleObject freelist entries.

* Revert in tupleobject.c

Removed unnecessary comment regarding memory calculation and the memory calculation itself.

* 📜🤖 Added by blurb_it.

* Update tupleobject.c

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
13 days agogh-141388: Improve docs/tests for non-function callables as annotate functions (...
dr-carlos [Sun, 3 May 2026 01:21:59 +0000 (10:51 +0930)] 
gh-141388: Improve docs/tests for non-function callables as annotate functions (#142327)

13 days agogh-139167: Allow users to hook gen_colors function to pyrepl Reader (#141619)
Tian Gao [Sat, 2 May 2026 20:28:00 +0000 (13:28 -0700)] 
gh-139167: Allow users to hook gen_colors function to pyrepl Reader (#141619)

13 days agogh-148871: extend and improve `LOAD_COMMON_CONSTANT` (GH-148971)
Neko Asakura [Sat, 2 May 2026 18:59:51 +0000 (02:59 +0800)] 
gh-148871: extend and improve `LOAD_COMMON_CONSTANT` (GH-148971)

13 days agogh-149171: Make TypeAliasType __module__ writable (#149172)
Eric Mark Martin [Sat, 2 May 2026 17:28:08 +0000 (13:28 -0400)] 
gh-149171: Make TypeAliasType __module__ writable (#149172)

closes #149171.

13 days agogh-149267: Document ast.Constant.kind attribute (#149268)
Anuj Nitin Bharambe [Sat, 2 May 2026 16:55:29 +0000 (22:25 +0530)] 
gh-149267: Document ast.Constant.kind attribute (#149268)

The kind attribute of ast.Constant was not mentioned in the
documentation. It is set to 'u' for u-prefixed string literals
and None for all other constants.

---------

Co-authored-by: Anuj Bharambe <anujnitinb@gmail.com>
13 days agogh-148063: documentation: move ast.compare from "Compiler flags" to "ast helpers...
Hunter Hogan [Sat, 2 May 2026 16:54:26 +0000 (11:54 -0500)] 
gh-148063: documentation: move ast.compare from "Compiler flags" to "ast helpers" (#147954)

13 days agogh-116021: Deprecate support for instantiating abstract AST nodes (#137865)
Brian Schubert [Sat, 2 May 2026 16:50:06 +0000 (12:50 -0400)] 
gh-116021: Deprecate support for instantiating abstract AST nodes (#137865)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
13 days agogh-149285: Increase recursion depth for `test_xml_etree` from 150k to 500k (#149286)
Zanie Blue [Sat, 2 May 2026 16:04:36 +0000 (11:04 -0500)] 
gh-149285: Increase recursion depth for `test_xml_etree` from 150k to 500k (#149286)

13 days agogh-149282: Fix `gc.c` compilation with `--enable-pystats` (#149283)
sobolevn [Sat, 2 May 2026 15:24:17 +0000 (18:24 +0300)] 
gh-149282: Fix `gc.c` compilation with `--enable-pystats` (#149283)

13 days agogh-146527: Remove private module entry from what's new (#149284)
Pablo Galindo Salgado [Sat, 2 May 2026 15:16:38 +0000 (16:16 +0100)] 
gh-146527: Remove private module entry from what's new (#149284)

Remove private module entry from what's new

13 days agoGH-146527: Add get_gc_stats function to _remote_debugging (#148071)
Sergey Miryanov [Sat, 2 May 2026 15:04:18 +0000 (20:04 +0500)] 
GH-146527: Add get_gc_stats function to _remote_debugging (#148071)

13 days agogh-148380: remove all uses of `_PyType_LookupByVersion` in `optimizer_bytecodes.c...
Neko Asakura [Sat, 2 May 2026 14:45:38 +0000 (22:45 +0800)] 
gh-148380: remove all uses of `_PyType_LookupByVersion` in `optimizer_bytecodes.c` (GH-148394)

13 days agogh-149214: Fix non ascii characters in remote debugging (#149228)
Pablo Galindo Salgado [Sat, 2 May 2026 14:07:28 +0000 (15:07 +0100)] 
gh-149214: Fix non ascii characters in remote debugging (#149228)

13 days agoGH-126910: Add gdb support for unwinding JIT frames (#146071)
Diego Russo [Sat, 2 May 2026 13:42:03 +0000 (14:42 +0100)] 
GH-126910: Add gdb support for unwinding JIT frames (#146071)

Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
13 days agogh-149221: Minor comment edit (gh-149278)
Raymond Hettinger [Sat, 2 May 2026 13:29:06 +0000 (08:29 -0500)] 
gh-149221: Minor comment edit (gh-149278)

Minor comment edit

13 days agogh-149221:Fix binomialvariate Function for random module (gh-149222)
lighting9999 [Sat, 2 May 2026 12:55:43 +0000 (20:55 +0800)] 
gh-149221:Fix binomialvariate Function for random module (gh-149222)

13 days agoGH-148932: Improve error message if profiling.sampling run from venv on Windows platf...
Sergey Miryanov [Sat, 2 May 2026 09:23:16 +0000 (14:23 +0500)] 
GH-148932: Improve error message if profiling.sampling run from venv on Windows platform (#149247)

13 days agogh-148914: Fix memoization of in-band PickleBuffer in the Python implementation ...
Serhiy Storchaka [Sat, 2 May 2026 09:04:05 +0000 (12:04 +0300)] 
gh-148914: Fix memoization of in-band PickleBuffer in the Python implementation (GH-149052)

Previously, identical PickleBuffers did not preserve identity.
Also, empty writable PickleBuffer memoized an empty bytearray object
in place of b'' which is a singleton in CPython, so the following
references to b'' were unpickled as an empty bytearray object.

13 days agogh-149254: Bump OpenSSL versions for iOS and Android. (#149270)
Russell Keith-Magee [Sat, 2 May 2026 08:50:32 +0000 (16:50 +0800)] 
gh-149254: Bump OpenSSL versions for iOS and Android. (#149270)

Bump OpenSSL versions for iOS and Android.

2 weeks agogh-149244 Document statistics functions that require sequence inputs. (gh-149264)
Raymond Hettinger [Sat, 2 May 2026 03:58:23 +0000 (22:58 -0500)] 
gh-149244 Document statistics functions that require sequence inputs. (gh-149264)

2 weeks agostatistics: Fix geometric_mean() error message for negative inputs (#149246)
htjworld [Sat, 2 May 2026 03:54:24 +0000 (12:54 +0900)] 
statistics: Fix geometric_mean() error message for negative inputs (#149246)

2 weeks agogh-149254: Update macOS installer to use OpenSSL 3.5.6. (#149262)
Ned Deily [Sat, 2 May 2026 03:52:43 +0000 (23:52 -0400)] 
gh-149254: Update macOS installer to use OpenSSL 3.5.6. (#149262)

2 weeks agogh-149117: Set `ImportError.name` on errors from `runpy.run_module`/`run_path` (gh...
W. H. Wang [Sat, 2 May 2026 02:27:23 +0000 (10:27 +0800)] 
gh-149117: Set `ImportError.name` on errors from `runpy.run_module`/`run_path` (gh-149159)

Set ImportError.name on errors from runpy.run_module/run_path

`runpy.run_module()` and `runpy.run_path()` now set the `name` attribute
of the `ImportError` they raise to the requested module name, matching
the behaviour of a regular import statement (previously `name` was
always `None`, which broke introspection).

The `name=` kwarg is gated on `issubclass(error, ImportError)` because
`_get_module_details()` is also used by `_run_module_as_main()` with
a private `_Error` sentinel class. `_Error` does not subclass
ImportError, and `BaseException.__init__` rejects unknown kwargs at
the C level, so passing `name=` unconditionally would break the
`python -m foo` codepath.

2 weeks agoGH-149252: Update WASI SDK version from 32 to 33 (#149253)
Brett Cannon [Fri, 1 May 2026 23:51:06 +0000 (16:51 -0700)] 
GH-149252: Update WASI SDK version from 32 to 33 (#149253)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 weeks agogh-75707: tarfile: Add optional open() argument "mtime" (GH-138117)
Amp Tell [Fri, 1 May 2026 22:39:58 +0000 (00:39 +0200)] 
gh-75707: tarfile: Add optional open() argument "mtime" (GH-138117)

This makes it possible to set the gzip header mtime field without
overriding time.time(), making it useful when creating reproducible
archives.

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2 weeks agogh-124397: Add free-threading support for iterators. (gh-148894)
Raymond Hettinger [Fri, 1 May 2026 21:31:00 +0000 (16:31 -0500)] 
gh-124397: Add free-threading support for iterators. (gh-148894)

2 weeks agogh-149202: Implement PEP 831 – Frame Pointers Everywhere: Enabling System-Level Obser...
Pablo Galindo Salgado [Fri, 1 May 2026 20:16:11 +0000 (21:16 +0100)] 
gh-149202: Implement PEP 831 – Frame Pointers Everywhere: Enabling System-Level Observability for Python (#149201)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2 weeks agogh-149083: Change several other docs examples to use `sentinel()` (#149213)
sobolevn [Fri, 1 May 2026 19:53:28 +0000 (22:53 +0300)] 
gh-149083: Change several other docs examples to use `sentinel()` (#149213)

2 weeks agoFix source link in `Doc/howto/descriptor.rst` (#149215)
sobolevn [Fri, 1 May 2026 19:37:14 +0000 (22:37 +0300)] 
Fix source link in `Doc/howto/descriptor.rst` (#149215)

2 weeks agoClarify `max_length` in zstd & zlib decompressor documentation (#143805)
Sam Bull [Fri, 1 May 2026 19:32:50 +0000 (20:32 +0100)] 
Clarify `max_length` in zstd & zlib decompressor documentation (#143805)

Also provide examples of how to decompress data using max_length for zstd and zlib.

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2 weeks agogh-148726: Document the GC change in What's New in Python 3.14 (#149209)
Hugo van Kemenade [Fri, 1 May 2026 18:57:09 +0000 (21:57 +0300)] 
gh-148726: Document the GC change in What's New in Python 3.14 (#149209)

2 weeks agogh-139038: Update final JIT figures for 3.15rc1 (#149210)
Ken Jin [Fri, 1 May 2026 18:55:38 +0000 (19:55 +0100)] 
gh-139038: Update final JIT figures for 3.15rc1 (#149210)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks agoBuild mpdecimal from source to workaround unreliable launchpad.net (#149248)
Hugo van Kemenade [Fri, 1 May 2026 18:39:36 +0000 (21:39 +0300)] 
Build mpdecimal from source to workaround unreliable launchpad.net (#149248)

2 weeks agogh-81074: Allow non-ASCII addr_spec in email.headerregistry.Address (#122477)
Mike Edmunds [Fri, 1 May 2026 18:00:46 +0000 (11:00 -0700)] 
gh-81074: Allow non-ASCII addr_spec in email.headerregistry.Address (#122477)

The email.headerregistry.Address constructor raised an error if
addr_spec contained a non-ASCII character. (But it fully supports
non-ASCII in the separate username and domain args.) This change
removes the error for a non-ASCII addr_spec, as well as the
Defect that triggered it.  In the unicode era non-ascii is not a
defect, though it is an error when an attempt is made to serialize
it to ascii.  The serialization issue was handled in #122540.

2 weeks agogh-83938, gh-122476: Stop incorrectly RFC 2047 encoding non-ASCII email addresses...
Mike Edmunds [Fri, 1 May 2026 17:52:06 +0000 (10:52 -0700)] 
gh-83938, gh-122476: Stop incorrectly RFC 2047 encoding non-ASCII email addresses (#122540)

The email generators had been incorrectly flattening non-ASCII email
addresses to RFC 2047 encoded-word format, leaving them undeliverable.
(RFC 2047 prohibits use of encoded-word in an addr-spec.)
This change raises a HeaderWriteError when attempting to flatten an
EmailMessage with a non-ASCII addr-spec and a policy with utf8=False.
(Exception: If the non-ASCII address originated from parsing a message,
it will be flattened as originally parsed, without error.)  This also applies
to other contexts in which RFC2047 words are not allowed by the RFCs.

Non-ASCII email addresses are supported when using a policy with
utf8=True (such as email.policy.SMTPUTF8) under RFCs 6531 and 6532.

Non-ASCII email address domains (but not localparts) can also be used
with non-SMTPUTF8 policies by encoding the domain as an IDNA A-label.
(The email package does not perform this encoding, because it cannot
know whether the caller wants IDNA 2003, IDNA 2008, or some other
variant such as UTS #46.)

Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2 weeks agogh-148850: Fix memory sanitizer false positive in os.getrandom (GH-148851)
petervanvugt [Fri, 1 May 2026 15:37:36 +0000 (08:37 -0700)] 
gh-148850: Fix memory sanitizer false positive in os.getrandom (GH-148851)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 weeks agogh-148967: Fix FFI type pointer handling for C complex support in set_stginfo_ffi_typ...
sunmy2019 [Fri, 1 May 2026 12:12:08 +0000 (20:12 +0800)] 
gh-148967: Fix FFI type pointer handling for C complex support in set_stginfo_ffi_type_pointer (GH-148969)

2 weeks agogh-149204: add `_RROT_3` uop to reduce stack moves (GH-149205)
Neko Asakura [Fri, 1 May 2026 11:35:31 +0000 (19:35 +0800)] 
gh-149204: add `_RROT_3` uop to reduce stack moves (GH-149205)

2 weeks agogh-133560: Clarified `parser.md` doc for pegen parser issue in using the existing...
chemelnucfin [Fri, 1 May 2026 08:11:53 +0000 (01:11 -0700)] 
gh-133560: Clarified `parser.md` doc for pegen parser issue in using the existing `Grammar/python.gram` file. (GH-139194)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 weeks agogh-145497: Use same size of static_types array in all builds (GH-149139)
Petr Viktorin [Fri, 1 May 2026 07:41:28 +0000 (09:41 +0200)] 
gh-145497: Use same size of static_types array in all builds (GH-149139)

When someone adds a new type but doesn't increment
`_Py_MAX_MANAGED_STATIC_BUILTIN_TYPES` or
`_Py_MAX_MANAGED_STATIC_EXT_TYPES`, JIT tests fail,
because JIT builds define an extra type.
But the JIT tests don't necessarily run for the commit
that causes the failure.

As a workaround, use the same size for the array for all
builds, potentially with an empty spot.

2 weeks agogh-149173: Fix inverted PYTHON_BASIC_REPL environment check in _pyrepl_available...
Tan Long [Fri, 1 May 2026 05:32:57 +0000 (13:32 +0800)] 
gh-149173: Fix inverted PYTHON_BASIC_REPL environment check in _pyrepl_available() (#149174)

2 weeks agoGH-146475: Block Apple Clang for building JIT stencils (#149188)
Savannah Ostrowski [Thu, 30 Apr 2026 22:09:36 +0000 (15:09 -0700)] 
GH-146475: Block Apple Clang for building JIT stencils (#149188)

2 weeks agogh-148518 fix index error in local part attribute (#148522)
R. David Murray [Thu, 30 Apr 2026 21:41:43 +0000 (17:41 -0400)] 
gh-148518 fix index error in local part attribute (#148522)

As part of fixing bpo-27931 code was introduced to get_bare_quoted_string
that added an empty Terminal if the quoted string was empty.  This isn't
the best answer in terms of the parse tree; we really want the token
list to be empty in that case.  But having it be empty resulted in
local_part raising the index error.  We find that same problem if we
try to parse an address consisting of a single dquote.  By fixing
local_part to not raise on an empty token list, we can have the
bare_quoted_string code correctly return an empty token list for
the empty string cases (two dquotes or a single dquote as the
entire addrespec, at the end of a line).

2 weeks agogh-144319: Use transparent huge pages via `madvise(MADV_HUGEPAGE)` in pymalloc (...
Maurycy Pawłowski-Wieroński [Thu, 30 Apr 2026 21:18:07 +0000 (23:18 +0200)] 
gh-144319: Use transparent huge pages via `madvise(MADV_HUGEPAGE)` in pymalloc (#144353)

2 weeks agogh-149028: Revert gh-92936 changes (GH-149182)
Serhiy Storchaka [Thu, 30 Apr 2026 19:19:46 +0000 (22:19 +0300)] 
gh-149028: Revert gh-92936 changes (GH-149182)

* Revert "gh-92936: update `http.cookies` docs post GH-113663 (#137566)"

This reverts commit d86c2257a69a8d6c650c0db470499463131a569f.

* Revert "gh-92936: allow double quote in cookie values (#113663)"

This reverts commit d7dbde895884d58e3da7ed4107fd33171afad7cb.

2 weeks agoGH-148726: Forward-port generational GC. (GH-148746)
Sergey Miryanov [Thu, 30 Apr 2026 19:19:13 +0000 (00:19 +0500)] 
GH-148726: Forward-port generational GC. (GH-148746)

The replaces the incremental GC with a forward port (from 3.13) of the generational GC.

Co-Authored-By: Neil Schemenauer <nas@arctrix.com>
Co-Authored-By: Zanie Blue <contact@zanie.dev>
Co-Authored-By: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 weeks agobpo-39100: _header_value_parser: do not treat a Group as invalid-mailbox (#24872)
elenril [Thu, 30 Apr 2026 17:24:23 +0000 (18:24 +0100)] 
bpo-39100: _header_value_parser: do not treat a Group as invalid-mailbox (#24872)

When an address in an address-list has garbage at the end, the code will
currently:

1. change the mailbox in the last parsed address into invalid-mailbox by
   overriding its token_type;
2. wrap the trailing garbage into another invalid-mailbox and append it
   to the last parsed address.

However, that does not take into account that an address may
also contain a Group instead of a single mailbox. In that case,
overwriting token_type leads to undesirable results, e.g. parsing an
email with the following 'To' header:

unlisted-recipients:; (no To-header on input)

raises an AttributeError from trying to treat the Group as a Mailbox.

Moreover it is questionable whether the previously parsed mailbox should
be treated as invalid in addition to the trailing garbage.

Address both of the above by wrapping the trailing garbage in a new
Address with a single invalid-mailbox, and append it to the AddressList
directly.

Changes the results of the
test_get_address_list_mailboxes_invalid_addresses test, where the
address list is now parsed into 4 mailboxes instead of 3 (all but the
first one are invalid).

2 weeks agogh-147991: Speed up tomllib import time (GH-147992)
Victor Stinner [Thu, 30 Apr 2026 16:25:32 +0000 (18:25 +0200)] 
gh-147991: Speed up tomllib import time (GH-147992)

- Use lazy import for regular expressions.
- Use frozendict for string escapes

Co-authored-by: Taneli Hukkinen <hukkinen@eurecom.fr>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2 weeks agogh-149083: Use `sentinel` in `functools.rst` docs (#149176)
sobolevn [Thu, 30 Apr 2026 16:18:56 +0000 (19:18 +0300)] 
gh-149083: Use `sentinel` in `functools.rst` docs (#149176)

2 weeks agogh-113471: Add custom default Content-Type to http.server (#113475)
John Comeau [Thu, 30 Apr 2026 15:00:48 +0000 (08:00 -0700)] 
gh-113471: Add custom default Content-Type to http.server (#113475)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: donBarbos <donbarbos@proton.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 weeks agogh-148829: Move sentinelobject.h to Include/cpython/ (#149186)
Victor Stinner [Thu, 30 Apr 2026 14:57:29 +0000 (16:57 +0200)] 
gh-148829: Move sentinelobject.h to Include/cpython/ (#149186)

This C API is not part of the limited C API, so move it to the
CPython C API.

2 weeks agogh-111264: Add a note about untrusted input to tomllib docs (GH-146209)
Petr Viktorin [Thu, 30 Apr 2026 14:33:13 +0000 (16:33 +0200)] 
gh-111264: Add a note about untrusted input to tomllib docs (GH-146209)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 weeks agogh-149085: Add `max_threads` keyword to `faulthandler.dump_traceback()` (GH-149106)
Eric Froemling [Thu, 30 Apr 2026 13:27:57 +0000 (06:27 -0700)] 
gh-149085: Add `max_threads` keyword to `faulthandler.dump_traceback()` (GH-149106)

Add a keyword-only `max_threads` argument to `dump_traceback()` and
`dump_traceback_later()`, defaulting to 100 to preserve existing
behavior. Allows server processes with many worker threads to dump
beyond the historical 100-thread cap (previously a hardcoded
`MAX_NTHREADS = 100` in `Python/traceback.c`).

The cap matters in practice: tstates are prepended to the
PyInterpreterState linked list, so the dump walks newest-first. With
more than 100 threads alive, the main thread (oldest, at the tail) is
silently elided from watchdog dumps -- exactly the thread that's
usually wanted.

The hardcoded value is moved to a new internal macro
`_Py_TRACEBACK_MAX_NTHREADS` in `pycore_traceback.h` so the in-tree
fatal-signal callers all reference one source of truth.

2 weeks agogh-149122: Fix refleak in codegen (GH-149179)
Petr Viktorin [Thu, 30 Apr 2026 10:05:48 +0000 (12:05 +0200)] 
gh-149122: Fix refleak in codegen (GH-149179)

2 weeks agogh-149049: Fix jit binary op stack underflow (GH-149076)
Pieter Eendebak [Thu, 30 Apr 2026 09:36:04 +0000 (11:36 +0200)] 
gh-149049: Fix jit binary op stack underflow (GH-149076)

2 weeks agoRevert pylock.toml change to make MSI builds pass (#149175)
Petr Viktorin [Thu, 30 Apr 2026 08:30:34 +0000 (10:30 +0200)] 
Revert pylock.toml change to make MSI builds pass (#149175)

GH-149058 made MSI installer tests fail. GHA didn't catch this because MSI-related files weren't changed.

This reverts the build.bat change from commit 40dc61a0e0672810c3934da8cc2eda68027c24ce.

Also: a README style nitpick to trigger CI.

2 weeks agoGH-145378: Use PyREPL as the default input console for pdb (#145379)
Tian Gao [Thu, 30 Apr 2026 05:55:09 +0000 (22:55 -0700)] 
GH-145378: Use PyREPL as the default input console for pdb (#145379)

2 weeks agogh-149083: Convert dataclasses.MISSING and dataclasses.KW_ONLY to sentinels (#149086)
Jelle Zijlstra [Thu, 30 Apr 2026 02:39:29 +0000 (19:39 -0700)] 
gh-149083: Convert dataclasses.MISSING and dataclasses.KW_ONLY to sentinels (#149086)

There were comments claiming these were implemented as custom classes to give a nicer
repr(), but the repr() wasn't all that nice:

>>> repr(dataclasses.MISSING)
'<dataclasses._MISSING_TYPE object at 0x1005e7e00>'
>>> repr(dataclasses.KW_ONLY)
'<dataclasses._KW_ONLY_TYPE object at 0x100884050>'

Sentinels are conceptually the right tool for these, so let's use them.

This does change the repr() of these two objects.

2 weeks agogh-149026: Add colour to `pickletools` CLI output (#149027)
Hugo van Kemenade [Wed, 29 Apr 2026 15:33:05 +0000 (18:33 +0300)] 
gh-149026: Add colour to `pickletools` CLI output (#149027)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 weeks agogh-149148: Upgrade bundled pip to 26.1 (#149150)
Victor Stinner [Wed, 29 Apr 2026 14:36:01 +0000 (16:36 +0200)] 
gh-149148: Upgrade bundled pip to 26.1 (#149150)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 weeks agogh-148740: Fix `uuid` CLI with custom UUIDs for UUIDv3/v5 namespaces (#148741)
Jansen Price [Wed, 29 Apr 2026 13:44:22 +0000 (08:44 -0500)] 
gh-148740: Fix `uuid` CLI with custom UUIDs for UUIDv3/v5 namespaces (#148741)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 weeks agogh-149122: Fix segfault in compiler when certain builtin functions are passed a corou...
Irit Katriel [Wed, 29 Apr 2026 13:35:51 +0000 (14:35 +0100)] 
gh-149122: Fix segfault in compiler when certain builtin functions are passed a coroutine as arg (#149138)

2 weeks agogh-135528: Support more second-level domain names in http.cookiejar (#135820)
Weilin Du [Wed, 29 Apr 2026 11:33:51 +0000 (19:33 +0800)] 
gh-135528: Support more second-level domain names in http.cookiejar (#135820)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 weeks agogh-142927: Show module names instead of file paths in flamegraph (#146040)
ivonastojanovic [Wed, 29 Apr 2026 09:00:07 +0000 (10:00 +0100)] 
gh-142927: Show module names instead of file paths in flamegraph (#146040)

2 weeks agogh-148829: bump number of static types (#149121)
Jelle Zijlstra [Wed, 29 Apr 2026 01:59:48 +0000 (18:59 -0700)] 
gh-148829: bump number of static types (#149121)

2 weeks agogh-149119: docs: mention that sentinel does not support subclassing (#149120)
Stelar [Tue, 28 Apr 2026 23:50:53 +0000 (01:50 +0200)] 
gh-149119: docs: mention that sentinel does not support subclassing (#149120)

Add note about sentinel objects not supporting subclassing

Clarify that sentinel objects do not support subclassing.

2 weeks agoBuild docs from `pylock.toml` (#149058)
Hugo van Kemenade [Tue, 28 Apr 2026 18:45:38 +0000 (21:45 +0300)] 
Build docs from `pylock.toml` (#149058)

2 weeks agoReplace deprecated action with RtD app (#149111)
Hugo van Kemenade [Tue, 28 Apr 2026 17:30:16 +0000 (20:30 +0300)] 
Replace deprecated action with RtD app (#149111)