]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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)

6 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)

7 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>
7 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)

7 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)

9 days agoFix disk space issues in Android CI (#142289)
Malcolm Smith [Fri, 5 Dec 2025 13:10:51 +0000 (13:10 +0000)] 
Fix disk space issues in Android CI (#142289)

9 days agogh-48752: Add readline.get_pre_input_hook() function (#141586)
Sanyam Khurana [Fri, 5 Dec 2025 12:18:54 +0000 (07:18 -0500)] 
gh-48752: Add readline.get_pre_input_hook() function (#141586)

Add readline.get_pre_input_hook() to retrieve the current pre-input
hook. This allows applications to save and restore the hook without
overwriting user settings.

10 days agogh-142214: Fix two regressions in dataclasses (#142223)
Jelle Zijlstra [Fri, 5 Dec 2025 04:04:42 +0000 (20:04 -0800)] 
gh-142214: Fix two regressions in dataclasses (#142223)

10 days agogh-141926: Do not unset `RUNSHARED` when cross-compiling (#141958)
Zanie Blue [Fri, 5 Dec 2025 02:15:04 +0000 (20:15 -0600)] 
gh-141926: Do not unset `RUNSHARED` when cross-compiling (#141958)

10 days agogh-141976: Check stack bounds in JIT optimizer (GH-142201)
Ken Jin [Thu, 4 Dec 2025 20:28:08 +0000 (04:28 +0800)] 
gh-141976: Check stack bounds in JIT optimizer (GH-142201)

10 days agogh-116738: Statically initialize special constants in cmath module (gh-142161)
Alper [Thu, 4 Dec 2025 14:21:51 +0000 (06:21 -0800)] 
gh-116738: Statically initialize special constants in cmath module (gh-142161)

The initialization during `mod_exec` wasn't thread-safe with multiple interpreters.

10 days agogh-129483: Make `TestLocalTimeDisambiguation`'s time format locale independent (...
Kir Chou [Thu, 4 Dec 2025 13:32:23 +0000 (22:32 +0900)] 
gh-129483: Make `TestLocalTimeDisambiguation`'s time format locale independent (#142193)

* Change to update %c to the exact time format.

---------

Co-authored-by: Kir Chou <note351@hotmail.com>
10 days ago GH-139757: Fix reference leaks introduced in GH-140800 (GH-142257)
Mark Shannon [Thu, 4 Dec 2025 12:27:15 +0000 (12:27 +0000)] 
 GH-139757: Fix reference leaks introduced in GH-140800 (GH-142257)

11 days agogh-142225: Fix `PyABIInfo_VAR` macro (GH-142230)
Stan Ulbrych [Thu, 4 Dec 2025 09:33:15 +0000 (09:33 +0000)] 
gh-142225: Fix `PyABIInfo_VAR` macro (GH-142230)

11 days agogh-141004: Add a CI job ensuring that new C APIs include documentation (GH-142102)
Peter Bierma [Thu, 4 Dec 2025 03:14:25 +0000 (22:14 -0500)] 
gh-141004: Add a CI job ensuring that new C APIs include documentation (GH-142102)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 days agoBeing more flexible in when not to explicitly set the sysroot when compiling for...
Brett Cannon [Wed, 3 Dec 2025 23:42:10 +0000 (15:42 -0800)] 
Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242)

11 days agogh-142218: Fix split table dictionary crash (gh-142229)
Sam Gross [Wed, 3 Dec 2025 23:37:35 +0000 (18:37 -0500)] 
gh-142218: Fix split table dictionary crash (gh-142229)

This fixes a regression introduced in gh-140558. The interpreter would
crash if we inserted a non `str` key into a split table that matches an
existing key.

11 days agoGH-142050: Jit stencils on Windows contain debug data (#142052)
Chris Eibl [Wed, 3 Dec 2025 22:08:51 +0000 (23:08 +0100)] 
GH-142050: Jit stencils on Windows contain debug data (#142052)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
11 days agogh-140482: Avoid changing terminal settings in test_pty (gh-142202)
Sam Gross [Wed, 3 Dec 2025 20:48:44 +0000 (15:48 -0500)] 
gh-140482: Avoid changing terminal settings in test_pty (gh-142202)

The previous test_spawn_doesnt_hang test had a few problems:

* It would cause ENV CHANGED failures if other tests were running
  concurrently due to stty changes
* Typing while the test was running could cause it to fail

11 days agoGH-141794: Limit size of generated machine code. (GH-142228)
Mark Shannon [Wed, 3 Dec 2025 17:43:35 +0000 (17:43 +0000)] 
GH-141794: Limit size of generated machine code. (GH-142228)

* Factor out bodies of the largest uops, to reduce jit code size.
* Factor out common assert, also reducing jit code size.
* Limit size of jitted code for a single executor to 1MB.

11 days agogh-135676: Reword the f-string (and t-string) section (GH-137469)
Petr Viktorin [Wed, 3 Dec 2025 15:14:53 +0000 (16:14 +0100)] 
gh-135676: Reword the f-string (and t-string) section (GH-137469)

Much of the information was duplicated in stdtypes.rst; this PR keeps lexical/syntactical details in Lexical Analysis and the evaluation & runtime behaviour in Standard types, with cross-references between the two.
Since the t-string section only listed differences from f-strings, and the grammar for the two is equivalent, that section was moved to Standard types almost entirely.

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
11 days agogh-142038: Expand guard for types_world_is_stopped() to fix debug builds without...
Uwe L. Korn [Wed, 3 Dec 2025 14:24:17 +0000 (15:24 +0100)] 
gh-142038: Expand guard for types_world_is_stopped() to fix debug builds without assertions (#142039)

11 days agogh-142217: Remove internal _Py_Identifier functions (#142219)
Victor Stinner [Wed, 3 Dec 2025 13:33:32 +0000 (14:33 +0100)] 
gh-142217: Remove internal _Py_Identifier functions (#142219)

Remove internal functions:

* _PyDict_ContainsId()
* _PyDict_DelItemId()
* _PyDict_GetItemIdWithError()
* _PyDict_SetItemId()
* _PyEval_GetBuiltinId()
* _PyObject_CallMethodIdNoArgs()
* _PyObject_CallMethodIdObjArgs()
* _PyObject_CallMethodIdOneArg()
* _PyObject_VectorcallMethodId()
* _PyUnicode_EqualToASCIIId()

These functions were not exported and so no usable outside CPython.

11 days agogh-142206: multiprocessing.resource_tracker: Decode messages using older protocol...
Petr Viktorin [Wed, 3 Dec 2025 12:59:14 +0000 (13:59 +0100)] 
gh-142206: multiprocessing.resource_tracker: Decode messages using older protocol (GH-142215)

12 days agogh-142170: Add pymanager link to issue template menu (#142199)
Bartosz Sławecki [Wed, 3 Dec 2025 09:11:40 +0000 (10:11 +0100)] 
gh-142170: Add pymanager link to issue template menu (#142199)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 days agogh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146)
Seth Michael Larson [Wed, 3 Dec 2025 07:16:37 +0000 (01:16 -0600)] 
gh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146)

* Remove quadratic behavior in node ID cache clearing

Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>
* Add news fragment

---------

Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>
12 days agogh-140677 Add heatmap visualization to Tachyon sampling profiler (#140680)
Pablo Galindo Salgado [Tue, 2 Dec 2025 20:33:40 +0000 (20:33 +0000)] 
gh-140677 Add heatmap visualization to Tachyon sampling profiler (#140680)

Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com>
12 days agogh-139707: Fix example for configure option (GH-142153)
Stan Ulbrych [Tue, 2 Dec 2025 13:12:20 +0000 (13:12 +0000)] 
gh-139707: Fix example for configure option (GH-142153)

Fix example for nre configure option

13 days agoDocument None for timeout argument of select.select (#142177)
Petr Viktorin [Tue, 2 Dec 2025 08:57:09 +0000 (09:57 +0100)] 
Document None for timeout argument of select.select (#142177)

13 days agogh-141982: Fix pdb can't set breakpoints on async functions (#141983)
LloydZ [Tue, 2 Dec 2025 07:40:02 +0000 (15:40 +0800)] 
gh-141982: Fix pdb can't set breakpoints on async functions (#141983)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
13 days agogh-140281: Update free threading Python HOWTO for 3.14 (gh-140566)
Krishna-web-hub [Tue, 2 Dec 2025 05:53:12 +0000 (11:23 +0530)] 
gh-140281: Update free threading Python HOWTO for 3.14 (gh-140566)

Co-authored-by: Sam Gross <colesbury@gmail.com>
13 days agogh-59000: Fix pdb breakpoint resolution for class methods when module not imported...
LloydZ [Tue, 2 Dec 2025 04:41:54 +0000 (12:41 +0800)] 
gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (#141949)

13 days agogh-142163: Only define `HAVE_THREAD_LOCAL` when `Py_BUILD_CORE` is set (#142164)
Peter Bierma [Tue, 2 Dec 2025 04:13:11 +0000 (23:13 -0500)] 
gh-142163: Only define `HAVE_THREAD_LOCAL` when `Py_BUILD_CORE` is set (#142164)

13 days agogh-142048: Fix quadratically increasing GC delays (gh-142051)
Kevin Wang [Tue, 2 Dec 2025 00:04:47 +0000 (19:04 -0500)] 
gh-142048: Fix quadratically increasing GC delays (gh-142051)

The GC for the free threaded build would get slower with each collection due
to effectively double counting objects freed by the GC.

13 days agogh-138122: Small fixes to the new tachyon UI (#142157)
Pablo Galindo Salgado [Mon, 1 Dec 2025 18:37:46 +0000 (18:37 +0000)] 
gh-138122: Small fixes to the new tachyon UI (#142157)

13 days agogh-138122: New Tachyon UI (#142116)
László Kiss Kollár [Mon, 1 Dec 2025 17:34:14 +0000 (17:34 +0000)] 
gh-138122: New Tachyon UI (#142116)

Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
13 days agogh-141004: Document descriptor and dict proxy type objects (GH-141803)
Yashraj [Mon, 1 Dec 2025 15:51:50 +0000 (21:21 +0530)] 
gh-141004: Document descriptor and dict proxy type objects (GH-141803)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
13 days agogh-119342: Fix a potential denial of service in plistlib (GH-119343)
Serhiy Storchaka [Mon, 1 Dec 2025 15:28:15 +0000 (17:28 +0200)] 
gh-119342: Fix a potential denial of service in plistlib (GH-119343)

Reading a specially prepared small Plist file could cause OOM because file's
read(n) preallocates a bytes object for reading the specified amount of
data. Now plistlib reads large data by chunks, therefore the upper limit of
consumed memory is proportional to the size of the input file.

13 days agogh-119451: Fix a potential denial of service in http.client (GH-119454)
Serhiy Storchaka [Mon, 1 Dec 2025 15:26:07 +0000 (17:26 +0200)] 
gh-119451: Fix a potential denial of service in http.client (GH-119454)

Reading the whole body of the HTTP response could cause OOM if
the Content-Length value is too large even if the server does not send
a large amount of data. Now the HTTP client reads large data by chunks,
therefore the amount of consumed memory is proportional to the amount
of sent data.

13 days agogh-139707: Add mechanism for distributors to supply error messages for missing stdlib...
Stan Ulbrych [Mon, 1 Dec 2025 13:36:17 +0000 (13:36 +0000)] 
gh-139707: Add mechanism for distributors to supply error messages for missing stdlib modules (GH-140783)

13 days agoDocs: Upgrade Sphinx to 9.0 (#142114)
Adam Turner [Mon, 1 Dec 2025 11:16:37 +0000 (11:16 +0000)] 
Docs: Upgrade Sphinx to 9.0 (#142114)

2 weeks agogh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH...
Gregory P. Smith [Mon, 1 Dec 2025 02:50:05 +0000 (18:50 -0800)] 
gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH-142101)

Document not calling Popen.wait after Popen.communicate times out.

Closes #141473

2 weeks agogh-142066: Fix grammar in multiprocessing Pipes and Queues (GH-142121)
Tadej Magajna [Mon, 1 Dec 2025 02:14:20 +0000 (03:14 +0100)] 
gh-142066: Fix grammar in multiprocessing Pipes and Queues (GH-142121)

docs: Fix grammar in multiprocessing Pipes and Queues (gh-142066)

2 weeks agogh-142067: Add missing default value for param in `multiprocessing.Pipe`'s doc (GH...
flovent [Sun, 30 Nov 2025 21:10:01 +0000 (05:10 +0800)] 
gh-142067: Add missing default value for param in `multiprocessing.Pipe`'s doc (GH-142109)

2 weeks agoImprove clarity in tutorial introduction (#140669)
Thierry Martos [Sun, 30 Nov 2025 12:47:31 +0000 (04:47 -0800)] 
Improve clarity in tutorial introduction (#140669)

2 weeks agogh-141999: Handle KeyboardInterrupt when sampling in the new tachyon profiler (#142000)
yihong [Sun, 30 Nov 2025 02:49:13 +0000 (10:49 +0800)] 
gh-141999: Handle KeyboardInterrupt when sampling in the new tachyon profiler (#142000)

2 weeks agogh-138122: Add thread status statistics to flamegraph profiler (#141900)
Pablo Galindo Salgado [Sun, 30 Nov 2025 01:42:39 +0000 (01:42 +0000)] 
gh-138122: Add thread status statistics to flamegraph profiler (#141900)

Co-authored-by: ivonastojanovic <80911834+ivonastojanovic@users.noreply.github.com>
2 weeks agogh-133146: Add the old public `get_value` method to documentation and refactor code...
Duprat [Sat, 29 Nov 2025 22:12:48 +0000 (23:12 +0100)] 
gh-133146: Add the old public `get_value` method to documentation and refactor code. (GH-133301)

also uses it within the internals in a few places.

2 weeks agoGH-141808: Do not generate the jit stencils twice in case of PGO builds on Windows...
Chris Eibl [Sat, 29 Nov 2025 20:43:06 +0000 (21:43 +0100)] 
GH-141808: Do not generate the jit stencils twice in case of PGO builds on Windows. (GH-142043)

* do not build the jit stencils twice in case of PGO builds on Windows

* blurb it

2 weeks agoDocs: Prepare for Sphinx 9 (#142057)
Adam Turner [Sat, 29 Nov 2025 14:49:37 +0000 (14:49 +0000)] 
Docs: Prepare for Sphinx 9 (#142057)