]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 days agogh-142589: Fix PyUnstable_Object_IsUniqueReferencedTemporary (gh-142593)
Sam Gross [Thu, 11 Dec 2025 19:41:03 +0000 (14:41 -0500)] 
gh-142589: Fix PyUnstable_Object_IsUniqueReferencedTemporary (gh-142593)

PyUnstable_Object_IsUniqueReferencedTemporary wasn't handling tagged
ints on the evaluation stack properly.

3 days agoGH-142203: Remove the `debug_override` parameter from `packaging.util.cache_from_sour...
Brett Cannon [Thu, 11 Dec 2025 17:55:47 +0000 (09:55 -0800)] 
GH-142203: Remove the `debug_override` parameter from `packaging.util.cache_from_source()` (GH-142204)

3 days agoUse subcommand over sub-command in argparse docs (#142488)
Savannah Ostrowski [Thu, 11 Dec 2025 17:42:36 +0000 (09:42 -0800)] 
Use subcommand over sub-command in argparse docs (#142488)

3 days agogh-142579: Remove the self converter hack in winreg.c (GH-142580)
AN Long [Thu, 11 Dec 2025 17:06:26 +0000 (02:06 +0900)] 
gh-142579: Remove the self converter hack in winreg.c (GH-142580)

3 days agoFix os.posix_spawn() error handling (#142532)
Bartosz Sławecki [Thu, 11 Dec 2025 17:02:26 +0000 (18:02 +0100)] 
Fix os.posix_spawn() error handling (#142532)

Consistently use `goto exit;` in `py_posix_spawn()`.

3 days agogh-134584: Eliminate redundant refcounting from ``_CALL_LEN`` (gh-136104)
Donghee Na [Thu, 11 Dec 2025 15:24:34 +0000 (00:24 +0900)] 
gh-134584: Eliminate redundant refcounting from ``_CALL_LEN`` (gh-136104)

3 days agogh-142236: Improve error location for missing comma in string concatenations (#142330)
Pablo Galindo Salgado [Thu, 11 Dec 2025 14:47:26 +0000 (14:47 +0000)] 
gh-142236: Improve error location for missing comma in string concatenations (#142330)

3 days agogh-134584: Eliminate redundant refcounting from `_CALL_TUPLE_1` (GH-135860)
Noam Cohen [Thu, 11 Dec 2025 14:31:28 +0000 (16:31 +0200)] 
gh-134584: Eliminate redundant refcounting from `_CALL_TUPLE_1` (GH-135860)

3 days agogh-142438: Added missing GIL release in _PySSL_keylog_callback when keylog_bio is...
AZero13 [Thu, 11 Dec 2025 14:30:39 +0000 (09:30 -0500)] 
gh-142438: Added missing GIL release in _PySSL_keylog_callback when keylog_bio is unset (gh-142439)

3 days agogh-79986: Add parsing for References/In-Reply-To email headers (#137201)
elenril [Thu, 11 Dec 2025 14:20:53 +0000 (15:20 +0100)] 
gh-79986: Add parsing for References/In-Reply-To email headers (#137201)

This is a followup to 46d88a113142b26c01c95c93846a89318ba87ffc (#13397),
which added parsing for Message-ID. Similar handling is needed for the
other two identification headers.

3 days agoGH-140683: JIT: Improve machine code for loading smaller constants on AArch64. (GH...
Mark Shannon [Thu, 11 Dec 2025 12:33:39 +0000 (12:33 +0000)] 
GH-140683: JIT: Improve machine code for loading smaller constants on AArch64. (GH-142511)

* Use movz and movk instructions for loading 16 and 32 bit operands and oparg.
* Loading of 64 bit operands is unchanged.

3 days agoGH-135379: Top of stack caching for the JIT. (GH-135465)
Mark Shannon [Thu, 11 Dec 2025 10:32:52 +0000 (10:32 +0000)] 
GH-135379: Top of stack caching for the JIT. (GH-135465)

Uses three registers to cache values at the top of the evaluation stack
This significantly reduces memory traffic for smaller, more common uops.

3 days agoRemove file accidentally added to `Doc/` (#142563)
Stan Ulbrych [Thu, 11 Dec 2025 10:11:36 +0000 (10:11 +0000)] 
Remove file accidentally added to `Doc/` (#142563)

3 days agogh-142556: fix crash when a task gets re-registered during finalization in `asyncio...
Kumar Aditya [Thu, 11 Dec 2025 09:34:49 +0000 (15:04 +0530)] 
gh-142556: fix crash when a task gets re-registered during finalization in `asyncio` (#142565)

3 days agogh-123241: Don't modify ref count during visitation (GH-142232)
Dino Viehland [Thu, 11 Dec 2025 08:54:29 +0000 (00:54 -0800)] 
gh-123241: Don't modify ref count during visitation (GH-142232)

3 days agoTachyon: Fix heatmap line highlight animation overriding heat colors (#142522)
Stan Ulbrych [Thu, 11 Dec 2025 04:30:16 +0000 (04:30 +0000)] 
Tachyon: Fix heatmap line highlight animation overriding heat colors (#142522)

3 days agogh-142539: Fix `traceback` caret location calculation for `SyntaxError`s with wide...
Stan Ulbrych [Thu, 11 Dec 2025 04:20:55 +0000 (04:20 +0000)] 
gh-142539: Fix `traceback` caret location calculation for `SyntaxError`s with wide chars (#142540)

3 days agogh-138122: Make the tachyon profiler opcode-aware (#142394)
Pablo Galindo Salgado [Thu, 11 Dec 2025 03:41:47 +0000 (03:41 +0000)] 
gh-138122: Make the tachyon profiler opcode-aware (#142394)

4 days agogh-140172: Skip JSON tools test during PGO training (GH-140809)
Steve Dower [Thu, 11 Dec 2025 00:34:49 +0000 (00:34 +0000)] 
gh-140172: Skip JSON tools test during PGO training (GH-140809)

4 days agoGH-97850: Remove all uses and definitions of `load_module()` from importlib (#142205)
Brett Cannon [Wed, 10 Dec 2025 23:35:51 +0000 (15:35 -0800)] 
GH-97850: Remove all uses and definitions of `load_module()` from importlib (#142205)

4 days agogh-142489: Increase ssl_handshake_timeout in asyncio tests (#142523)
Victor Stinner [Wed, 10 Dec 2025 22:21:03 +0000 (23:21 +0100)] 
gh-142489: Increase ssl_handshake_timeout in asyncio tests (#142523)

Replace SHORT_TIMEOUT with LONG_TIMEOUT for very slow CIs.
And add the HANDSHAKE_TIMEOUT constant.

4 days agogh-137007: Track executor before any possible deallocations (GH-137016)
Ken Jin [Wed, 10 Dec 2025 21:09:56 +0000 (05:09 +0800)] 
gh-137007: Track executor before any possible deallocations (GH-137016)

4 days agogh-135559: [Enum] dir() on a Flag now shows aliases (GH-136527)
Ethan Furman [Wed, 10 Dec 2025 19:46:10 +0000 (11:46 -0800)] 
gh-135559: [Enum] dir() on a Flag now shows aliases (GH-136527)

4 days agogh-141976: Protect against non-progressing specializations in tracing JIT (GH-141989)
Ken Jin [Wed, 10 Dec 2025 19:39:11 +0000 (03:39 +0800)] 
gh-141976: Protect against non-progressing specializations in tracing JIT (GH-141989)

4 days agoGH-142305: JIT: Deduplicating GOT symbols in the trace (#142316)
Diego Russo [Wed, 10 Dec 2025 16:04:04 +0000 (16:04 +0000)] 
GH-142305: JIT: Deduplicating GOT symbols in the trace (#142316)

4 days agogh-142433: Move deref to below the error when checking for laststring (#142402)
AZero13 [Wed, 10 Dec 2025 15:41:52 +0000 (10:41 -0500)] 
gh-142433: Move deref to below the error when checking for laststring (#142402)

Move deref of laststring to below the error checking so the deref
is applied after the object in strings is replaced.

4 days agogh-139927: Fix test_embed on OpenIndiana (#142514)
Victor Stinner [Wed, 10 Dec 2025 15:31:12 +0000 (16:31 +0100)] 
gh-139927: Fix test_embed on OpenIndiana (#142514)

Avoid swprintf() function in Programs/_testembed.c since it doesn't
work as expected on OpenIndiana.

4 days agoTachyon: Set favicon for heatmap pages (#142493)
Stan Ulbrych [Wed, 10 Dec 2025 14:10:23 +0000 (14:10 +0000)] 
Tachyon: Set favicon for heatmap pages (#142493)

4 days agogh-131372: Include LDVERSION and EXE in base_interpreter value (#142256)
Karolina Surma [Wed, 10 Dec 2025 12:09:41 +0000 (13:09 +0100)] 
gh-131372: Include LDVERSION and EXE in base_interpreter value (#142256)

* Include LDVERSION and EXE in base_interpreter value

In Fedora, build-details.json created and installed for python3.14t
contains "/usr/bin/python3.14" as the base_interpreter value.
Create a correct string, taking into account both LDVERSION and EXE
config variables, similarly to how it's defined in altbininstall in Makefile.

* Add news

Signed-off-by: Filipe Laíns <lains@riseup.net>
---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Filipe Laíns <lains@riseup.net>
4 days agogh-142048: Fix lost gc allocations count on thread cleanup (#142233)
Kevin Wang [Wed, 10 Dec 2025 07:29:40 +0000 (02:29 -0500)] 
gh-142048: Fix lost gc allocations count on thread cleanup (#142233)

4 days agogh-142029: Raise `ValueError` instead of crashing on empty name given to `create_buil...
dr-carlos [Wed, 10 Dec 2025 06:31:57 +0000 (17:01 +1030)] 
gh-142029: Raise `ValueError` instead of crashing on empty name given to `create_builtin()` (#142033)

Co-authored-by: Victor Stinner <vstinner@python.org>
5 days agogh-142315: Don't pass the "real path" of Pdb script target to system functions (...
Bartosz Sławecki [Wed, 10 Dec 2025 01:04:49 +0000 (02:04 +0100)] 
gh-142315: Don't pass the "real path" of Pdb script target to system functions (#142371)

* Pick target depending on preconditions

* Clarify the news fragment

* Add test capturing missed expectation.

* Add more idiomatic safe realpath helper

* Restore logic where existance and directoriness are checked on realpath.

* Link GH issue to test.

* Extract a function to check the target. Remove the _safe_realpath, now no longer needed.

* Extract method for replacing sys_path, and isolate realpath usage there.

* Revert "Extract method for replacing sys_path, and isolate realpath usage there."

This reverts commit 855aac3d289dd096142ed9bd23d00c22ce6e1859.

* Restore _safe_realpath.

---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
5 days agoUpdates to PyManager docs based on feedback. (GH-142473)
Steve Dower [Tue, 9 Dec 2025 23:07:50 +0000 (23:07 +0000)] 
Updates to PyManager docs based on feedback. (GH-142473)

5 days agogh-140189: Use macos-14 runner for iOS CI tests (#142444)
Russell Keith-Magee [Tue, 9 Dec 2025 21:52:52 +0000 (05:52 +0800)] 
gh-140189: Use macos-14 runner for iOS CI tests (#142444)

Switch to the macos-14 runner for iOS CI, working around some instability
in the macos-15 runner.

5 days agoGH-108819: fix LIBDEST not honoring --with-platlibdir (#133163)
Filipe Laíns [Tue, 9 Dec 2025 19:14:51 +0000 (19:14 +0000)] 
GH-108819: fix LIBDEST not honoring --with-platlibdir (#133163)

* GH-108819: fix LIBDEST not honoring --with-platlibdir

We look for the pure-Python part of the standard library in
PLATSTDLIBDIR, which may not match the default LIBDIR subdir.

From ``getpath.py``:

```python
    ...
    STDLIB_SUBDIR = f'{platlibdir}/python{VERSION_MAJOR}.{VERSION_MINOR}{ABI_THREAD}'
    STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}/os.py', f'{STDLIB_SUBDIR}/os.pyc']
    PLATSTDLIB_LANDMARK = f'{platlibdir}/python{VERSION_MAJOR}.{VERSION_MINOR}{ABI_THREAD}/lib-dynload'
    ...
```

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Add news

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Always set LIBDEST and BINLIBDEST based on PLATLIBDIR

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Add XXX comment on PLATLIBDIR default value

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Regen configure

Signed-off-by: Filipe Laíns <lains@riseup.net>
---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
5 days agoTachyon: Remove spurious CSS for `stat-card` (#142487)
Stan Ulbrych [Tue, 9 Dec 2025 19:13:54 +0000 (19:13 +0000)] 
Tachyon: Remove spurious CSS for `stat-card` (#142487)

5 days agoTachyon: Make "Tachyon" in navbar link to `index.html` (#142486)
Stan Ulbrych [Tue, 9 Dec 2025 18:51:57 +0000 (18:51 +0000)] 
Tachyon: Make "Tachyon" in navbar link to `index.html` (#142486)

5 days agoTachyon: Fix unesecarry plural when there is a single file/sample (#142478)
Stan Ulbrych [Tue, 9 Dec 2025 17:45:52 +0000 (17:45 +0000)] 
Tachyon: Fix unesecarry plural when there is a single file/sample (#142478)

5 days agogh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit...
Miro Hrončok [Tue, 9 Dec 2025 17:33:09 +0000 (18:33 +0100)] 
gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (#142455)

Co-authored-by: Ken Jin <kenjin4096@gmail.com>
5 days agogh-112527: Fix help text for required options in argparse (GH-112528)
Fabian Henze [Tue, 9 Dec 2025 16:48:35 +0000 (17:48 +0100)] 
gh-112527: Fix help text for required options in argparse (GH-112528)

For optional arguments with required=True, the ArgumentDefaultsHelpFormatter
would always add a " (default: None)" to the end of the help text.
Since that's a bit misleading, it is removed with this commit.

5 days agogh-142447: Fix cast warning in pycore_backoff.h (#142465)
Victor Stinner [Tue, 9 Dec 2025 16:03:13 +0000 (17:03 +0100)] 
gh-142447: Fix cast warning in pycore_backoff.h (#142465)

MAKE_VALUE_AND_BACKOFF() macro casts its result to uint16_t.

Add pycore_backoff.h header to test_cppext tests.

5 days agogh-84530: fix namespace package support in modulefinder (#29196)
Filipe Laíns [Tue, 9 Dec 2025 15:50:50 +0000 (15:50 +0000)] 
gh-84530: fix namespace package support in modulefinder (#29196)

* bpo-40350: fix namespace package support in modulefinder

Signed-off-by: Filipe Laíns <lains@riseup.net>
* consider that namespace package specs might have the loader set

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Revert "consider that namespace package specs might have the loader set"

This reverts commit 23fb4e0de38466217e932115143db1a9584e35da.

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Fix load_module and load_package to handle namespace packages

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Drop _NAMESPACE constant

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Drop importlib changes

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Update NamespacePath check

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Mixed some

Signed-off-by: Filipe Laíns <lains@riseup.net>
---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
5 days agogh-140222: Increase stack margin on debug build (#142452)
Victor Stinner [Tue, 9 Dec 2025 15:25:46 +0000 (16:25 +0100)] 
gh-140222: Increase stack margin on debug build (#142452)

Increase _PyOS_MIN_STACK_SIZE if Python is built in debug mode.

5 days agoGH-131372: only install build-details.json in the main install (#142269)
Filipe Laíns [Tue, 9 Dec 2025 14:25:34 +0000 (14:25 +0000)] 
GH-131372: only install build-details.json in the main install (#142269)

* GH-131372: only install build-details.json in the main install

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Add news

Signed-off-by: Filipe Laíns <lains@riseup.net>
---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
5 days agogh-142342: Fix m68k assembler operand constraints for `%fpcr` access (gh-142343)
John Paul Adrian Glaubitz [Tue, 9 Dec 2025 13:46:40 +0000 (14:46 +0100)] 
gh-142342: Fix m68k assembler operand constraints for `%fpcr` access (gh-142343)

On m68k, an fmove instruction accessing %fpcr may only move from
or to a data register or a memory operand. The constraint "g" also
permits the use of address registers, which is invalid. The correct
constraint is "dm". Beginning with GCC 15, the register allocator
picks an address register in the code which causes SIGILL during
runtime.

Co-authored-by: Michael Karcher <github@mkarcher.dialup.fu-berlin.de>
5 days agogh-140727: Restructure profiling documentation for PEP 799 (#142373)
Pablo Galindo Salgado [Tue, 9 Dec 2025 12:55:04 +0000 (12:55 +0000)] 
gh-140727: Restructure profiling documentation for PEP 799 (#142373)

* Add profiling module documentation structure

PEP 799 introduces a new `profiling` package that reorganizes Python's
profiling tools under a unified namespace. This commit adds the documentation
structure to match: a main entry point (profiling.rst) that helps users choose
between profilers, detailed docs for the tracing profiler (profiling-tracing.rst),
and separated pstats documentation.

The tracing profiler docs note that cProfile remains as a backward-compatible
alias, so existing code continues to work. The pstats module gets its own page
since it's used by both profiler types and deserves focused documentation.

* Add profiling.sampling documentation

The sampling profiler is new in Python 3.15 and works fundamentally differently
from the tracing profiler. It observes programs from outside by periodically
capturing stack snapshots, which means zero overhead on the profiled code. This
makes it practical for production use where you can attach to live servers.

The docs explain the key concepts (statistical vs deterministic profiling),
provide quick examples upfront, document all output formats (pstats, flamegraph,
gecko, heatmap), and cover the live TUI mode. The defaults table helps users
understand what happens without any flags.

* Wire profiling docs into the documentation tree

Add the new profiling module pages to the Debugging and Profiling toctree.
The order places the main profiling.rst entry point first, followed by the
two profiler implementations, then pstats, and finally the deprecated profile
module last.

* Convert profile.rst to deprecation stub

The pure Python profile module is deprecated in 3.15 and scheduled for removal
in 3.17. Users should migrate to profiling.tracing (or use the cProfile alias
which continues to work).

The page now focuses on helping existing users migrate: it shows the old vs new
import style, keeps the shared API reference since both modules have the same
interface, and preserves the calibration docs for anyone still using the pure
Python implementation during the transition period.

* Update CLI module references for profiling restructure

Point cProfile to profiling.tracing docs and add profiling.sampling to the
list of modules with CLI interfaces. The old profile-cli label no longer
exists after the documentation restructure.

* Update whatsnew to link to profiling module docs

Enable cross-references to the new profiling module documentation and update
the CLI examples to use the current syntax with the attach subcommand. Also
reference profiling.tracing instead of cProfile since that's the new canonical
name.

5 days agogh-141808: Don't remove the JIT stencils when building with PGO (#141809)
Miro Hrončok [Tue, 9 Dec 2025 12:44:19 +0000 (13:44 +0100)] 
gh-141808: Don't remove the JIT stencils when building with PGO (#141809)

See: https://discuss.python.org/t/building-the-jit-with-pre-built-stencils/91838/12

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
5 days agoGH-139436: Remove PDF and CHM from IDLE HelpSource (#140418)
Adam Turner [Tue, 9 Dec 2025 12:32:53 +0000 (12:32 +0000)] 
GH-139436: Remove PDF and CHM from IDLE HelpSource (#140418)

5 days agogh-142282 Fix winreg.QueryValueEx() under race condition (GH-142283)
Jeong, YunWon [Tue, 9 Dec 2025 12:09:07 +0000 (21:09 +0900)] 
gh-142282 Fix winreg.QueryValueEx() under race condition (GH-142283)

5 days agoSilence warning on conversion from uint64_t to uintptr_t in threads.c (#142437)
AZero13 [Tue, 9 Dec 2025 10:18:51 +0000 (05:18 -0500)] 
Silence warning on conversion from uint64_t to uintptr_t in threads.c (#142437)

6 days agoTachyon: Fix html output sidebar cards hidden behind section headers on hover (#142428)
Stan Ulbrych [Mon, 8 Dec 2025 21:10:48 +0000 (21:10 +0000)] 
Tachyon: Fix html output sidebar cards hidden behind section headers on hover (#142428)

6 days agoFix typo in `Tools/wasm/README.md` (#142426)
Stan Ulbrych [Mon, 8 Dec 2025 20:48:17 +0000 (20:48 +0000)] 
Fix typo in `Tools/wasm/README.md` (#142426)

6 days agogh-138122: Fix unused variable warning in threads.c (#142425)
Sam Gross [Mon, 8 Dec 2025 19:05:11 +0000 (14:05 -0500)] 
gh-138122: Fix unused variable warning in threads.c (#142425)

6 days agogh-142278: Add granular change detection for platforms in CI (#142350)
Stan Ulbrych [Mon, 8 Dec 2025 18:04:17 +0000 (18:04 +0000)] 
gh-142278: Add granular change detection for platforms in CI (#142350)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
6 days agogh-142276: Watch attribute loads when promoting JIT constants (GH-142303)
Ken Jin [Mon, 8 Dec 2025 18:03:15 +0000 (02:03 +0800)] 
gh-142276: Watch attribute loads when promoting JIT constants (GH-142303)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
6 days agoGH-139757: JIT: Remove redundant branches to jumps in the assembly optimizer (GH...
Mark Shannon [Mon, 8 Dec 2025 17:57:11 +0000 (17:57 +0000)] 
GH-139757: JIT: Remove redundant branches to jumps in the assembly optimizer (GH-140800)

JIT: Remove redundant branches to jump in the assembly optimizer

* Refactor JIT assembly optimizer making instructions instances not just strings
* Remove redundant jumps and branches where legal to do so
* Modifies _BINARY_OP_SUBSCR_STR_INT to avoid excessive inlining depth

6 days agogh-123241: Document restrictions for `tp_traverse` implementations (gh-142272)
Sam Gross [Mon, 8 Dec 2025 17:22:13 +0000 (12:22 -0500)] 
gh-123241: Document restrictions for `tp_traverse` implementations (gh-142272)

6 days agogh-124379: Document _PyStackRef (gh-142321)
Sam Gross [Mon, 8 Dec 2025 17:14:50 +0000 (12:14 -0500)] 
gh-124379: Document _PyStackRef (gh-142321)

6 days agoTemporarily allow CI failures for iOS (#142365)
Savannah Ostrowski [Mon, 8 Dec 2025 16:54:47 +0000 (08:54 -0800)] 
Temporarily allow CI failures for iOS (#142365)

iOS tests are flaky right now. Based on the convo in Discord, it seems like allowing failures is the best option.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
6 days agogh-141770: Annotate anonymous mmap usage if "-X dev" is used (gh-142079)
Donghee Na [Mon, 8 Dec 2025 14:47:19 +0000 (23:47 +0900)] 
gh-141770: Annotate anonymous mmap usage if "-X dev" is used (gh-142079)

6 days agogh-140125: Increase object recursion depth for `test_json` from 200k to 500k (#142226)
Zanie Blue [Mon, 8 Dec 2025 13:05:13 +0000 (07:05 -0600)] 
gh-140125: Increase object recursion depth for `test_json` from 200k to 500k (#142226)

Co-authored-by: Victor Stinner <vstinner@python.org>
6 days agoFix pyflakes warnings: variable is assigned to but never used (#142294)
Victor Stinner [Mon, 8 Dec 2025 13:00:31 +0000 (14:00 +0100)] 
Fix pyflakes warnings: variable is assigned to but never used (#142294)

Example of fixed warning:

    Lib/netrc.py:98:13: local variable 'toplevel'
    is assigned to but never used

6 days agoUpdate PCbuild/readme.txt to correct the default platform (GH-142337)
Andrej730 [Mon, 8 Dec 2025 12:50:19 +0000 (13:50 +0100)] 
Update PCbuild/readme.txt to correct the default platform (GH-142337)

6 days agogh-108202: ``calendar``: Document ``prweek`` (#108466)
Apurva Khatri [Mon, 8 Dec 2025 09:54:59 +0000 (04:54 -0500)] 
gh-108202: ``calendar``: Document ``prweek`` (#108466)

Co-authored-by: apurvakhatri <khatri.ap@northeastern.edu>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
6 days agogh-142207: remove assertions incompatible under `profiling.sampling` (#142331)
yihong [Mon, 8 Dec 2025 04:45:04 +0000 (12:45 +0800)] 
gh-142207: remove assertions incompatible under `profiling.sampling` (#142331)

6 days agogh-139946: distinguish stdout or stderr when colorizing output in argparse (#140495)
Frost Ming [Mon, 8 Dec 2025 04:08:06 +0000 (12:08 +0800)] 
gh-139946: distinguish stdout or stderr when colorizing output in argparse (#140495)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
7 days agogh-142363: Improve Tachyon flamegraph contrast (#142377)
Hugo van Kemenade [Mon, 8 Dec 2025 00:51:51 +0000 (02:51 +0200)] 
gh-142363: Improve Tachyon flamegraph contrast (#142377)

7 days agogh-138122: Make sampling profiler integration tests more resilient (#142382)
Pablo Galindo Salgado [Sun, 7 Dec 2025 22:41:15 +0000 (22:41 +0000)] 
gh-138122: Make sampling profiler integration tests more resilient (#142382)

The tests were flaky on slow machines because subprocesses could finish
before enough samples were collected. This adds synchronization similar
to test_external_inspection: test scripts now signal when they start
working, and the profiler waits for this signal before sampling.

Test scripts now run in infinite loops until killed rather than for
fixed iterations, ensuring the profiler always has active work to
sample regardless of machine speed.

7 days agogh-141732: Fix `ExceptionGroup` repr changing when original exception sequence is...
dr-carlos [Sun, 7 Dec 2025 21:04:04 +0000 (07:34 +1030)] 
gh-141732: Fix `ExceptionGroup` repr changing when original exception sequence is mutated (#141736)

7 days agoGH-139862: Fix direct instantiation of `HelpFormatter` (#142384)
Savannah Ostrowski [Sun, 7 Dec 2025 21:02:12 +0000 (13:02 -0800)] 
GH-139862: Fix direct instantiation of `HelpFormatter` (#142384)

7 days agogh-141794: Reduce size of compiler stress tests to fix Android warnings (#142263)
Malcolm Smith [Sun, 7 Dec 2025 20:01:01 +0000 (20:01 +0000)] 
gh-141794: Reduce size of compiler stress tests to fix Android warnings (#142263)

7 days agogh-142346: Fix usage formatting for mutually exclusive groups in argparse (GH-142381)
Serhiy Storchaka [Sun, 7 Dec 2025 19:36:01 +0000 (21:36 +0200)] 
gh-142346: Fix usage formatting for mutually exclusive groups in argparse (GH-142381)

Support groups preceded by positional arguments or followed or intermixed
with other optional arguments. Support empty groups.

7 days agogh-138122: Don't sample partial frame chains (#141912)
Pablo Galindo Salgado [Sun, 7 Dec 2025 15:53:48 +0000 (15:53 +0000)] 
gh-138122: Don't sample partial frame chains (#141912)

8 days agogh-138122: Improve the profiling section in the 3.15 what's new document (#140156)
Pablo Galindo Salgado [Sun, 7 Dec 2025 02:46:33 +0000 (02:46 +0000)] 
gh-138122: Improve the profiling section in the 3.15 what's new document (#140156)

8 days agogh-142368: Refactor test_external_inspection to reduce flakiness in parallel executio...
Pablo Galindo Salgado [Sun, 7 Dec 2025 02:32:20 +0000 (02:32 +0000)] 
gh-142368: Refactor test_external_inspection to reduce flakiness in parallel execution (#142369)

8 days agogh-138122: Implement frame caching in RemoteUnwinder to reduce memory reads (#142137)
Pablo Galindo Salgado [Sat, 6 Dec 2025 22:37:34 +0000 (22:37 +0000)] 
gh-138122: Implement frame caching in RemoteUnwinder to reduce memory reads (#142137)

This PR implements frame caching in the RemoteUnwinder class to significantly reduce memory reads when profiling remote processes with deep call stacks.

When cache_frames=True, the unwinder stores the frame chain from each sample and reuses unchanged portions in subsequent samples. Since most profiling samples capture similar call stacks (especially the parent frames), this optimization avoids repeatedly reading the same frame data from the target process.

The implementation adds a last_profiled_frame field to the thread state that tracks where the previous sample stopped. On the next sample, if the current frame chain reaches this marker, the cached frames from that point onward are reused instead of being re-read from remote memory.

The sampling profiler now enables frame caching by default.

8 days agoGH-142363: Contrast and gradient CSS fixes for Tachyon flamegraph (#142364)
Savannah Ostrowski [Sat, 6 Dec 2025 22:09:10 +0000 (14:09 -0800)] 
GH-142363: Contrast and gradient CSS fixes for Tachyon flamegraph (#142364)

8 days agogh-68552: fix defects policy (#138579)
Ivo Bellin Salarin [Sat, 6 Dec 2025 21:54:29 +0000 (22:54 +0100)] 
gh-68552: fix defects policy  (#138579)

Extend defect handling via policy to a couple of missed defects.

---------

Co-authored-by: Martin Panter <vadmium@users.noreply.github.com>
Co-authored-by: Ivo Bellin Salarin <ivo@nilleb.com>
8 days agogh-142236: Fix incorrect keyword suggestions for syntax errors (#142328)
Pablo Galindo Salgado [Sat, 6 Dec 2025 21:09:35 +0000 (21:09 +0000)] 
gh-142236: Fix incorrect keyword suggestions for syntax errors (#142328)

The keyword typo suggestion mechanism in traceback would incorrectly
suggest replacements when the extracted source code was merely incomplete
rather than containing an actual typo. For example, when a missing comma
caused a syntax error, the system would suggest replacing 'print' with
'not' because the incomplete code snippet happened to pass validation.

The fix adds a validation step that first checks whether the original
extracted code raises a SyntaxError. If the code compiles successfully
or is simply incomplete (compile_command returns None), the function
returns early since there is no way to verify that a keyword replacement
would actually fix the problem.

8 days agogh-142006: Fix HeaderWriteError in email.policy.default caused by extra newline ...
Paresh Joshi [Sat, 6 Dec 2025 20:59:35 +0000 (02:29 +0530)] 
gh-142006: Fix HeaderWriteError in email.policy.default caused by extra newline (#142008)

RDM: This fixes a subtle folding error that showed up when a token exactly filled a line and was followed by whitespace and a token with no folding whitespace that was longer than a line.  In this particular circumstance the whitespace after the first token got pushed on to the next line, and then stolen to go in front of the next unfoldable token...leaving a completely empty line in the line buffer.  That line got turned in to a newline, which is RFC illegal, and the newish security check caught it.  The fix is to just delete that empty line from the buffer.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
8 days agogh-69113: Fix doctest to report line numbers for __test__ strings (#141624)
Sanyam Khurana [Sat, 6 Dec 2025 20:47:08 +0000 (15:47 -0500)] 
gh-69113: Fix doctest to report line numbers for __test__ strings (#141624)

Enhanced the _find_lineno method in doctest to correctly identify and
report line numbers for doctests defined in __test__ dictionaries when
formatted as triple-quoted strings.

Finds a non-blank line in the test string and matches it in the source
file, verifying subsequent lines also match to handle duplicate lines.

Previously, doctest would report "line None" for __test__ dictionary
strings, making it difficult to debug failing tests.

Co-authored-by: Jurjen N.E. Bos <jneb@users.sourceforge.net>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
8 days agogh-140677 Improve heatmap colors (#142241)
ivonastojanovic [Sat, 6 Dec 2025 20:27:16 +0000 (20:27 +0000)] 
gh-140677 Improve heatmap colors (#142241)

Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
8 days agogh-105836: Fix `asyncio.run_coroutine_threadsafe` leaving underlying cancelled asynci...
Kaisheng Xu [Sat, 6 Dec 2025 19:33:25 +0000 (03:33 +0800)] 
gh-105836: Fix `asyncio.run_coroutine_threadsafe` leaving underlying cancelled asyncio task running (#141696)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
8 days agoGH-141565: Add async code awareness to Tachyon (#141533)
Savannah Ostrowski [Sat, 6 Dec 2025 19:31:40 +0000 (11:31 -0800)] 
GH-141565: Add async code awareness to Tachyon (#141533)

Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
8 days agogh-142168: explicitly initialize `stack_array` in `_PyEval_Vector` and `_PyEvalFrameP...
Kir Chou [Sat, 6 Dec 2025 18:59:52 +0000 (03:59 +0900)] 
gh-142168: explicitly initialize `stack_array` in `_PyEval_Vector` and `_PyEvalFramePushAndInit_Ex` (#142192)

Co-authored-by: Kir Chou <note351@hotmail.com>
8 days agoGH-64532: Include parent's required optional arguments in subparser usage (#142355)
Savannah Ostrowski [Sat, 6 Dec 2025 18:30:50 +0000 (10:30 -0800)] 
GH-64532: Include parent's required optional arguments in subparser usage (#142355)

8 days agogh-142332: Fix usage formatting for positional arguments in mutually exclusive groups...
Serhiy Storchaka [Sat, 6 Dec 2025 18:03:45 +0000 (20:03 +0200)] 
gh-142332: Fix usage formatting for positional arguments in mutually exclusive groups in argparse (GH-142333)

8 days agoGH-75949: Fix argparse dropping '|' in mutually exclusive groups on line wrap (#142312)
Savannah Ostrowski [Sat, 6 Dec 2025 15:12:21 +0000 (07:12 -0800)] 
GH-75949: Fix argparse dropping '|' in mutually exclusive groups on line wrap (#142312)

8 days agoDocs: fix RFC index reference for TLS 1.3 (#142262)
Y. Z. Chen [Sat, 6 Dec 2025 13:05:20 +0000 (21:05 +0800)] 
Docs: fix RFC index reference for TLS 1.3 (#142262)

8 days agoRemove unused imports (#142320)
Victor Stinner [Sat, 6 Dec 2025 11:27:31 +0000 (12:27 +0100)] 
Remove unused imports (#142320)

9 days agoGH-142234: Allow `--enable-wasm-dynamic-linking` under WASI (GH-142235)
Brett Cannon [Fri, 5 Dec 2025 23:27:16 +0000 (15:27 -0800)] 
GH-142234: Allow `--enable-wasm-dynamic-linking` under WASI (GH-142235)

While CPython doesn't support `--enable-wasm-dynamic-linking`, external tools like componentize-py do and they have to patch around it. Since the flag is off by default, allowing the flag so external users can add/inject dynamic linking support seems acceptable.

9 days agoExtract data from `Tools/wasm/wasi` that varies between Python versions into a config...
Brett Cannon [Fri, 5 Dec 2025 22:31:30 +0000 (14:31 -0800)] 
Extract data from `Tools/wasm/wasi` that varies between Python versions into a config file (GH-142273)

This should allow for easier backporting of code.

9 days agoIntroduce `build-python` and `build-host` subcommands for `Tools/wasm/wasi` (GH-142266)
Brett Cannon [Fri, 5 Dec 2025 21:35:50 +0000 (13:35 -0800)] 
Introduce `build-python` and `build-host` subcommands for `Tools/wasm/wasi` (GH-142266)

It should make it easier when you need to rebuild just the e.g. host Python, but it requires ./configure to run.

Co-authored-by: Emma Smith <emma@emmatyping.dev>
9 days agogh-142318: Fix typing `'q'` at interactive help screen exiting Tachyon (#142319)
Stan Ulbrych [Fri, 5 Dec 2025 19:36:28 +0000 (19:36 +0000)] 
gh-142318: Fix typing `'q'` at interactive help screen exiting Tachyon (#142319)

9 days agogh-115952: Fix a potential virtual memory allocation denial of service in pickle...
Serhiy Storchaka [Fri, 5 Dec 2025 17:17:01 +0000 (19:17 +0200)] 
gh-115952: Fix a potential virtual memory allocation denial of service in pickle (GH-119204)

Loading a small data which does not even involve arbitrary code execution
could consume arbitrary large amount of memory. There were three issues:

* PUT and LONG_BINPUT with large argument (the C implementation only).
  Since the memo is implemented in C as a continuous dynamic array, a single
  opcode can cause its resizing to arbitrary size. Now the sparsity of
  memo indices is limited.
* BINBYTES, BINBYTES8 and BYTEARRAY8 with large argument.  They allocated
  the bytes or bytearray object of the specified size before reading into
  it.  Now they read very large data by chunks.
* BINSTRING, BINUNICODE, LONG4, BINUNICODE8 and FRAME with large
  argument.  They read the whole data by calling the read() method of
  the underlying file object, which usually allocates the bytes object of
  the specified size before reading into it.  Now they read very large data
  by chunks.

Also add comprehensive benchmark suite to measure performance and memory
impact of chunked reading optimization in PR #119204.

Features:
- Normal mode: benchmarks legitimate pickles (time/memory metrics)
- Antagonistic mode: tests malicious pickles (DoS protection)
- Baseline comparison: side-by-side comparison of two Python builds
- Support for truncated data and sparse memo attack vectors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
9 days agoGH-142267: Cache formatter to avoid repeated `_set_color` calls (#142268)
Savannah Ostrowski [Fri, 5 Dec 2025 16:47:50 +0000 (08:47 -0800)] 
GH-142267: Cache formatter to avoid repeated `_set_color` calls (#142268)

9 days agoGH-139862: Remove `color` from HelpFormatter (#142274)
Savannah Ostrowski [Fri, 5 Dec 2025 16:21:31 +0000 (08:21 -0800)] 
GH-139862: Remove `color` from HelpFormatter (#142274)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
9 days agoAdd explanation comments for tests for overlapped ZIP entries (GH-137152)
Serhiy Storchaka [Fri, 5 Dec 2025 16:09:20 +0000 (18:09 +0200)] 
Add explanation comments for tests for overlapped ZIP entries (GH-137152)

9 days agogh-141370: Fix undefined behavior when using Py_ABS() (GH-141548)
Serhiy Storchaka [Fri, 5 Dec 2025 14:24:35 +0000 (16:24 +0200)] 
gh-141370: Fix undefined behavior when using Py_ABS() (GH-141548)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
9 days agogh-101100: Fix references to the set methods (GH-141857)
Serhiy Storchaka [Fri, 5 Dec 2025 14:22:38 +0000 (16:22 +0200)] 
gh-101100: Fix references to the set methods (GH-141857)