]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 hours agogh-148211: decompose `_SHUFFLE_3_LOAD_CONST_INLINE_BORROW` in JIT (GH-148816) main
Neko Asakura [Tue, 28 Apr 2026 12:48:23 +0000 (20:48 +0800)] 
gh-148211: decompose `_SHUFFLE_3_LOAD_CONST_INLINE_BORROW` in JIT (GH-148816)

2 hours agogh-148571: [JIT] Preserve family-head recorder layouts for specialized opcode familie...
Hai Zhu [Tue, 28 Apr 2026 12:41:16 +0000 (20:41 +0800)] 
gh-148571: [JIT] Preserve family-head recorder layouts for specialized opcode families (GH-148730)

* Records the same objects for each member of family before execution
* Records derived values when recording the trace
* This makes sure that specialization, or deoptimization, does not cause invalid values to be recorded

7 hours agoGH-83065: Fix import deadlock by implementing hierarchical module locking (GH-137196)
Gregory P. Smith [Tue, 28 Apr 2026 08:06:23 +0000 (01:06 -0700)] 
GH-83065: Fix import deadlock by implementing hierarchical module locking (GH-137196)

Make _find_and_load() acquire the module locks for the full
dotted-name chain (parent before child) when loading a nested module, so
both threads contend on the same first lock and serialise instead of
deadlocking.

When acquiring a parent's lock would itself deadlock with another thread
that is loading that parent (cross-package circular imports), the parent's
lock is skipped and the partially-initialised parent is accepted -- the
same policy _lock_unlock_module() already applies on the existing code
path -- so concurrent circular imports that worked before continue to work.

10 hours agogh-125862: Keep ContextDecorator open across generator/coroutine execution (GH-136212)
Alex Grönholm [Tue, 28 Apr 2026 05:26:38 +0000 (08:26 +0300)] 
gh-125862: Keep ContextDecorator open across generator/coroutine execution (GH-136212)

ContextDecorator and AsyncContextDecorator (and therefore @contextmanager
and @asynccontextmanager used as decorators) now detect generator,
coroutine, and asynchronous generator functions and emit a wrapper of the
matching kind, so the context manager spans iteration or await rather than
just the call that constructs the lazy object.  Wrapped generators are
explicitly closed when iteration ends.

For asynchronous generator wrappers, values passed via asend() and
exceptions via athrow() are not forwarded to the wrapped generator.

AsyncContextDecorator now also accepts synchronous functions and
generators, returning an asynchronous wrapper; ContextDecorator remains
the recommended choice for those.

