]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
6 days agogh-130415: Narrow types to constants in branches involving specialized comparisons...
reiden [Sat, 24 Jan 2026 10:02:08 +0000 (18:02 +0800)] 
gh-130415: Narrow types to constants in branches involving specialized comparisons with a constant (GH-144150)

6 days agogh-144068: fix JIT tracer memory leak when daemon thread exits (GH-144077)
Hai Zhu [Sat, 24 Jan 2026 09:43:01 +0000 (17:43 +0800)] 
gh-144068: fix JIT tracer memory leak when daemon thread exits (GH-144077)

6 days agoMisc: remove duplicate `instr_frame` assignment in `_PyJit_TryInitializeTracing`...
Yongtao Huang [Sat, 24 Jan 2026 09:37:45 +0000 (17:37 +0800)] 
Misc: remove duplicate `instr_frame` assignment in `_PyJit_TryInitializeTracing` (GH-144155)

Remove duplicate instr_frame assignment in optimizer

6 days agogh-144016: Fix bad stack assert in the JIT optimizer (GH-144019)
Ken Jin [Sat, 24 Jan 2026 09:36:40 +0000 (17:36 +0800)] 
gh-144016: Fix bad stack assert in the JIT optimizer (GH-144019)

6 days agogh-144007: Eliminate redundant refcounting in the JIT for BINARY_OP (GH-144011)
AN Long [Sat, 24 Jan 2026 09:35:32 +0000 (18:35 +0900)] 
gh-144007: Eliminate redundant refcounting in the JIT for BINARY_OP (GH-144011)