inspect.isgeneratorfunction(), iscoroutinefunction(), and
isasyncgenfunction() now return True for the decorated result when the
input is of that kind.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
10 hours agogh-149035: Modernize legacy Python patterns in `Doc/tutorial/stdlib2.rst` (#149036)
ByteFlow [Tue, 28 Apr 2026 05:08:23 +0000 (13:08 +0800)] 
gh-149035: Modernize legacy Python patterns in `Doc/tutorial/stdlib2.rst` (#149036)

Co-authored-by: Copilot <copilot@github.com>
12 hours agogh-137600: Promote `ast` node constructor deprecation warnings to errors (#137601)
Brian Schubert [Tue, 28 Apr 2026 02:51:06 +0000 (22:51 -0400)] 
gh-137600: Promote `ast` node constructor deprecation warnings to errors (#137601)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
13 hours agogh-148829: Implement PEP 661 (#148831)
Jelle Zijlstra [Tue, 28 Apr 2026 02:28:30 +0000 (19:28 -0700)] 
gh-148829: Implement PEP 661 (#148831)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
16 hours agogh-148252: Avoid overflow in `_remote_debugging` binary reader bounds checks (#148972)
Maurycy Pawłowski-Wieroński [Mon, 27 Apr 2026 23:06:23 +0000 (01:06 +0200)] 
gh-148252: Avoid overflow in `_remote_debugging` binary reader bounds checks (#148972)

19 hours agogh-149017: Upgrade bundled Expat to 2.8.0 (#149020)
Stan Ulbrych [Mon, 27 Apr 2026 20:22:35 +0000 (21:22 +0100)] 
gh-149017: Upgrade bundled Expat to 2.8.0 (#149020)

20 hours agogh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows...
Serhiy Storchaka [Mon, 27 Apr 2026 18:43:15 +0000 (21:43 +0300)] 
gh-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows (GH-146591)

Use ZipFile.extractall() to sanitize file names and extract files.

Files with invalid names (e.g. absolute paths) are now skipped.

Files containing ".." in the name are no longer skipped.

21 hours agogh-148529: Minor improvements of the struct module documentation (GH-148565)
Serhiy Storchaka [Mon, 27 Apr 2026 18:30:48 +0000 (21:30 +0300)] 
gh-148529: Minor improvements of the struct module documentation (GH-148565)

* Document that 's' and 'p' accept bytes and bytearray.
* Fix some footnotes.
* Clarify that "string" is a byte string.
* Fix the module docstring.

23 hours agoGH-146073: Add fitness to executor dumps. (GH-148959)
Mark Shannon [Mon, 27 Apr 2026 16:34:09 +0000 (17:34 +0100)] 
GH-146073: Add fitness to executor dumps. (GH-148959)

24 hours agoUn-skip previously-broken `test_get_type_hints_modules_forwardref` (#149048)
Thomas Kowalski [Mon, 27 Apr 2026 15:30:35 +0000 (17:30 +0200)] 
Un-skip previously-broken `test_get_type_hints_modules_forwardref` (#149048)

26 hours agoGH-135357: Add socket.SO_PASSRIGHTS constant (#135355)
Salvo 'LtWorf' Tomaselli [Mon, 27 Apr 2026 13:12:34 +0000 (15:12 +0200)] 
GH-135357: Add socket.SO_PASSRIGHTS constant (#135355)

Constant added to Linux 6.16. See the LWN article:
https://lwn.net/Articles/1023085/

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
32 hours agogh-148868: Increase test coverage for `cmath.isinf` (#148869)
Manoj K M [Mon, 27 Apr 2026 07:22:20 +0000 (12:52 +0530)] 
gh-148868: Increase test coverage for `cmath.isinf` (#148869)

32 hours agoFix typo in `ceval.c` error message (#148860)
Anonymous941 [Mon, 27 Apr 2026 07:21:53 +0000 (03:21 -0400)] 
Fix typo in `ceval.c` error message (#148860)

Fix the "multiple values for keyword argument" error message
used when the function's `__qualname__` cannot be retrieved.

33 hours agogh-82665 Mention that HTMLParser.handle_starttag value can be None (#134312)
Micah Najacht [Mon, 27 Apr 2026 06:27:05 +0000 (01:27 -0500)] 
gh-82665 Mention that HTMLParser.handle_starttag value can be None (#134312)

* Specify boolean attribute behavior in parser

* Tweak wording and example

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* Fix backticks

---------

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
37 hours agoDocument that multiprocessing treats local same-user processes as trusted (GH-149001)
Gregory P. Smith [Mon, 27 Apr 2026 01:42:13 +0000 (18:42 -0700)] 
Document that multiprocessing treats local same-user processes as trusted (GH-149001)

Clarify in the Authentication keys section that the authkey handshake
covers Listener/Client (addressable endpoints) only, not the anonymous
pipes behind Pipe() and Queue, and that isolation between same-user
processes must be arranged at the OS level.

38 hours agogh-47798: Refactor the POSIX subprocess.Popen._communicate selector loop into helpers...
Gregory P. Smith [Mon, 27 Apr 2026 00:40:20 +0000 (17:40 -0700)] 
gh-47798: Refactor the POSIX subprocess.Popen._communicate selector loop into helpers (GH-149032)

No public API change.  Lift the per-iteration select/read/write loop out of
Popen._communicate (POSIX) into a module-level _communicate_io_posix(), with
small _flush_stdin / _make_input_view / _translate_newlines helpers alongside
it.  Popen._communicate calls the helper and persists the returned input
offset for resume-after-timeout.

Retire the private Popen._remaining_time method in favor of module-level
_deadline_remaining; all call sites (POSIX and Windows) updated.

Defensive behavioural deltas: the stdin and stdout/stderr .close() calls in
the I/O loop now swallow BrokenPipeError / OSError, matching __exit__ and the
no-input path; previously these were bare.

Adds test_communicate_timeout_resume_partial_write to cover _input_offset
bookkeeping across TimeoutExpired/resume.

44 hours agogh-148991: Add colour to `tokenize` CLI output (#148992)
Hugo van Kemenade [Sun, 26 Apr 2026 19:14:33 +0000 (22:14 +0300)] 
gh-148991: Add colour to `tokenize` CLI output (#148992)

Co-authored-by: Stan Ulbrych <stan@python.org>
2 days agogh-146455: Fix O(N²) in add_const() after constant folding moved to CFG (#146456)
zSirius [Sun, 26 Apr 2026 12:15:24 +0000 (20:15 +0800)] 
gh-146455: Fix O(N²) in add_const() after constant folding moved to CFG (#146456)

The add_const() function in flowgraph.c uses a linear search over the
consts list to find the index of a constant. After gh-126835 moved
constant folding from the AST optimizer to the CFG optimizer, this
function is now called N times for N inner tuple elements during
fold_tuple_of_constants(), resulting in O(N²) total time.

Fix by maintaining an auxiliary _Py_hashtable_t that maps object
pointers to their indices in the consts list, providing O(1) lookup.

For a file with 100,000 constant 2-tuples:
- Before: 10.38s (add_const occupies 83.76% of CPU time)
- After:  1.48s

2 days agogh-148981: Add color parameter to `ast.dump` (#148982)
Stan Ulbrych [Sun, 26 Apr 2026 09:15:54 +0000 (10:15 +0100)] 
gh-148981: Add color parameter to `ast.dump` (#148982)

And turn on color for the `ast` module CLI.

2 days agogh-137855: Lazy import `inspect` module in dataclasses (#144387)
Daniel Hollas [Sun, 26 Apr 2026 05:57:38 +0000 (06:57 +0100)] 
gh-137855: Lazy import `inspect` module in dataclasses (#144387)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 days agogh-141473: Speed up subprocess test_communicate_timeout_large_input long tail (#149003)
Gregory P. Smith [Sun, 26 Apr 2026 04:01:33 +0000 (21:01 -0700)] 
gh-141473: Speed up subprocess test_communicate_timeout_large_input long tail (#149003)

gh-141473: Speed up test_communicate_timeout_large_input

Replace the slow reader's 30s sleep with a parent-driven wake over a
loopback socket so post-timeout communicate() doesn't block waiting
for the child to wake on its own. Worst-case runtime: ~30s -> <1s.

2 days agogh-146311: Reject non-canonical padding bits in base32, 64, & 85 decoding (GH-146312)
Gregory P. Smith [Sat, 25 Apr 2026 23:02:51 +0000 (16:02 -0700)] 
gh-146311: Reject non-canonical padding bits in base32, 64, & 85 decoding (GH-146312)

Add `canonical=False` keyword argument to `a2b_base64`, `a2b_base32`, `a2b_base85`, and `a2b_ascii85` (and their `base64` module wrappers). When `canonical=True`, non-canonical encodings are rejected per [RFC 4648 section 3.5](https://datatracker.ietf.org/doc/html/rfc4648.html#section-3.5).

This is independent of `strict_mode`.

For base85/ascii85, the check also rejects single-character final groups (never produced by a conforming encoder) and verifies partial group padding matches what the encoder would produce.

Co-authored-by: Serhiy Storchaka via lots of great code review!
2 days agogh-148989: `_remote_debugging`: Remove dead code, unnecessary gc state read (#148990)
Maurycy Pawłowski-Wieroński [Sat, 25 Apr 2026 21:28:51 +0000 (23:28 +0200)] 
gh-148989: `_remote_debugging`: Remove dead code, unnecessary gc state read (#148990)

dead code

2 days agogh-140727: Update tachyon logo (#148965)
Mai Giménez [Sat, 25 Apr 2026 21:27:11 +0000 (22:27 +0100)] 
gh-140727: Update tachyon logo (#148965)

2 days agogh-134690: Removed deprecated `codetype.co_lnotab` (#134691)
sobolevn [Sat, 25 Apr 2026 16:13:48 +0000 (19:13 +0300)] 
gh-134690: Removed deprecated `codetype.co_lnotab` (#134691)

3 days agogh-148947: dataclasses: fix error on empty __class__ cell (#148948)
Jelle Zijlstra [Sat, 25 Apr 2026 15:31:22 +0000 (08:31 -0700)] 
gh-148947: dataclasses: fix error on empty __class__ cell  (#148948)

Also add a test demonstrating the need for the existing "is oldcls" check.

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
3 days agogh-140287: Handle `PYTHONSTARTUP` script exceptions in the asyncio REPL (#140288)
Bartosz Sławecki [Sat, 25 Apr 2026 14:24:40 +0000 (16:24 +0200)] 
gh-140287: Handle `PYTHONSTARTUP` script exceptions in the asyncio REPL (#140288)

3 days agogh-148588: Document `__lazy_modules__` (#148590)
Bartosz Sławecki [Sat, 25 Apr 2026 14:23:40 +0000 (16:23 +0200)] 
gh-148588: Document `__lazy_modules__` (#148590)

3 days agogh-148973: fix segfault on mismatch between consts size and oparg in compiler (#148974)
Irit Katriel [Sat, 25 Apr 2026 09:47:41 +0000 (10:47 +0100)] 
gh-148973: fix segfault on mismatch between consts size and oparg in compiler (#148974)

3 days agogh-142186: Revert the unintended value change in the `PY_MONITORING_EVENT_*` values...
scoder [Sat, 25 Apr 2026 07:05:03 +0000 (09:05 +0200)] 
gh-142186: Revert the unintended value change in the `PY_MONITORING_EVENT_*` values from gh-146182 (gh-148955)

https://github.com/python/cpython/pull/146182 left an unintended change in the `PY_MONITORING_*` macro values. This change reverts that part to avoid a user visible impact.

3 days agogh-108951: add TaskGroup.cancel() (#127214)
John Belmonte [Fri, 24 Apr 2026 18:22:05 +0000 (11:22 -0700)] 
gh-108951: add TaskGroup.cancel() (#127214)

Fixes #108951

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Guido van Rossum <guido@python.org>
3 days agoImprove `hash()` builtin docstring with caveats. (GH-125229)
Gregory P. Smith [Fri, 24 Apr 2026 16:36:46 +0000 (09:36 -0700)] 
Improve  `hash()` builtin docstring with caveats. (GH-125229)

Improve  `hash()` builtin docstring with caveats.

Mention its return type and that the value can be expected to change between
processes (hash randomization).

Why? The `hash` builtin gets reached for and used by a lot of people whether it
is the right tool or not. IDEs surface docstrings and people use pydoc and
`help(hash)`.

4 days agogh-146073: Add fitness/exit quality mechanism for JIT trace frontend (GH-148089)
Hai Zhu [Fri, 24 Apr 2026 09:37:01 +0000 (17:37 +0800)] 
gh-146073: Add fitness/exit quality mechanism for JIT trace frontend (GH-148089)

* Replaces ad-hoc logic for ending traces with a simple inequality: `fitness < exit_quality`
* Fitness starts high and is reduced for branches, backward edges, calls and trace length
* Exit quality reflect how good a spot that instruction is to end a trace. Closing a loop is very, specializable instructions are very low and the others in between.

4 days agogh-145239: Accept unary plus literal pattern (#148566)
Bartosz Sławecki [Thu, 23 Apr 2026 19:07:28 +0000 (21:07 +0200)] 
gh-145239: Accept unary plus literal pattern (#148566)

Add '+' alternatives to signed_number and signed_real_number grammar
rules, mirroring how unary minus is already handled for pattern matching.
Unary plus is a no-op on numbers so the value is returned directly without
wrapping in a UnaryOp node.

4 days agogh-113956: Make intern_common thread-safe in free-threaded build (gh-148886)
Sam Gross [Thu, 23 Apr 2026 18:42:57 +0000 (14:42 -0400)] 
gh-113956: Make intern_common thread-safe in free-threaded build (gh-148886)

Avoid racing with the owning thread's refcount operations when
immortalizing an interned string: if we don't own it and its refcount
isn't merged, intern a copy we own instead. Use atomic stores in
_Py_SetImmortalUntracked so concurrent atomic reads are race-free.

5 days agogh-132631: Fix "I/O operation on closed file" when parsing JSON Lines file (#132632)
Hugo van Kemenade [Thu, 23 Apr 2026 15:27:02 +0000 (18:27 +0300)] 
gh-132631: Fix "I/O operation on closed file" when parsing JSON Lines file (#132632)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
5 days agogh-148663: Document that `calendar.IllegalMonthError` inherits from both `ValueError...
Eoin Shaughnessy [Thu, 23 Apr 2026 14:50:23 +0000 (15:50 +0100)] 
gh-148663: Document that `calendar.IllegalMonthError` inherits from both `ValueError` and `IndexError` (#148664)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
5 days agogh-148735: Fix a UAF in `Element.findtext()` (#148738)
Stan Ulbrych [Thu, 23 Apr 2026 14:48:00 +0000 (15:48 +0100)] 
gh-148735: Fix a UAF in `Element.findtext()` (#148738)

5 days agogh-148680: Replace internal names with type_reprs of objects in string representation...
David Ellis [Thu, 23 Apr 2026 13:22:20 +0000 (14:22 +0100)] 
gh-148680: Replace internal names with type_reprs of objects in string representations of ForwardRef (#148682)

Co-authored-by: Shamil <ashm.tech@proton.me>
5 days agoGH-126910: Build/link the JIT shim in the Python interpreter (#148872)
Diego Russo [Thu, 23 Apr 2026 11:23:18 +0000 (12:23 +0100)] 
GH-126910: Build/link the JIT shim in the Python interpreter (#148872)

5 days agogh-148907: fix performance regression in `PyType_GetModuleByDef` on free-threading...
Kumar Aditya [Thu, 23 Apr 2026 11:12:57 +0000 (16:42 +0530)] 
gh-148907: fix performance regression in `PyType_GetModuleByDef` on free-threading (#148908)

5 days agogh-146636: Improve ABI/feature selection, add new header for it (GH-148302)
Petr Viktorin [Thu, 23 Apr 2026 09:52:13 +0000 (11:52 +0200)] 
gh-146636: Improve ABI/feature selection, add new header for it (GH-148302)

Improve ABI/feature selection, add new header for it.

Add a test that Python headers themselves don't use
Py_GIL_DISABLED in abi3t: abi3 and abi3t ought to be the
same except the _Py_OPAQUE_PYOBJECT differences.
This is done using the GCC-only poison pragma.

Co-authored-by: Victor Stinner <vstinner@python.org>
5 days agogh-148892: Drop mention of deprecated cibuildwheel option (#148893)
Nathan Goldbaum [Thu, 23 Apr 2026 04:00:35 +0000 (22:00 -0600)] 
gh-148892: Drop mention of deprecated cibuildwheel option (#148893)

5 days agoSpeed up counting in statistics.fmean() (gh-148875)
Raymond Hettinger [Thu, 23 Apr 2026 03:06:56 +0000 (22:06 -0500)] 
Speed up counting in statistics.fmean() (gh-148875)

5 days agogh-119180: Document the `format` parameter in `typing.get_type_hints()` (#143758)
Victorien [Thu, 23 Apr 2026 02:50:15 +0000 (04:50 +0200)] 
gh-119180: Document the `format` parameter in `typing.get_type_hints()` (#143758)

Do not mention `__annotations__` dictionaries, as this is slightly
outdated since 3.14.

Rewrite the note about possible exceptions for clarity. Also do not
mention imported type aliases, as since 3.12 aliases with the `type`
statement do not suffer from this limitation anymore.

5 days agogh-142965: Fix Concatenate documentation to reflect valid use cases (#143316)
John Seong [Thu, 23 Apr 2026 02:46:04 +0000 (10:46 +0800)] 
gh-142965: Fix Concatenate documentation to reflect valid use cases (#143316)

The documentation previously stated that Concatenate is only valid
when used as the first argument to Callable, but according to PEP 612,
it can also be used when instantiating user-defined generic classes
with ParamSpec parameters.

5 days agogh-145194: Fix typing in re tokenizer example (#145198)
Vikash Kumar [Thu, 23 Apr 2026 02:40:10 +0000 (08:10 +0530)] 
gh-145194: Fix typing in re tokenizer example (#145198)

5 days agogh-145056: Add support for frozendict in dataclass asdict and astuple (#145125)
Pieter Eendebak [Thu, 23 Apr 2026 02:39:08 +0000 (04:39 +0200)] 
gh-145056: Add support for frozendict in dataclass asdict and astuple (#145125)

5 days agogh-146553: Fix infinite loop in typing.get_type_hints() on circular __wrapped__ ...
Shamil [Thu, 23 Apr 2026 02:31:58 +0000 (05:31 +0300)] 
gh-146553: Fix infinite loop in typing.get_type_hints() on circular __wrapped__ (#148595)

5 days agogh-148883: Docs: clarify grammar in Counter dictionary methods note (gh-148882)
Sanjay Janardhan [Wed, 22 Apr 2026 22:56:14 +0000 (15:56 -0700)] 
gh-148883: Docs: clarify grammar in Counter dictionary methods note (gh-148882)

5 days agogh-90309: Base64-encode cookie values embedded in JS
Seth Larson [Wed, 22 Apr 2026 19:22:31 +0000 (14:22 -0500)] 
gh-90309: Base64-encode cookie values embedded in JS

5 days agogh-148820: Fix _PyRawMutex use-after-free on spurious semaphore wakeup (gh-148852)
Sam Gross [Wed, 22 Apr 2026 18:31:19 +0000 (14:31 -0400)] 
gh-148820: Fix _PyRawMutex use-after-free on spurious semaphore wakeup (gh-148852)

_PyRawMutex_UnlockSlow CAS-removes the waiter from the list and then
calls _PySemaphore_Wakeup, with no handshake. If _PySemaphore_Wait
returns Py_PARK_INTR, the waiter can destroy its stack-allocated
semaphore before the unlocker's Wakeup runs, causing a fatal error from
ReleaseSemaphore / sem_post.

Loop in _PyRawMutex_LockSlow until _PySemaphore_Wait returns Py_PARK_OK,
which is only signalled when a matching Wakeup has been observed.

Also include GetLastError() and the handle in the Windows fatal messages
in _PySemaphore_Init, _PySemaphore_Wait, and _PySemaphore_Wakeup to make
similar races easier to diagnose in the future.

5 days agogh-148858: Remove duplicated recipe.yaml files in Tools/pixi-packages (#148859)
Isuru Fernando [Wed, 22 Apr 2026 17:50:30 +0000 (10:50 -0700)] 
gh-148858: Remove duplicated recipe.yaml files in Tools/pixi-packages (#148859)

5 days agoAdditional itertool recipes for running statistics (gh-148879)
Raymond Hettinger [Wed, 22 Apr 2026 16:52:41 +0000 (11:52 -0500)] 
Additional itertool recipes for running statistics (gh-148879)

6 days agogh-148207: add additional keywords to `typing.TypeVarTuple` (#148212)
KotlinIsland [Wed, 22 Apr 2026 13:28:12 +0000 (23:28 +1000)] 
gh-148207: add additional keywords to `typing.TypeVarTuple` (#148212)

6 days agoGH-146073: Add example script for dumping JIT traces (GH-148840)
Mark Shannon [Wed, 22 Apr 2026 10:09:05 +0000 (11:09 +0100)] 
GH-146073: Add example script for dumping JIT traces (GH-148840)

6 days agogh-142186: Allow all PEP-669 events to be per-code object and disableable (GH-146182)
Gabriele N. Tornetta [Wed, 22 Apr 2026 08:08:23 +0000 (09:08 +0100)] 
gh-142186: Allow all PEP-669 events to be per-code object and disableable  (GH-146182)

* Make the `PY_UNWIND` monitoring event available as a code-local
event to allow trapping on function exit events when an exception
bubbles up. This complements the PY_RETURN event by allowing to
catch any function exit event.

* Allow `PY_UNWIND`  to be `DISABLE`d; disabling it disables the event for the whole code object.

* Do the above for `PY_THROW`, `RAISE`, `EXCEPTION_HANDLED`, and `RERAISE` events.

6 days agogh-146578: _zstd: Fix printf format for pledged size errors (#146576)
cui [Tue, 21 Apr 2026 19:49:44 +0000 (03:49 +0800)] 
gh-146578: _zstd: Fix printf format for pledged size errors (#146576)

Use %llu instead of %ull for unsigned long long in zstd_contentsize_converter ValueError messages.

6 days ago[Enum] Improve clarity of comparison sentence (GH-148753)
Rida Zouga [Tue, 21 Apr 2026 17:17:02 +0000 (18:17 +0100)] 
[Enum] Improve clarity of comparison sentence (GH-148753)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
6 days agogh-148801: Fix unbound C recursion in `Element.__deepcopy__()` (#148802)
Stan Ulbrych [Tue, 21 Apr 2026 16:20:18 +0000 (17:20 +0100)] 
gh-148801: Fix unbound C recursion in `Element.__deepcopy__()` (#148802)

7 days agogh-148808: Add boundary check to asyncio.AbstractEventLoop.sock_recvf… (#148809)
Seth Larson [Tue, 21 Apr 2026 14:29:07 +0000 (09:29 -0500)] 
gh-148808: Add boundary check to asyncio.AbstractEventLoop.sock_recvf… (#148809)

7 days agogh-148814: Fix an issue in Emscripten README (#148752)
Stan Ulbrych [Mon, 20 Apr 2026 23:04:50 +0000 (00:04 +0100)] 
gh-148814: Fix an issue in Emscripten README (#148752)

Correct the description of the default state of test module compilation.

7 days agogh-108411: Make typing.IO/BinaryIO arguments positional-only (#142906)
Roman Donchenko [Mon, 20 Apr 2026 20:19:43 +0000 (23:19 +0300)] 
gh-108411: Make typing.IO/BinaryIO arguments positional-only (#142906)

`IO` is purported to be the type of the file objects returned by `open`.
However, all methods on those objects take positional-only arguments, while
`IO`'s methods are declared with regular arguments. As such, the file objects
cannot actually be considered to implement `IO`. The same thing applies to
`BinaryIO`.

Fix this by adjusting the definition of these ABCs to match the file objects.

This is technically a breaking change, but it is unlikely to actually break
anything:

* These methods should never be called at runtime, since they are abstract.
  Therefore, this should not cause any runtime errors.

* In typeshed these arguments are already positional-only, so this should
  not cause any errors during typechecking either.

7 days agoFix typos in asyncio, ctypes, and importlib documentation (#148747)
ByteFlow [Mon, 20 Apr 2026 19:22:37 +0000 (03:22 +0800)] 
Fix typos in asyncio, ctypes, and importlib documentation (#148747)

7 days agogh-138451: Support custom LLVM installation path (#138452)
Uwe L. Korn [Mon, 20 Apr 2026 16:45:53 +0000 (18:45 +0200)] 
gh-138451: Support custom LLVM installation path (#138452)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
7 days agoUse `soft-deprecated` in more places (#148769)
Stan Ulbrych [Mon, 20 Apr 2026 16:00:35 +0000 (17:00 +0100)] 
Use `soft-deprecated` in more places (#148769)

8 days agoDocs: Fix some typos in `calendar.rst` (GH-148756)
Manoj K M [Mon, 20 Apr 2026 14:37:12 +0000 (20:07 +0530)] 
Docs: Fix some typos in `calendar.rst` (GH-148756)

8 days agogh-148644: Propagate the PGO job exit code in PCbuild/build.bat (GH-148645)
Régis Desgroppes [Mon, 20 Apr 2026 14:18:10 +0000 (16:18 +0200)] 
gh-148644: Propagate the PGO job exit code in PCbuild/build.bat (GH-148645)

8 days agogh-148790: Eliminate redundant call to `_PyRuntime_Initialize` in `Py_InitializeEx...
AraHaan [Mon, 20 Apr 2026 14:01:06 +0000 (10:01 -0400)] 
gh-148790: Eliminate redundant call to `_PyRuntime_Initialize` in `Py_InitializeEx` (GH-121628)

8 days agoGH-145278: also filter mmap2 in strace_helper.filter_memory (GH-148648)
Filipe Laíns [Mon, 20 Apr 2026 13:41:10 +0000 (14:41 +0100)] 
GH-145278: also filter mmap2 in strace_helper.filter_memory (GH-148648)

Signed-off-by: Filipe Laíns <lains@riseup.net>
8 days agogh-148718: Fix Py_STACKREF_DEBUG build by defining macros (#148719)
Donghee Na [Mon, 20 Apr 2026 12:55:03 +0000 (21:55 +0900)] 
gh-148718: Fix Py_STACKREF_DEBUG build by defining macros (#148719)

8 days agogh-123853: Update locale.windows_locale (GH-123901)
Serhiy Storchaka [Mon, 20 Apr 2026 08:47:37 +0000 (11:47 +0300)] 
gh-123853: Update locale.windows_locale (GH-123901)

Update the table of Windows language code identifiers (LCIDs) to
protocol version 16.0 (2024-04-23).

8 days agogh-148788: Update Emscripten example post move to Platforms dir (#148761)
Stan Ulbrych [Mon, 20 Apr 2026 02:17:50 +0000 (03:17 +0100)] 
gh-148788: Update Emscripten example post move to Platforms dir (#148761)

Update Emscripten example post move to Platforms dir.

8 days agogh-148763: Fix paramter name in `multiprocessing.connection.send_bytes/recv_bytes_int...
Matthew Davis [Mon, 20 Apr 2026 00:05:50 +0000 (02:05 +0200)] 
gh-148763: Fix paramter name in `multiprocessing.connection.send_bytes/recv_bytes_into` docs (GH-126603)

Doc: Fix buf argument name in multiprocessing connection send_bytes

8 days agogh-148779: Update Briefcase link in android.rst documentation (#148777)
partev [Sun, 19 Apr 2026 21:44:08 +0000 (17:44 -0400)] 
gh-148779: Update Briefcase link in android.rst documentation (#148777)

Use canonical beeware.org URL for link to Briefcase.

8 days agogh-133879: Copyedit "What's new in Python 3.15" (#148686)
Hugo van Kemenade [Sun, 19 Apr 2026 18:42:23 +0000 (21:42 +0300)] 
gh-133879: Copyedit "What's new in Python 3.15" (#148686)

9 days agogh-121946: Use clang-20 for TSan build (#148570)
Sam Gross [Sun, 19 Apr 2026 12:13:47 +0000 (08:13 -0400)] 
gh-121946: Use clang-20 for TSan build (#148570)

9 days agoPrevent GitHub's web conflict editor from converting LF to CRLF (#148739)
Hugo van Kemenade [Sun, 19 Apr 2026 09:21:17 +0000 (12:21 +0300)] 
Prevent GitHub's web conflict editor from converting LF to CRLF (#148739)

9 days agogh-148406: Fix annotations of _colorize.FancyCompleter (#148408)
Daniel Hollas [Sat, 18 Apr 2026 18:51:58 +0000 (19:51 +0100)] 
gh-148406: Fix annotations of _colorize.FancyCompleter (#148408)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
9 days agogh-133403: Add type annotations to generate_levenshtein_examples.py (#143317)
John Seong [Sat, 18 Apr 2026 18:50:17 +0000 (02:50 +0800)] 
gh-133403: Add type annotations to generate_levenshtein_examples.py (#143317)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
9 days agogh-148659: Export a few more functions required for external JITs (#148704)
Dino Viehland [Sat, 18 Apr 2026 18:32:22 +0000 (11:32 -0700)] 
gh-148659: Export a few more functions required for external JITs (#148704)

Export a few more functions required for external JITs

10 days agogh-148653: Fix reference leaks in test_marshal introduced in gh-148698 (GH-148725)
Serhiy Storchaka [Sat, 18 Apr 2026 12:11:14 +0000 (15:11 +0300)] 
gh-148653: Fix reference leaks in test_marshal introduced in gh-148698 (GH-148725)

10 days agogh-148688: Fix _BlocksOutputBuffer_Finish() double free (#148689)
Victor Stinner [Sat, 18 Apr 2026 09:56:56 +0000 (11:56 +0200)] 
gh-148688: Fix _BlocksOutputBuffer_Finish() double free (#148689)

If _BlocksOutputBuffer_Finish() fails (memory allocation failure),
PyBytesWriter_Discard() is called on the writer. Then if
_BlocksOutputBuffer_OnError() is called, it calls again
PyBytesWriter_Discard() causing a double free.

Fix _BlocksOutputBuffer_Finish() by setting buffer->writer to NULL,
so _BlocksOutputBuffer_OnError() does nothing instead of calling
PyBytesWriter_Discard() again.

10 days agoAdd a new Sphinx `soft-deprecated` directive (#148630)
Hugo van Kemenade [Sat, 18 Apr 2026 08:37:54 +0000 (11:37 +0300)] 
Add a new Sphinx `soft-deprecated` directive (#148630)

Co-authored-by: Stan Ulbrych <stan@python.org>
10 days agogh-148653: Fix some marshal errors related to recursive immutable objects (GH-148698)
Serhiy Storchaka [Sat, 18 Apr 2026 08:24:33 +0000 (11:24 +0300)] 
gh-148653: Fix some marshal errors related to recursive immutable objects (GH-148698)

Forbid marshalling recursive code, slice and frozendict objects which
cannot be correctly unmarshalled.
Reject invalid marshal data produced by marshalling recursive frozendict
objects which was previously incorrectly unmarshalled.
Add multiple tests for recursive data structures.

10 days agogh-148639: Implement PEP 800 (typing.disjoint_base) (#148640)
Jelle Zijlstra [Sat, 18 Apr 2026 02:20:41 +0000 (19:20 -0700)] 
gh-148639: Implement PEP 800 (typing.disjoint_base) (#148640)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
10 days agogh-148222: Fix NULL dereference bugs in genericaliasobject.c (#148226)
Prakash Sellathurai [Sat, 18 Apr 2026 00:21:13 +0000 (05:51 +0530)] 
gh-148222: Fix NULL dereference bugs in genericaliasobject.c (#148226)

10 days agogh-146393: Remove special character in optimizer_bytecodes.c (#148693)
Pieter Eendebak [Fri, 17 Apr 2026 16:52:16 +0000 (18:52 +0200)] 
gh-146393: Remove special character in optimizer_bytecodes.c (#148693)

10 days agogh-148651: Fix refcount leak in _zstd decompressor options (#148657)
Michael Bommarito [Fri, 17 Apr 2026 15:42:41 +0000 (11:42 -0400)] 
gh-148651: Fix refcount leak in _zstd decompressor options (#148657)

The option parsing in Modules/_zstd/decompressor.c had a missing Py_DECREF(value) before the early return -1 when PyLong_AsInt(key) fails. The identical code in Modules/_zstd/compressor.c line 158 has the fix.

11 days agogh-148683: Doc: fix misplaced pprint entries in What's New 3.15 (#148685)
Xuwz [Fri, 17 Apr 2026 14:13:41 +0000 (22:13 +0800)] 
gh-148683: Doc: fix misplaced pprint entries in What's New 3.15 (#148685)

Doc: fix misplaced pprint entries in What's New 3.15

11 days agogh-148484: Fix memory leak of iterator in array.array constructor (GH-148523)
Gleb Popov [Fri, 17 Apr 2026 12:13:44 +0000 (15:13 +0300)] 
gh-148484: Fix memory leak of iterator in array.array constructor (GH-148523)

11 days agogh-148464: Add missing ``__ctype_le/be__`` attributes for complex types in the ctype...
Sergey B Kirpichev [Fri, 17 Apr 2026 12:09:09 +0000 (15:09 +0300)] 
gh-148464: Add missing ``__ctype_le/be__`` attributes for complex types in the ctype module (GH-148485)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
11 days agogh-148659: Export some internal functions for the JIT (PEP-523) (#148634)
Dino Viehland [Thu, 16 Apr 2026 23:55:03 +0000 (16:55 -0700)] 
gh-148659: Export some internal functions for the JIT (PEP-523) (#148634)

Export (as internal functions, not public ones) C API functions necessary to implement a JIT as a separate extension module.

11 days agogh-148535: Don't use gcc -fprofile-update=atomic flag on i686 (#148554)
Victor Stinner [Thu, 16 Apr 2026 17:13:25 +0000 (19:13 +0200)] 
gh-148535: Don't use gcc -fprofile-update=atomic flag on i686 (#148554)

The -fprofile-update=atomic flag was added to fix a random GCC
internal error on PGO build (gh-145801) caused by corruption of
profile data (.gcda files). The problem is that it makes the PGO
build way slower (up to 47x slower) on i686. Since the GCC internal
error was not seen on i686 so far, don't use -fprofile-update=atomic
on i686.

11 days agogh-146031: Allow keeping specialization enabled when specifying eval frame function...
Dino Viehland [Thu, 16 Apr 2026 16:44:26 +0000 (09:44 -0700)] 
gh-146031: Allow keeping specialization enabled when specifying eval frame function (#146032)

Allow keeping specialization enabled when specifying eval frame function

12 days agoGH-146128: Fix AArch64 multi-instruction constants and relocations (GH-148598)
Mark Shannon [Thu, 16 Apr 2026 14:33:09 +0000 (15:33 +0100)] 
GH-146128: Fix AArch64 multi-instruction constants and relocations (GH-148598)

Fix AArch64 multi-instruction constants and relocations

* Elimates rendundant orr xN, xN, 0xffff after 16 or 32 bit loads
* Merges adrp (21rx) and ldr (12) relocations into single 33rx relocation, when safe to do so.

12 days agoGH-145668: Add FOR_ITER specialization for virtual iterators. Specialize GET_ITER...
Mark Shannon [Thu, 16 Apr 2026 14:22:22 +0000 (15:22 +0100)] 
GH-145668: Add FOR_ITER specialization for virtual iterators. Specialize GET_ITER. (GH-147967)

* Add FOR_ITER_VIRTUAL to specialize FOR_ITER for virtual iterators
* Add GET_ITER_SELF to specialize GET_ITER for iterators (including generators)
* Add GET_ITER_VIRTUAL to specialize GET_ITER for iterables as virtual iterators
* Add new (internal) _tp_iteritem function slot to PyTypeObject
* Put limited RESUME at start of genexpr for free-threading. Fix up exception handling in genexpr