6 days agogh-135142: Initial 3.15 IDLE News3.txt entries (#144200)
Terry Jan Reedy [Sat, 24 Jan 2026 02:34:41 +0000 (21:34 -0500)] 
gh-135142: Initial 3.15 IDLE News3.txt entries (#144200)

6 days agogh-74902: Avoid hitting unicode.org for test data (GH-144195)
Zachary Ware [Fri, 23 Jan 2026 21:07:27 +0000 (15:07 -0600)] 
gh-74902: Avoid hitting unicode.org for test data (GH-144195)

Use our own pythontest.net instead.

6 days agogh-144027: Fix documentation for ignorechars in base64.a85decode() (GH-144028)
Serhiy Storchaka [Fri, 23 Jan 2026 18:55:48 +0000 (20:55 +0200)] 
gh-144027: Fix documentation for ignorechars in base64.a85decode() (GH-144028)

It does not support an ASCII string.

Also add more tests.

6 days agogh-144005: Eliminate redundant refcounting in the JIT for BINARY_OP_EXTEND (#144006)
AN Long [Fri, 23 Jan 2026 17:19:01 +0000 (02:19 +0900)] 
gh-144005: Eliminate redundant refcounting in the JIT for BINARY_OP_EXTEND (#144006)

6 days agogh-141376: smelly.py: Print only smelly symbols, or all of them with --verbose (GH...
Petr Viktorin [Fri, 23 Jan 2026 16:51:29 +0000 (17:51 +0100)] 
gh-141376: smelly.py: Print only smelly symbols, or all of them with --verbose (GH-141394)

Instead of long and uninteresting output for all checked libraries, only print found issues by default.

Add a new -v/--verbose option to list all symbols (useful for checking that the script finds the symbols).

6 days agoProgramming FAQ: fix some punctuaction typos (GH-144058)
Bartosz Sławecki [Fri, 23 Jan 2026 16:34:21 +0000 (17:34 +0100)] 
Programming FAQ: fix some punctuaction typos (GH-144058)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
6 days agogh-144125: email: verify headers are sound in BytesGenerator
Seth Michael Larson [Fri, 23 Jan 2026 14:59:35 +0000 (08:59 -0600)] 
gh-144125: email: verify headers are sound in BytesGenerator

Co-authored-by: Denis Ledoux <dle@odoo.com>
Co-authored-by: Denis Ledoux <5822488+beledouxdenis@users.noreply.github.com>
Co-authored-by: Petr Viktorin <302922+encukou@users.noreply.github.com>
Co-authored-by: Bas Bloemsaat <1586868+basbloemsaat@users.noreply.github.com>
7 days agoDoc: fix incorrect reference in `isasyncgenfunction` docs (GH-144099)
Yongtao Huang [Fri, 23 Jan 2026 08:06:47 +0000 (16:06 +0800)] 
Doc: fix incorrect reference in `isasyncgenfunction` docs (GH-144099)

Fix incorrect reference in isasyncgenfunction docs

7 days agogh-143513: Remove importlib.abc documentation for removed ABCs (#143605)
Alex Willmer [Thu, 22 Jan 2026 22:00:37 +0000 (22:00 +0000)] 
gh-143513: Remove importlib.abc documentation for removed ABCs (#143605)

In 3.11 ResourceReader, Traversable, & TraversableResources moved from importlib.abc to importlib.resources.abc (commit e712a5b277866a71c195f38c1b5d87d9126dba3e).

In 3.12 old import locations were deprecated (commit 71848c960927af801656026203371c41ad139b5a).

In 3.14 backwards-compat support was removed (commit 0751511d24295c39fdf2f5b2255e3fa3d796ce4d).

Co-authored-by: Brett Cannon <brett@python.org>
7 days agoAdd source links to documentation for Windows-specific modules (GH-130244)
Dimma Don't [Thu, 22 Jan 2026 21:30:13 +0000 (16:30 -0500)] 
Add source links to documentation for Windows-specific modules (GH-130244)

7 days agogh-143756: Avoid borrowed reference in SSL code (gh-143816)
Sam Gross [Thu, 22 Jan 2026 19:02:48 +0000 (14:02 -0500)] 
gh-143756: Avoid borrowed reference in SSL code (gh-143816)

GET_SOCKET() returned a borrowed reference, which was potentially
unsafe. Also, refactor out some common code.

7 days agogh-143756: Fix potential data race in SSLContext.load_cert_chain (gh-143818)
Sam Gross [Thu, 22 Jan 2026 19:02:30 +0000 (14:02 -0500)] 
gh-143756: Fix potential data race in SSLContext.load_cert_chain (gh-143818)

Concurrent calls to `load_cert_chain` caused data races in OpenSSL code.

7 days agogh-144157: Optimize bytes.translate() by deferring change detection (GH-144158)
Gregory P. Smith [Thu, 22 Jan 2026 17:21:07 +0000 (09:21 -0800)] 
gh-144157: Optimize bytes.translate() by deferring change detection (GH-144158)

Optimize bytes.translate() by deferring change detection

Move the equality check out of the hot loop to allow better compiler
optimization. Instead of checking each byte during translation, perform
a single memcmp at the end to determine if the input can be returned
unchanged.

This allows compilers to unroll and pipeline the loops, resulting in ~2x
throughput improvement for medium-to-large inputs (tested on an AMD zen2).
No change observed on small inputs.

It will also be faster for bytes subclasses as those do not need change
detection.

7 days agogh-142779: Initialize reserved field for proper padding (#142780)
stratakis [Thu, 22 Jan 2026 17:06:36 +0000 (18:06 +0100)] 
gh-142779: Initialize reserved field for proper padding (#142780)

The jitdump specification specifies a reserved field for padding.

Initialize it so no garbage data is embedded in the jitdump files.

8 days agogh-67041: Allow to distinguish between empty and not defined URI components (GH-123305)
Serhiy Storchaka [Thu, 22 Jan 2026 12:29:13 +0000 (14:29 +0200)] 
gh-67041: Allow to distinguish between empty and not defined URI components (GH-123305)

Changes in the urllib.parse module:

* Add option missing_as_none in urlparse(), urlsplit() and urldefrag(). If
  it is true, represent not defined components as None instead of an
  empty string.
* Add option keep_empty in urlunparse() and urlunsplit(). If it is
  true, keep empty non-None components in the resulting string.

8 days agogh-143001: Add @cpython_only to test_sys.test_current_frames() (#144004)
Jeong, YunWon [Thu, 22 Jan 2026 11:08:08 +0000 (20:08 +0900)] 
gh-143001: Add @cpython_only to test_sys.test_current_frames() (#144004)

8 days agoGH-139109: Partial reworking of JIT data structures (GH-144105)
Mark Shannon [Thu, 22 Jan 2026 10:55:49 +0000 (10:55 +0000)] 
GH-139109: Partial reworking of JIT data structures (GH-144105)

* Halve size of buffers by reusing combined trace + optimizer buffers for TOS caching
* Add simple buffer struct for more maintainable handling of buffers
* Decouple JIT structs from thread state struct
* Ensure terminator is added to trace, when optimizer gives up

8 days agogh-141004: Mark up constants for `PyOS_double_to_string` (GH-143867)
Petr Viktorin [Thu, 22 Jan 2026 10:53:17 +0000 (11:53 +0100)] 
gh-141004: Mark up constants for `PyOS_double_to_string` (GH-143867)

This ensures they show up as C macros in search and the Sphinx inventory.

8 days agogh-143959: Make _datetime optional for test_sys (GH-144003)
Jeong, YunWon [Thu, 22 Jan 2026 10:52:16 +0000 (19:52 +0900)] 
gh-143959: Make _datetime optional for test_sys (GH-144003)

8 days agogh-143993: Document ways to disable remote debugging support (#143994)
Rafael Weingartner-Ortner [Thu, 22 Jan 2026 10:41:20 +0000 (11:41 +0100)] 
gh-143993: Document ways to disable remote debugging support (#143994)

Although PEP 768 mentions how to disable the mechanism of
remote debugging, it is not documented in the Python docs.

This change adds a note on how to disable remote debugging support
in a Python interpreter to the remote debugging how-to.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
8 days agogh-142913: Revert adding test_replaced_interpreter (GH-144110)
Petr Viktorin [Thu, 22 Jan 2026 09:40:34 +0000 (10:40 +0100)] 
gh-142913: Revert adding test_replaced_interpreter (GH-144110)

This partially reverts commit 4d5a676aa0811563ea78ae58ef89cdc0295bf7ed
(GH-142911)

The removed test fails when re-run in --huntrleaks mode.

8 days agogh-130415: Narrowing to constants in branches involving `is` comparisons with a const...
reiden [Thu, 22 Jan 2026 09:37:45 +0000 (17:37 +0800)] 
gh-130415: Narrowing to constants in branches involving `is` comparisons with a constant (GH-143895)

8 days agoGH-143941: Move WASI-related files to Platforms/WASI (GH-143942)
Brett Cannon [Wed, 21 Jan 2026 22:31:58 +0000 (14:31 -0800)] 
GH-143941: Move WASI-related files to Platforms/WASI (GH-143942)

Along the way, leave a deprecated Tools/wasm/wasi/__main__.py behind for backwards-compatibility.

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
8 days agogh-77188: Add pickle tests for objects with slots (GH-144116)
Serhiy Storchaka [Wed, 21 Jan 2026 17:21:02 +0000 (19:21 +0200)] 
gh-77188: Add pickle tests for objects with slots (GH-144116)

8 days agoGH-138245: Perform boolean guards by testing a single bit, rather than a full pointer...
Mark Shannon [Wed, 21 Jan 2026 15:58:27 +0000 (15:58 +0000)] 
GH-138245: Perform boolean guards by testing a single bit, rather than a full pointer comparison. (GH-143810)

8 days agoUpdate install manager docs (python/pymanager#227) (GH-144079)
Steve Dower [Wed, 21 Jan 2026 15:33:05 +0000 (15:33 +0000)] 
Update install manager docs (python/pymanager#227) (GH-144079)

9 days agogh-144030: Add check that argument is callable to Python version of functools.lru_cac...
CF Bolz-Tereick [Wed, 21 Jan 2026 14:19:19 +0000 (15:19 +0100)] 
gh-144030: Add check that argument is callable to Python version of functools.lru_cache (#144031)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
9 days agogh-143869: Add PEP 757 functions to the limited API (#143906)
Sergey B Kirpichev [Wed, 21 Jan 2026 13:47:14 +0000 (16:47 +0300)] 
gh-143869: Add PEP 757 functions to the limited API (#143906)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
9 days agogh-144085: Add `{gi,cr}_suspended` to `inspect` comments and `generator/coroutine...
Yongtao Huang [Wed, 21 Jan 2026 10:33:56 +0000 (18:33 +0800)] 
gh-144085: Add `{gi,cr}_suspended` to `inspect` comments and `generator/coroutine` tests (#144086)

9 days agogh-125346: Deprecate accepting standard Base64 alphabet when alternative alphabet...
Serhiy Storchaka [Wed, 21 Jan 2026 07:41:58 +0000 (09:41 +0200)] 
gh-125346: Deprecate accepting standard Base64 alphabet when alternative alphabet is used (GH-141128)

Emit a warning in base64.urlsafe_b64decode() and base64.b64decode() when
the "+" or "/" characters occur in the Base64 data with alternative
alphabet if they are not the part of the alternative alphabet.

It is a DeprecationWarning in the strict mode (will be error) and
a FutureWarning in non-strict mode (will be ignored).

9 days agoGH-143948: Explain graphlib's cycle-finding code (#143950)
Tim Peters [Wed, 21 Jan 2026 01:28:48 +0000 (19:28 -0600)] 
GH-143948: Explain graphlib's cycle-finding code (#143950)

Explain topsort's cycle-finding algorithm, and why it's written that way.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
9 days agogh-143919: Reject control characters in http cookies
Seth Michael Larson [Tue, 20 Jan 2026 21:23:42 +0000 (15:23 -0600)] 
gh-143919: Reject control characters in http cookies

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
9 days agogh-143923: Reject control characters in POP3 commands
Seth Michael Larson [Tue, 20 Jan 2026 20:46:32 +0000 (14:46 -0600)] 
gh-143923: Reject control characters in POP3 commands

9 days agogh-143925: Reject control characters in data: URL mediatypes
Seth Michael Larson [Tue, 20 Jan 2026 20:45:58 +0000 (14:45 -0600)] 
gh-143925: Reject control characters in data: URL mediatypes

9 days agogh-143921: Reject control characters in IMAP commands
Seth Michael Larson [Tue, 20 Jan 2026 20:45:42 +0000 (14:45 -0600)] 
gh-143921: Reject control characters in IMAP commands

9 days agogh-141504: Move PYTHON_UOPS_OPTIMIZE to policy object (GH-144082)
Donghee Na [Tue, 20 Jan 2026 18:47:38 +0000 (03:47 +0900)] 
gh-141504: Move PYTHON_UOPS_OPTIMIZE to policy object (GH-144082)

9 days agogh-144054: no deferred refcount for untracked (gh-144081)
Neil Schemenauer [Tue, 20 Jan 2026 18:01:09 +0000 (10:01 -0800)] 
gh-144054: no deferred refcount for untracked (gh-144081)

This reverts gh-144055 and fixes the bug in a different way.  Deferred
reference counting relies on the object being tracked by the GC,
otherwise the object will live until interpreter shutdown.  So, take
care that we do not enable deferred reference counting for objects that
are untracked.  Also, if a tuple has deferred reference counting
enabled, don't untrack it.

9 days agogh-143939: Fix assignment to `_PyThreadStateImpl.generator_return_kind` (gh-143951)
Sam Gross [Tue, 20 Jan 2026 17:51:55 +0000 (12:51 -0500)] 
gh-143939: Fix assignment to `_PyThreadStateImpl.generator_return_kind` (gh-143951)

The assignment to generator_return_kind has to be after any potentially
escaping calls to ensure that it's not overwritten.

9 days agogh-143960: Add support for OpenSSL 3.6, drop EOL 3.2 (#143961)
Hugo van Kemenade [Tue, 20 Jan 2026 15:25:31 +0000 (17:25 +0200)] 
gh-143960: Add support for OpenSSL 3.6, drop EOL 3.2 (#143961)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
10 days agogh-144054: shutdown fix for deferred ref counting (GH-144055)
Neil Schemenauer [Tue, 20 Jan 2026 13:45:12 +0000 (05:45 -0800)] 
gh-144054: shutdown fix for deferred ref counting (GH-144055)

When shutting down, disable deferred refcounting for all GC objects. It
is important to do this also for untracked objects, which before this
change were getting missed.

Small code cleanup:
We can remove the shutdown case disable_deferred_refcounting() call
inside scan_heap_visitor() if we are careful about it.  The key is
that frame_disable_deferred_refcounting() might fail if the object
is untracked.

10 days agoUpdate struct.__doc__: _Bool available unconditionally (#143716)
Sergey B Kirpichev [Tue, 20 Jan 2026 12:09:20 +0000 (15:09 +0300)] 
Update struct.__doc__: _Bool available unconditionally (#143716)

This amends commit a9296e7f3be4d6c22271b25c86467ff867c63bbb.

10 days agogh-144050: Fix stat.filemode pure Python file type detection (GH-144059)
VanshAgarwal24036 [Tue, 20 Jan 2026 12:05:42 +0000 (17:35 +0530)] 
gh-144050: Fix stat.filemode pure Python file type detection (GH-144059)

10 days agogh-143999: Fix: handle suspended state on types.coroutine wrappers (GH-144000)
Yongtao Huang [Tue, 20 Jan 2026 10:20:06 +0000 (18:20 +0800)] 
gh-143999: Fix: handle suspended state on types.coroutine wrappers (GH-144000)

10 days agogh-144023: Prevent follow_symlinks from being allowed with an fd of 0 (GH-144022)
AZero13 [Tue, 20 Jan 2026 09:50:51 +0000 (04:50 -0500)] 
gh-144023: Prevent follow_symlinks from being allowed with an fd of 0 (GH-144022)

The check was (fd > 0), should be (fd >= 0).

10 days agogh-143774 - Improve IDLE Format Paragraph doc (#143775)
Terry Jan Reedy [Tue, 20 Jan 2026 09:07:29 +0000 (04:07 -0500)] 
gh-143774 - Improve IDLE Format Paragraph doc (#143775)

Add a reminder to not rewrap code line to the Menu => Format => Reformat Paragraph entry.
In Editing and Nagivagion, add a new 'Format block' subsection that defines 'paragraph'
to better match what is dependably handled as more or less expected.
In particular, specify equal indents and that the resulting indent equals original indent.
Also mention that selections are expanded to complete lines and how to modify max length.

(Also fix a couple case errors in cross references.)

10 days agogh-143754: Add Tkinter methods pack_content(), place_content() and grid_content(...
Serhiy Storchaka [Tue, 20 Jan 2026 07:16:36 +0000 (09:16 +0200)] 
gh-143754: Add Tkinter methods pack_content(), place_content() and grid_content() (GH-143845)

They use Tk commands with new name like "pack content instead of old
"pack slaves".

10 days agoFix typo: 'exept' -> 'except' in Lib/dbm/dumb.py (GH-144060)
Bodhi Silberling [Tue, 20 Jan 2026 06:50:34 +0000 (22:50 -0800)] 
Fix typo: 'exept' -> 'except' in Lib/dbm/dumb.py (GH-144060)

10 days agogh-143874: Use self.message instead of raw print in `_exec_in_closure()` (#143875)
Yongtao Huang [Tue, 20 Jan 2026 00:11:07 +0000 (08:11 +0800)] 
gh-143874: Use self.message instead of raw print in `_exec_in_closure()`  (#143875)

10 days agogh-102809: No longer mention `Misc/gdbinit` in the code (#143980)
Bartosz Sławecki [Mon, 19 Jan 2026 17:36:55 +0000 (18:36 +0100)] 
gh-102809: No longer mention `Misc/gdbinit` in the code (#143980)

Fix misleading comment on `PyObject_Dump`.

11 days agogh-106318: Add examples for str.rpartition() method (#143891)
Adorilson Bezerra [Mon, 19 Jan 2026 14:15:55 +0000 (14:15 +0000)] 
gh-106318: Add examples for str.rpartition() method (#143891)

11 days agogh-143689: Fix BufferedReader.read1 leaving object in reentrant state on error (...
Yongtao Huang [Mon, 19 Jan 2026 14:09:30 +0000 (22:09 +0800)] 
gh-143689: Fix BufferedReader.read1 leaving object in reentrant state on error (#143690)

BufferedReader.read1() could leave the buffered object in a
reentrant (locked) state when an exception was raised while
allocating the output buffer.

This change ensures the internal buffered lock is always released
on error, keeping the object in a consistent state after failures.

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
11 days agogh-142461: Move misplaced NEWS entries to an appropriate section (GH-143392)
Aniket [Mon, 19 Jan 2026 12:59:26 +0000 (18:29 +0530)] 
gh-142461: Move misplaced NEWS entries to an appropriate section (GH-143392)

11 days agogh-143935: Email preserve parens when folding comments (#143936)
Seth Michael Larson [Mon, 19 Jan 2026 12:38:22 +0000 (06:38 -0600)] 
gh-143935: Email preserve parens when folding comments (#143936)

Fix a bug in the folding of comments when flattening an email message
using a modern email policy. Comments consisting of a very long sequence of
non-foldable characters could trigger a forced line wrap that omitted the
required leading space on the continuation line, causing the remainder of
the comment to be interpreted as a new header field. This enabled header
injection with carefully crafted inputs.

Co-authored-by: Denis Ledoux <dle@odoo.com>
11 days agogh-143897: Remove the isxidstart() and isxidcontinue() methods of unicodedata.ucd_3_2...
Serhiy Storchaka [Mon, 19 Jan 2026 12:37:41 +0000 (14:37 +0200)] 
gh-143897: Remove the isxidstart() and isxidcontinue() methods of unicodedata.ucd_3_2_0 (GH-143898)

They are now only exposed as the unicodedata function.

11 days agogh-142440: Fix _decimal builds configured with EXTRA_FUNCTIONALITY (GH-142441)
AZero13 [Mon, 19 Jan 2026 12:19:20 +0000 (07:19 -0500)] 
gh-142440: Fix _decimal builds configured with EXTRA_FUNCTIONALITY (GH-142441)

There was a typo in _decimal.Context.apply().

11 days agogh-143754: Modernize Tkinter docs (GH-143841)
Serhiy Storchaka [Mon, 19 Jan 2026 12:01:29 +0000 (14:01 +0200)] 
gh-143754: Modernize Tkinter docs (GH-143841)

Use more relevant terminology instead of "master"/"slave" widgets where possible.

11 days agogh-143866: Verify return value of `pathlib.write_{bytes,text}` methods in tests ...
b9788213 [Mon, 19 Jan 2026 11:24:20 +0000 (14:24 +0300)] 
gh-143866: Verify return value of `pathlib.write_{bytes,text}` methods in tests (#143870)

Co-authored-by: sobolevn <mail@sobolevn.me>
11 days agogh-75459: versionadded for PyObject_CallFinalizer*() API (GH-143982)
Sergey B Kirpichev [Mon, 19 Jan 2026 10:22:16 +0000 (13:22 +0300)] 
gh-75459: versionadded for PyObject_CallFinalizer*() API (GH-143982)

11 days agogh-143831: Compare cells by identity in forward references (#143848)
Bartosz Sławecki [Mon, 19 Jan 2026 05:29:11 +0000 (06:29 +0100)] 
gh-143831: Compare cells by identity in forward references (#143848)

11 days agoNotify Sviat of GHA changes through codeowners (#143945)
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) [Sun, 18 Jan 2026 22:28:38 +0000 (23:28 +0100)] 
Notify Sviat of GHA changes through codeowners (#143945)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 days agogh-141860: Add on_error= keyword arg to `multiprocessing.set_forkserver_preload`...
Gregory P. Smith [Sun, 18 Jan 2026 22:04:18 +0000 (14:04 -0800)] 
gh-141860: Add on_error= keyword arg to `multiprocessing.set_forkserver_preload` (GH-141859)

Add a keyword-only `on_error` parameter to `multiprocessing.set_forkserver_preload()`. This allows the user to have exceptions during optional `forkserver` start method module preloading cause the forkserver subprocess to warn (generally to stderr) or exit with an error (preventing use of the forkserver) instead of being silently ignored.

This _also_ fixes an oversight, errors when preloading a `__main__` module are now treated the similarly. Those would always raise unlike other modules in preload, but that had gone unnoticed as up until bug fix PR GH-135295 in 3.14.1 and 3.13.8, the `__main__` module was never actually preloaded.

Based on original work by Nick Neumann @aggieNick02 in GH-99515.

11 days agogh-144012: Check null binary op extend (#144014)
AN Long [Sun, 18 Jan 2026 18:38:37 +0000 (03:38 +0900)] 
gh-144012: Check null binary op extend (#144014)

12 days agogh-143952: Fix asyncio tools to work with the new remote debugging API (#143954)
Bartosz Sławecki [Sun, 18 Jan 2026 00:16:12 +0000 (01:16 +0100)] 
gh-143952: Fix asyncio tools to work with the new remote debugging API (#143954)

12 days agoFix UBSan error in _testcapi: correct create_attr_from_spec signature (#143097)
Shamil [Sat, 17 Jan 2026 18:05:09 +0000 (21:05 +0300)] 
Fix UBSan error in _testcapi: correct create_attr_from_spec signature (#143097)

Co-authored-by: sobolevn <mail@sobolevn.me>
12 days ago gh-143916: Reject control characters in wsgiref.headers.Headers (GH-143917)
Seth Michael Larson [Sat, 17 Jan 2026 17:46:21 +0000 (11:46 -0600)] 
 gh-143916: Reject control characters in wsgiref.headers.Headers  (GH-143917)

* Add 'test.support' fixture for C0 control characters
* gh-143916: Reject control characters in wsgiref.headers.Headers

12 days agogh-143421: Use new buffer to save optimized uops (GH-143682)
Hai Zhu [Sat, 17 Jan 2026 15:52:16 +0000 (23:52 +0800)] 
gh-143421: Use new buffer to save  optimized uops (GH-143682)

12 days agogh-141004: Document `PyException_HEAD` and `PyDescr_COMMON` (GH-143896)
Peter Bierma [Sat, 17 Jan 2026 15:39:29 +0000 (07:39 -0800)] 
gh-141004: Document `PyException_HEAD` and `PyDescr_COMMON` (GH-143896)

12 days agogh-143946: Show `JitOptSymbol` on abstract stack when set PYTHON_OPT_DEBUG > 4 (GH...
Hai Zhu [Sat, 17 Jan 2026 15:20:35 +0000 (23:20 +0800)] 
gh-143946: Show `JitOptSymbol` on abstract stack when set PYTHON_OPT_DEBUG > 4 (GH-143957)

13 days agogh-142913: Export JIT functions for _testinternalcapi (#143958)
Ken Jin [Sat, 17 Jan 2026 13:31:38 +0000 (21:31 +0800)] 
gh-142913: Export JIT functions for _testinternalcapi (#143958)

* Export JIT functions for _testinternalcapi

* Add testinternalcapi to paths to run JIT CI on

13 days agogh-143943: add missing header file for `pycore_optimizer_types.h` (GH-143947)
Hai Zhu [Sat, 17 Jan 2026 12:26:19 +0000 (20:26 +0800)] 
gh-143943: add missing header file for `pycore_optimizer_types.h` (GH-143947)

13 days agogh-132657: Add maybe_enable_deferred_ref_count() (gh-142843)
Neil Schemenauer [Sat, 17 Jan 2026 01:54:43 +0000 (17:54 -0800)] 
gh-132657: Add maybe_enable_deferred_ref_count() (gh-142843)

If we are specializing to `LOAD_GLOBAL_MODULE` or `LOAD_ATTR_MODULE`, try
to enable deferred reference counting for the value, if the object is owned by
a different thread.  This applies to the free-threaded build only and should
improve scaling of multi-threaded programs.

13 days agogh-142913: Remove JIT interpreter for interpreter generator tests (GH-143944)
Ken Jin [Sat, 17 Jan 2026 00:34:39 +0000 (08:34 +0800)] 
gh-142913: Remove JIT interpreter for interpreter generator tests (GH-143944)

13 days agogh-138122: Default highlight to sh (#143782)
Hugo van Kemenade [Fri, 16 Jan 2026 19:40:28 +0000 (21:40 +0200)] 
gh-138122: Default highlight to sh (#143782)

13 days ago gh-142913: Update generated code that conflicted with other landed change (#143932)
Dino Viehland [Fri, 16 Jan 2026 19:10:15 +0000 (11:10 -0800)] 
 gh-142913: Update generated code that conflicted with other landed change (#143932)

Update test cases

13 days agogh-142913: Add test case for interpreter generator w/ overridden opcodes (#142911)
Dino Viehland [Fri, 16 Jan 2026 18:33:29 +0000 (10:33 -0800)] 
gh-142913: Add test case for interpreter generator w/ overridden opcodes (#142911)

Add test case for interpreter generator w/ overridden opcodes

13 days agogh-143674: Document F/D complex format characters in struct module (#143675)
Muneeb Ullah [Fri, 16 Jan 2026 17:09:56 +0000 (22:09 +0500)] 
gh-143674: Document F/D complex format characters in struct module (#143675)

Add documentation for the F (complex from two floats) and D (complex
from two doubles) format characters in the struct module docstring.
These format characters were implemented but not documented.

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
13 days agogh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570)
Serhiy Storchaka [Fri, 16 Jan 2026 16:38:38 +0000 (18:38 +0200)] 
gh-65784: Add support for parametrized resource wantobjects in regrtests (GH-143570)

This allows to run Tkinter tests with the specified value of
tkinter.wantobjects, for example "-u wantobjects=0".

13 days agogh-143572: Run 'python3-libraries' fuzzer in CI using CIFuzz (#143749)
Seth Michael Larson [Fri, 16 Jan 2026 16:09:39 +0000 (10:09 -0600)] 
gh-143572: Run 'python3-libraries' fuzzer in CI using CIFuzz (#143749)

Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <578543+webknjaz@users.noreply.github.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 weeks agogh-141070: Rename `PyUnstable_Object_Dump` to `PyObject_Dump` (GH-142848)
Peter Bierma [Fri, 16 Jan 2026 14:19:43 +0000 (09:19 -0500)] 
gh-141070: Rename `PyUnstable_Object_Dump` to `PyObject_Dump` (GH-142848)

2 weeks agogh-143672: Finish conversion of the struct module to Argument Clinic (GH-143857)
Serhiy Storchaka [Fri, 16 Jan 2026 11:35:23 +0000 (13:35 +0200)] 
gh-143672: Finish conversion of the struct module to Argument Clinic (GH-143857)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2 weeks agogh-143672: Add more tests for struct.pack_into() (GH-143901)
Serhiy Storchaka [Fri, 16 Jan 2026 11:24:43 +0000 (13:24 +0200)] 
gh-143672: Add more tests for struct.pack_into() (GH-143901)

Add tests for negative offset, out of bound offset, invalid type of offset,
non-writeable buffer, non-continuous buffer, invalid type of buffer.

Repeat all tests for struct.Struct.pack_into().

2 weeks agoGH-143493: Conform to spec for generator expressions while supporting virtual iterato...
Mark Shannon [Fri, 16 Jan 2026 09:11:58 +0000 (09:11 +0000)] 
GH-143493: Conform to spec for generator expressions while supporting virtual iterators (GH-143569)

* Moves the `GET_ITER` instruction into the generator function preamble.
  This means the the iterable is converted into an iterator during generator
  creation, as documented, but keeps it in the same code object allowing
  optimization.

2 weeks agogh-143602: Fix duplicate buffer exports in io.BytesIO.write (#143629)
zhong [Thu, 15 Jan 2026 15:08:55 +0000 (07:08 -0800)] 
gh-143602: Fix duplicate buffer exports in io.BytesIO.write (#143629)

Fix an inconsistency issue in io.BytesIO.write() where the buffer was exported
twice, which could lead to unexpected data overwrites and position drift when
the buffer changes between exports.

2 weeks agogh-142434: Use ppoll() if available in select.poll (#143529)
Victor Stinner [Thu, 15 Jan 2026 12:49:46 +0000 (13:49 +0100)] 
gh-142434: Use ppoll() if available in select.poll (#143529)

2 weeks agogh-141004: Mark up docs of old PyMem macros (GH-143783)
Petr Viktorin [Thu, 15 Jan 2026 11:37:30 +0000 (12:37 +0100)] 
gh-141004: Mark up docs of old PyMem macros (GH-143783)

These had a docs-only deprecation notice since the first version of the docs in this repo. Nowadays we call things “soft deprecated” if there's just a note in the docs.

The deprecated directive needs a version, I went with the first one that had the notice (2.0; it's not in 1.6):
- https://docs.python.org/release/2.0/api/memoryInterface.html
- https://docs.python.org/release/1.6/api/memoryInterface.html

Since PEP 445, they are now direct aliases; there are no (additional) binary compatibility concerns over the preferred names.

2 weeks agogh-80620: Fix test_time.test_gmtime() for 32-bit time_t (#143861)
Victor Stinner [Thu, 15 Jan 2026 10:54:30 +0000 (11:54 +0100)] 
gh-80620: Fix test_time.test_gmtime() for 32-bit time_t (#143861)

2 weeks agogh-80620: Support negative timestamps on windows in `time.gmtime`, `time.localtime... 143862/head
Peter Gessler [Thu, 15 Jan 2026 09:51:11 +0000 (03:51 -0600)] 
gh-80620: Support negative timestamps on windows in `time.gmtime`, `time.localtime`, and `datetime` module (#143463)

Previously, negative timestamps (representing dates before 1970-01-01) were
not supported on Windows due to platform limitations. The changes introduce a
fallback implementation using the Windows FILETIME API, allowing negative
timestamps to be correctly handled in both UTC and local time conversions.
Additionally, related test code is updated to remove Windows-specific skips
and error handling, ensuring consistent behavior across platforms.

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks agoAdd regression test for add() after remove() with hash collision in set (GH-143781)
Serhiy Storchaka [Thu, 15 Jan 2026 08:41:08 +0000 (10:41 +0200)] 
Add regression test for add() after remove() with hash collision in set (GH-143781)

2 weeks agogh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840)
Muneeb Ullah [Thu, 15 Jan 2026 08:22:01 +0000 (13:22 +0500)] 
gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding  (GH-143840)

2 weeks agogh-143635: Fix crash in `ga_repr_items_list` (#143670)
sobolevn [Thu, 15 Jan 2026 03:50:47 +0000 (06:50 +0300)] 
gh-143635: Fix crash in `ga_repr_items_list` (#143670)

2 weeks agogh-141504: Refactor policy object into a single opt_config (gh-143644)
Donghee Na [Thu, 15 Jan 2026 00:53:00 +0000 (09:53 +0900)] 
gh-141504: Refactor policy object into a single opt_config (gh-143644)

2 weeks agogh-143632: Skip unittest for mmap.set_name at musl environment (gh-143839)
Donghee Na [Thu, 15 Jan 2026 00:52:29 +0000 (09:52 +0900)] 
gh-143632: Skip unittest for mmap.set_name at musl environment (gh-143839)

2 weeks agogh-141805: Fix crash after concurrent addition objects with the same hash to set...
Serhiy Storchaka [Wed, 14 Jan 2026 21:29:17 +0000 (23:29 +0200)] 
gh-141805: Fix crash after concurrent addition objects with the same hash to set (GH-143815)

This happens when the set contained several elements with the same hash,
and then some of them were removed.

2 weeks agogh-143825: Micro-optimizations to _make_key. (gh-143844)
Raymond Hettinger [Wed, 14 Jan 2026 21:20:53 +0000 (15:20 -0600)] 
gh-143825: Micro-optimizations to _make_key. (gh-143844)

2 weeks agoGH-143842: Make optimizer color table static (GH-143846)
Mohammad Miadh Angkad [Wed, 14 Jan 2026 20:37:13 +0000 (04:37 +0800)] 
GH-143842: Make optimizer color table static (GH-143846)