]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
12 days ago[3.14] gh-142206: multiprocessing.resource_tracker: Decode messages using older proto...
Petr Viktorin [Fri, 5 Dec 2025 11:47:30 +0000 (12:47 +0100)] 
[3.14] gh-142206: multiprocessing.resource_tracker: Decode messages using older protocol (GH-142215) (GH-142285)

(cherry picked from commit 4172644d78d58189e46424af0aea302b1d78e2de)

Difference from the original commit: the default in 3.14 is to use
the simpler original protocol (except for filenames with newlines).

Co-authored-by: Petr Viktorin <encukou@gmail.com>
12 days ago[3.14] gh-142214: Fix two regressions in dataclasses (GH-142223) (#142277)
Miss Islington (bot) [Fri, 5 Dec 2025 08:08:15 +0000 (09:08 +0100)] 
[3.14] gh-142214: Fix two regressions in dataclasses (GH-142223) (#142277)

gh-142214: Fix two regressions in dataclasses (GH-142223)
(cherry picked from commit 53ec7c8fc07eb6958869638a0cad70c52ad6fcf5)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
13 days ago[3.14] gh-116738: Statically initialize special constants in cmath module (gh-142161...
Miss Islington (bot) [Thu, 4 Dec 2025 14:51:55 +0000 (15:51 +0100)] 
[3.14] gh-116738: Statically initialize special constants in cmath module (gh-142161) (gh-142261)

The initialization during `mod_exec` wasn't thread-safe with multiple interpreters.
(cherry picked from commit 2dac9e6016c81abbefa4256253ff5c59b29378a7)

Co-authored-by: Alper <alperyoney@fb.com>
13 days ago[3.14] gh-129483: Make `TestLocalTimeDisambiguation`'s time format locale independent...
Miss Islington (bot) [Thu, 4 Dec 2025 14:03:36 +0000 (15:03 +0100)] 
[3.14] gh-129483: Make `TestLocalTimeDisambiguation`'s time format locale independent (GH-142193) (#142258)

gh-129483: Make `TestLocalTimeDisambiguation`'s time format locale independent (GH-142193)

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

---------
(cherry picked from commit 8392095bf969655faf785dd0932c3f02fc4ec311)

Co-authored-by: Kir Chou <148194051+gkirchou@users.noreply.github.com>
Co-authored-by: Kir Chou <note351@hotmail.com>
13 days ago[3.14] gh-141004: Add a CI job ensuring that new C APIs include documentation (GH...
Peter Bierma [Thu, 4 Dec 2025 13:07:39 +0000 (08:07 -0500)] 
[3.14] gh-141004: Add a CI job ensuring that new C APIs include documentation (GH-142102) (GH-142247)

* 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>
(cherry picked from commit 1a7824a927f0706300af7bfc182884a43e2f587a)

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
13 days ago[3.14] gh-135676: Reword the f-string (and t-string) section (GH-137469) (GH-142227)
Miss Islington (bot) [Thu, 4 Dec 2025 10:53:12 +0000 (11:53 +0100)] 
[3.14] gh-135676: Reword the f-string (and t-string) section (GH-137469) (GH-142227)

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.
(cherry picked from commit aea5531583aaa8bfdf3ebca914e9c694617c3489)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
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>
13 days ago[3.14] Being more flexible in when not to explicitly set the sysroot when compiling...
Miss Islington (bot) [Thu, 4 Dec 2025 00:16:37 +0000 (01:16 +0100)] 
[3.14] Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242) (GH-142246)

Being more flexible in when not to explicitly set the sysroot when compiling for WASI (GH-142242)
(cherry picked from commit c5252045d3a7164f1829503d122091b5e469fda3)

Co-authored-by: Brett Cannon <brett@python.org>
13 days ago[3.14] gh-142218: Fix split table dictionary crash (gh-142229) (gh-142244)
Miss Islington (bot) [Thu, 4 Dec 2025 00:03:18 +0000 (01:03 +0100)] 
[3.14] gh-142218: Fix split table dictionary crash (gh-142229) (gh-142244)

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.
(cherry picked from commit 547d8daf780646e2800bec598ed32085817c8606)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2 weeks ago[3.14] gh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146...
Miss Islington (bot) [Wed, 3 Dec 2025 19:09:44 +0000 (20:09 +0100)] 
[3.14] gh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146) (#142209)

gh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146)

* Remove quadratic behavior in node ID cache clearing

* Add news fragment

---------
(cherry picked from commit 08d8e18ad81cd45bc4a27d6da478b51ea49486e4)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>
2 weeks ago[3.14] gh-135676: Simplify docs on lexing names (GH-140464) (GH-142015)
Stan Ulbrych [Wed, 3 Dec 2025 12:43:06 +0000 (12:43 +0000)] 
[3.14] gh-135676: Simplify docs on lexing names (GH-140464) (GH-142015)

This simplifies the Lexical Analysis section on Names (but keeps it technically correct) by putting all the info about non-ASCII characters in a separate (and very technical) section.

It uses a mental model where the parser doesn't handle Unicode complexity “immediately”, but:

- parses any non-ASCII character (outside strings/comments) as part of a name, since these can't (yet) be e.g. operators
- normalizes the name
- validates the name, using the xid_start/xid_continue sets

(cherry picked from commit 2ff8608b4da33f667960e5099a1a442197acaea4)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Micha Albert <info@micha.zone>
Co-authored-by: KeithTheEE <kmurrayis@gmail.com>
2 weeks agoPost 3.14.1
Hugo van Kemenade [Tue, 2 Dec 2025 16:16:07 +0000 (18:16 +0200)] 
Post 3.14.1

2 weeks agoPython 3.14.1 v3.14.1
Hugo van Kemenade [Tue, 2 Dec 2025 12:51:18 +0000 (14:51 +0200)] 
Python 3.14.1

2 weeks ago[3.14] Revert "gh-119452: Fix a potential virtual memory allocation denial of service...
Hugo van Kemenade [Tue, 2 Dec 2025 12:06:25 +0000 (14:06 +0200)] 
[3.14] Revert "gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-119455)" (#142184)

Fix a potential virtual memory allocation denial of service in http.server (GH-119455)"

2 weeks ago[3.14] Document None for timeout argument of select.select (GH-142177) (#142182)
Petr Viktorin [Tue, 2 Dec 2025 11:45:07 +0000 (12:45 +0100)] 
[3.14] Document None for timeout argument of select.select (GH-142177) (#142182)

2 weeks ago[3.14] gh-140281: Update free threading Python HOWTO for 3.14 (gh-140566) (gh-142173)
Miss Islington (bot) [Tue, 2 Dec 2025 06:06:15 +0000 (07:06 +0100)] 
[3.14] gh-140281: Update free threading Python HOWTO for 3.14 (gh-140566) (gh-142173)

(cherry picked from commit 2dc28eb8b0956f3ebc8ec9cedcb614fb7516e120)

Co-authored-by: Krishna-web-hub <masterkiran27@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
2 weeks ago[3.14] gh-59000: Fix pdb breakpoint resolution for class methods when module not...
Miss Islington (bot) [Tue, 2 Dec 2025 05:06:26 +0000 (06:06 +0100)] 
[3.14] gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949) (#142171)

gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949)
(cherry picked from commit 5e58548ebe8f7ac8c6cb0bad775912caa4090515)

Co-authored-by: LloydZ <35182391+cocolato@users.noreply.github.com>
2 weeks ago[3.14] gh-142048: Fix quadratically increasing GC delays (gh-142051) (gh-142166)
Miss Islington (bot) [Tue, 2 Dec 2025 00:30:11 +0000 (01:30 +0100)] 
[3.14] gh-142048: Fix quadratically increasing GC delays (gh-142051) (gh-142166)

The GC for the free threaded build would get slower with each collection due
to effectively double counting objects freed by the GC.
(cherry picked from commit eb892868b31322d7cf271bc25923e14b1f67ae38)

Co-authored-by: Kevin Wang <kevmo314@gmail.com>
2 weeks ago[3.14] Revert "GH-91636: Clear weakrefs created by finalizers. (GH-136401) (#141993...
Hugo van Kemenade [Mon, 1 Dec 2025 18:34:37 +0000 (20:34 +0200)] 
[3.14] Revert "GH-91636: Clear weakrefs created by finalizers. (GH-136401) (#141993)" (#142152)

2 weeks ago[3.14] gh-119451: Fix a potential denial of service in http.client (GH-119454) (...
Miss Islington (bot) [Mon, 1 Dec 2025 18:34:09 +0000 (19:34 +0100)] 
[3.14] gh-119451: Fix a potential denial of service in http.client (GH-119454) (#142138)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.14] gh-141930: Use the regular IO stack to write .pyc files for a better error...
Miss Islington (bot) [Mon, 1 Dec 2025 16:43:50 +0000 (17:43 +0100)] 
[3.14] gh-141930: Use the regular IO stack to write .pyc files for a better error message on failure (GH-141931) (#142021)

Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2 weeks ago[3.14] gh-141004: Document descriptor and dict proxy type objects (GH-141803) (GH142147)
Miss Islington (bot) [Mon, 1 Dec 2025 15:57:31 +0000 (16:57 +0100)] 
[3.14] gh-141004: Document descriptor and dict proxy type objects (GH-141803) (GH142147)

gh-141004: Document descriptor and dict proxy type objects (GH-141803)
(cherry picked from commit 52f9b5f580b6b85dbf08fa23103d17a60455bc20)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] gh-119342: Fix a potential denial of service in plistlib (GH-119343) (GH-142143)
Miss Islington (bot) [Mon, 1 Dec 2025 15:54:58 +0000 (16:54 +0100)] 
[3.14] gh-119342: Fix a potential denial of service in plistlib (GH-119343) (GH-142143)

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.
(cherry picked from commit 694922cf40aa3a28f898b5f5ee08b71b4922df70)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 weeks ago[3.14] gh-119452: Fix a potential virtual memory allocation denial of service in...
Serhiy Storchaka [Mon, 1 Dec 2025 12:59:09 +0000 (14:59 +0200)] 
[3.14] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-119455)

The CGI server on Windows could consume the amount of memory specified
in the Content-Length header of the request even if the client does not
send such much data. Now it reads the POST request body by chunks,
so that the memory consumption is proportional to the amount of sent
data.

2 weeks ago[3.14] Docs: Upgrade Sphinx to 9.0 (GH-142114) (#142128)
Miss Islington (bot) [Mon, 1 Dec 2025 11:22:05 +0000 (12:22 +0100)] 
[3.14] Docs: Upgrade Sphinx to 9.0 (GH-142114) (#142128)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 weeks ago[3.14] gh-141473: Document not calling Popen.wait after Popen.communicate times out...
Miss Islington (bot) [Mon, 1 Dec 2025 02:55:28 +0000 (03:55 +0100)] 
[3.14] gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH-142101) (#142124)

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 GH-141473
(cherry picked from commit 3e2c55749326809a2fc76b9f2cb87a6f89037ebe)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2 weeks ago[3.14] gh-142066: Fix grammar in multiprocessing Pipes and Queues (GH-142121) (#142122)
Miss Islington (bot) [Mon, 1 Dec 2025 02:19:48 +0000 (03:19 +0100)] 
[3.14] gh-142066: Fix grammar in multiprocessing Pipes and Queues (GH-142121) (#142122)

gh-142066: Fix grammar in multiprocessing Pipes and Queues (GH-142121)
(cherry picked from commit 981ce0cf3af68cd8eee41fed19969cf0f2218572)

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

Co-authored-by: Tadej Magajna <tmagajna@gmail.com>
2 weeks ago[3.14] gh-142067: Add missing default value for param in `multiprocessing.Pipe`'s...
Miss Islington (bot) [Sun, 30 Nov 2025 21:15:39 +0000 (22:15 +0100)] 
[3.14] gh-142067: Add missing default value for param in `multiprocessing.Pipe`'s doc (GH-142109) (#142120)

gh-142067: Add missing default value for param in `multiprocessing.Pipe`'s doc (GH-142109)
(cherry picked from commit 229ed3dd1f97b2f87629a240b90eddba5ded67bf)

Co-authored-by: flovent <flbven@protonmail.com>
2 weeks ago[3.14] gh-133146: Add the old public `get_value` method to documentation and refactor...
Hugo van Kemenade [Sun, 30 Nov 2025 21:06:56 +0000 (23:06 +0200)] 
[3.14] gh-133146: Add the old public `get_value` method to documentation and refactor code. (GH-133301) (#142110)

also uses it within the internals in a few places.
(cherry picked from commit db098a475a47b16d25c88d95dbcf0c6572c68576)

Co-authored-by: Duprat <yduprat@gmail.com>
2 weeks ago[3.14] Improve clarity in tutorial introduction (GH-140669) (#142112)
Miss Islington (bot) [Sun, 30 Nov 2025 12:53:05 +0000 (13:53 +0100)] 
[3.14] Improve clarity in tutorial introduction (GH-140669) (#142112)

Co-authored-by: Thierry Martos <81799048+ThierryMT@users.noreply.github.com>
2 weeks ago[3.14] gh-140373: Correctly emit `PY_UNWIND` event when generator is closed (GH-14076...
Miss Islington (bot) [Sun, 30 Nov 2025 12:35:14 +0000 (13:35 +0100)] 
[3.14] gh-140373: Correctly emit `PY_UNWIND` event when generator is closed (GH-140767) (#140816)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2 weeks ago[3.14] gh-139741: Make `dist-pdf` docs archive build work for macOS (GH-140837) ...
Miss Islington (bot) [Sun, 30 Nov 2025 12:34:12 +0000 (13:34 +0100)] 
[3.14] gh-139741: Make `dist-pdf` docs archive build work for macOS (GH-140837) (#141229)

Co-authored-by: Naitree Zhu <Naitreey@gmail.com>
2 weeks ago[3.14] gh-140042: Removing unsafe call to sqlite3_shutdown (GH-141690) (#141793)
Miss Islington (bot) [Sun, 30 Nov 2025 12:32:11 +0000 (13:32 +0100)] 
[3.14] gh-140042: Removing unsafe call to sqlite3_shutdown (GH-141690) (#141793)

Co-authored-by: Prithviraj Chaudhuri <p.chaudhuri1993@gmail.com>
2 weeks ago[3.14] gh-136063: fix quadratic-complexity parsing in `email.message._parseparam...
Miss Islington (bot) [Sun, 30 Nov 2025 12:30:56 +0000 (13:30 +0100)] 
[3.14] gh-136063: fix quadratic-complexity parsing in `email.message._parseparam` (GH-136072) (#140827)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2 weeks ago[3.14] gh-132795: Add docs for `multiprocessing.Semaphore.locked` (GH-133299) (#142111)
Miss Islington (bot) [Sun, 30 Nov 2025 12:19:30 +0000 (13:19 +0100)] 
[3.14] gh-132795: Add docs for `multiprocessing.Semaphore.locked` (GH-133299) (#142111)

Co-authored-by: Duprat <yduprat@gmail.com>
2 weeks ago[3.14] GH-141808: Do not generate the jit stencils twice in case of PGO builds on...
Miss Islington (bot) [Sat, 29 Nov 2025 21:09:19 +0000 (22:09 +0100)] 
[3.14] GH-141808: Do not generate the jit stencils twice in case of PGO builds on Windows. (GH-142043) (#142100)

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
(cherry picked from commit f2ca1581cab2da45880198af1c924dd40ec8a10b)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2 weeks ago[3.14] Docs: Prepare for Sphinx 9 (GH-142057) (#142091)
Miss Islington (bot) [Sat, 29 Nov 2025 15:15:25 +0000 (16:15 +0100)] 
[3.14] Docs: Prepare for Sphinx 9 (GH-142057) (#142091)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 weeks ago[3.14] GH-121970: Remove Docutils list monkeypatch (GH-142056) (#142088)
Miss Islington (bot) [Sat, 29 Nov 2025 14:56:29 +0000 (15:56 +0100)] 
[3.14] GH-121970: Remove Docutils list monkeypatch (GH-142056) (#142088)

2 weeks ago[3.14] GH-91636: Clear weakrefs created by finalizers. (GH-136401) (#141993)
Miss Islington (bot) [Sat, 29 Nov 2025 07:34:36 +0000 (08:34 +0100)] 
[3.14] GH-91636: Clear weakrefs created by finalizers. (GH-136401) (#141993)

GH-91636: Clear weakrefs created by finalizers. (GH-136401)

Weakrefs to unreachable garbage that are created during running of
finalizers need to be cleared.  This avoids exposing objects that
have `tp_clear` called on them to Python-level code.
(cherry picked from commit b6b99bf7f1edab77c485faf4e23da868f3a7b68c)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2 weeks ago[3.14] gh-140011: Delete importdl assertion that prevents importing embedded modules...
Itamar Oren [Sat, 29 Nov 2025 07:30:57 +0000 (23:30 -0800)] 
[3.14] gh-140011: Delete importdl assertion that prevents importing embedded modules from packages (GH-141605) (#141986)

gh-140011: Delete importdl assertion that prevents importing embedded modules from packages (GH-141605)

(cherry picked from commit 27f62eb711720c215f9798ae30728ee5a1b4d442)

2 weeks ago[3.14] GH-141963: Clarify argparse documentation (GH-141964) (#142076)
Miss Islington (bot) [Sat, 29 Nov 2025 07:28:50 +0000 (08:28 +0100)] 
[3.14] GH-141963: Clarify argparse documentation (GH-141964) (#142076)

GH-141963: Clarify argparse documentation (GH-141964)

Clarify argparse documentation

Tightens the phrasing for several argparse actions.
(cherry picked from commit cfcd52490d6531f3b0e8ddd4bb2b40fb6baee854)

Co-authored-by: Moshe Kaplan <mosheekaplan@gmail.com>
2 weeks ago[3.14] Fix multiprocessing queue test_get() (GH-142024) (#142070)
Miss Islington (bot) [Sat, 29 Nov 2025 07:25:46 +0000 (08:25 +0100)] 
[3.14] Fix multiprocessing queue test_get() (GH-142024) (#142070)

Fix multiprocessing queue test_get() (GH-142024)

* Replace sleep() with support.sleeping_retry().
* Test get_nowait() first.
* Restore previously disabled test.

Fix the failure:

FAIL: test_get (test.test_multiprocessing_spawn.test_processes.WithProcessesTestQueue.test_get)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/_test_multiprocessing.py", line 1208, in test_get
    self.assertEqual(queue_empty(queue), False)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: True != False
(cherry picked from commit 5e749d3743621be4c8bf5618ed3249e9fde9a599)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] Docs: multi-disk ZIP files -> multipart ZIP files (GH-141962) (#142074)
Miss Islington (bot) [Sat, 29 Nov 2025 07:17:39 +0000 (08:17 +0100)] 
[3.14] Docs: multi-disk ZIP files -> multipart ZIP files (GH-141962) (#142074)

Docs: multi-disk ZIP files -> multipart ZIP files (GH-141962)

* Remove some old currentlies
* multi-disk -> multipart
* Sentence case headings
(cherry picked from commit 890fe5aad55d4f28cda56834f9457ff79e9e8c60)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 weeks ago[3.14] gh-141994: Warn of XXE vulnerability in documentation of SAX feature `xml...
Miss Islington (bot) [Sat, 29 Nov 2025 07:14:02 +0000 (08:14 +0100)] 
[3.14] gh-141994: Warn of XXE vulnerability in documentation of SAX feature `xml.sax.handler.feature_external_ges` (GH-141996) (#142072)

gh-141994: Warn of XXE vulnerability in documentation of SAX feature `xml.sax.handler.feature_external_ges` (GH-141996)

Doc/library/xml.sax.handler.rst: Warn of XXE with feature_external_ges

Related to commit baa9f338971c6a13433a8232db77cd45e6b87b77
(cherry picked from commit 440bcb94560937888cd9bcb28a138acc2c6a6cbc)

Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
2 weeks ago[3.14] gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush...
Miss Islington (bot) [Sat, 29 Nov 2025 07:03:05 +0000 (08:03 +0100)] 
[3.14] gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush error when closed (GH-142061) (#142064)

gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush error when closed (GH-142061)

gh-70560: gh-74389: subprocess.Popen.communicate() now ignores stdin.flush error when closed

with a unittest and news entry.
(cherry picked from commit 923056b2d41c4c28ad9163901053cd3824d775c5)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2 weeks ago[3.14] gh-87512: Fix `subprocess` using `timeout=` on Windows blocking with a large...
Miss Islington (bot) [Sat, 29 Nov 2025 06:47:04 +0000 (07:47 +0100)] 
[3.14] gh-87512: Fix `subprocess` using `timeout=` on Windows blocking with a large `input=` (GH-142058) (#142068)

gh-87512: Fix `subprocess` using `timeout=` on Windows blocking with a large `input=` (GH-142058)

On Windows, Popen._communicate() previously wrote to stdin synchronously, which could block indefinitely if the subprocess didn't consume input= quickly and the pipe buffer filled up. The timeout= parameter was only checked when joining the reader threads, not during the stdin write.

This change moves the Windows stdin writing to a background thread (similar to how stdout/stderr are read in threads), allowing the timeout to be properly enforced. If timeout expires, TimeoutExpired is raised promptly and the writer thread continues in the background. Subsequent calls to communicate() will join the existing writer thread.

Adds test_communicate_timeout_large_input to verify that TimeoutExpired is raised promptly when communicate() is called with large input and a timeout, even when the subprocess doesn't consume stdin quickly.

This test already passed on POSIX (where select() is used) but failed on Windows where the stdin write blocks without checking the timeout.
(cherry picked from commit 5b1862bdd8021b5295df95d730c2d2efa827fa88)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2 weeks ago[3.14] gh-141473: Fix subprocess.Popen.communicate to send input to stdin upon a...
Miss Islington (bot) [Sat, 29 Nov 2025 06:21:43 +0000 (07:21 +0100)] 
[3.14] gh-141473: Fix subprocess.Popen.communicate to send input to stdin upon a subsequent post-timeout call (GH-141477) (#142059)

gh-141473: Fix subprocess.Popen.communicate to send input to stdin upon a subsequent post-timeout call (GH-141477)

* gh-141473: Fix subprocess.Popen.communicate to send input to stdin
* Docs: Clarify that `input` is one time only on `communicate()`
* NEWS entry
* Add a regression test.

---------
(cherry picked from commit 526d7a8bb47bd8ff58c829c30384cd70cc5d0747)

Co-authored-by: Artur Jamro <artur.jamro@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 weeks ago[3.14] GH-134453: Fix subprocess memoryview input handling on POSIX (GH-134949) ...
Miss Islington (bot) [Sat, 29 Nov 2025 04:52:14 +0000 (05:52 +0100)] 
[3.14] GH-134453: Fix subprocess memoryview input handling on POSIX (GH-134949) (#142062)

GH-134453: Fix subprocess memoryview input handling on POSIX (GH-134949)

Fix inconsistent subprocess.Popen.communicate() behavior between Windows
and POSIX when using memoryview objects with non-byte elements as input.

On POSIX systems, the code was incorrectly comparing bytes written against
element count instead of byte count, causing data truncation for large
inputs with non-byte element types.

Changes:
- Cast memoryview inputs to byte view when input is already a memoryview
- Fix progress tracking to use len(input_view) instead of len(self._input)
- Add comprehensive test coverage for memoryview inputs

🤖 Generated with [Claude Code](https://claude.ai/code)

* old-man-yells-at-ReST
* Update 2025-05-30-18-37-44.gh-issue-134453.kxkA-o.rst
* assertIsNone review feedback
* fix memoryview_nonbytes test to fail without our fix on main, and have a nicer error.

Thanks to Peter Bierma @ZeroIntensity for the code review.
(cherry picked from commit cc6bc4c97f7be5b401a91119ba603e6c1a07c99b)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2 weeks ago[3.14] gh-116008: Detect freed thread state in faulthandler (GH-141988) (#142013)
Miss Islington (bot) [Thu, 27 Nov 2025 20:34:00 +0000 (21:34 +0100)] 
[3.14] gh-116008: Detect freed thread state in faulthandler (GH-141988) (#142013)

gh-116008: Detect freed thread state in faulthandler (GH-141988)

Add _PyMem_IsULongFreed() function.
(cherry picked from commit d5d9e89dde9843a61b46872b1914c5b75ad05998)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 weeks ago[3.14] gh-98896: resource_tracker: use json&base64 to allow arbitrary shared memory...
Stan Ulbrych [Thu, 27 Nov 2025 12:17:39 +0000 (12:17 +0000)] 
[3.14] gh-98896: resource_tracker: use json&base64 to allow arbitrary shared memory names (GH-138473) (GH-141922)

Co-authored-by: Rani Pinchuk <33353578+rani-pinchuk@users.noreply.github.com>
2 weeks ago[3.14] gh-125434: Display thread name in faulthandler on Windows (#142011)
Victor Stinner [Thu, 27 Nov 2025 12:05:37 +0000 (13:05 +0100)] 
[3.14] gh-125434: Display thread name in faulthandler on Windows (#142011)

* gh-125434: Display thread name in faulthandler on Windows (#140675)

(cherry picked from commit 313145eab5f6ebca21d2e3c80c130980d3bcdc88)

* gh-125434: Fix non-ASCII thread names in faulthandler on Windows (#140700)

Add _Py_DumpWideString() function to dump a wide string as ASCII. It
supports surrogate pairs.

Replace _Py_EncodeLocaleRaw() with _Py_DumpWideString()
in write_thread_name().

(cherry picked from commit 80f20f58b2b8368ed8451a0161036dda94d8d33a)

3 weeks ago[3.14] gh-116738: Fix thread-safety issue in re module for free threading (gh-141923...
Miss Islington (bot) [Wed, 26 Nov 2025 21:08:39 +0000 (22:08 +0100)] 
[3.14] gh-116738: Fix thread-safety issue in re module for free threading (gh-141923) (gh-141990)

Added atomic operations to `scanner_begin()` and `scanner_end()` to prevent
race conditions on the `executing` flag in free-threaded builds. Also added
tests for concurrent usage of the `re` module.

Without the atomic operations, `test_scanner_concurrent_access()` triggers
`assert(self->executing)` failures, or a thread sanitizer run emits errors.
(cherry picked from commit bc9e63dd9d2931771415cca1b0ed774471d523c0)

Co-authored-by: Alper <alperyoney@fb.com>
3 weeks ago[3.14] gh-141909: Add `PyModuleDef_Slot` and earlier Py_mod_* constants to stable...
Petr Viktorin [Wed, 26 Nov 2025 14:35:04 +0000 (15:35 +0100)] 
[3.14] gh-141909: Add `PyModuleDef_Slot` and earlier Py_mod_* constants to stable ABI manifest (#141910) (GH-141978)

These were added to the limited API in 3.5-3.13.
Not including them in `Misc/stable_abi.toml` was a bug.

(cherry picked from commit 202fce0dbde1da32d8abc2eb59ddfce6f6a3c9fa)

3 weeks ago[3.14] GH-139653: Only raise an exception (or fatal error) when the stack pointer...
Petr Viktorin [Wed, 26 Nov 2025 11:54:56 +0000 (12:54 +0100)] 
[3.14] GH-139653: Only raise an exception (or fatal error) when the stack pointer is about to overflow the stack. (GH-141711) (GH-141944)

Only raises if the stack pointer is both below the limit *and* above the stack base.
This prevents false positives for user-space threads, as the stack pointer will be outside those bounds
if the stack has been swapped.

Cherry-picked from commit c25a070759952b13f97ecc37ca2991c2669aee47

Co-authored-by: Mark Shannon <mark@hotpy.org>
3 weeks ago[3.14] gh-141004: Document missing `PyThread*` APIs (GH-141810) (GH-141954)
Miss Islington (bot) [Tue, 25 Nov 2025 17:58:44 +0000 (18:58 +0100)] 
[3.14] gh-141004: Document missing `PyThread*` APIs (GH-141810) (GH-141954)

gh-141004: Document missing `PyThread*` APIs (GH-141810)
(cherry picked from commit a89ee4b9c2a87d9bdf105883f834cda9d943d541)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-140911: Ensure that UserString.index() and UserString.rindex() accept UserS...
Miss Islington (bot) [Tue, 25 Nov 2025 13:56:05 +0000 (14:56 +0100)] 
[3.14] gh-140911: Ensure that UserString.index() and UserString.rindex() accept UserString as argument (GH-140945) (GH-141946)

(cherry picked from commit e6174ee9812f514b42ab6d3a1064bd6057de96c7)

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
3 weeks ago[3.14] gh-141004: Document `PyOS_mystr(n)icmp` (GH-141760) (#141947)
Miss Islington (bot) [Tue, 25 Nov 2025 13:51:02 +0000 (14:51 +0100)] 
[3.14] gh-141004: Document `PyOS_mystr(n)icmp` (GH-141760) (#141947)

gh-141004: Document `PyOS_mystr(n)icmp` (GH-141760)
(cherry picked from commit f445c452ea879e01b4144809a5fd8826ac98f305)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
3 weeks ago[3.14] gh-139653: Add PyUnstable_ThreadState_SetStackProtection() (GH-139668) (...
Petr Viktorin [Tue, 25 Nov 2025 13:21:53 +0000 (14:21 +0100)] 
[3.14] gh-139653: Add PyUnstable_ThreadState_SetStackProtection() (GH-139668)  (#141661)

Co-authored-by: Rok Mandeljc <rok.mandeljc@gmail.com>
Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-138199: Address potential confusion re: threading (GH-138200) (GH-141928)
Alexander Nordin [Tue, 25 Nov 2025 11:52:47 +0000 (03:52 -0800)] 
[3.14] gh-138199: Address potential confusion re: threading (GH-138200) (GH-141928)

gh-138199: Address potential confusion regarding threading in the `asyncio` HOWTO (GH-138200)

(cherry picked from commit a4f422521337d3310b71bb081c195e64c2035bbb)

3 weeks ago[3.14] gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908) (#141918)
Miss Islington (bot) [Tue, 25 Nov 2025 01:20:35 +0000 (02:20 +0100)] 
[3.14] gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908) (#141918)

gh-141907: Better handle support for SHA3 for test_hashlib (GH-141908)

* test_hashlib: better handle support for SHA3

It's possible that the SSL library supports only SHA3 algo and doesn't
have SHAKE one.

The current test wrongly detect this and set both HASH and HASHXOF to
None expecting to have the extra SHA3 attributes present but this should
only be true for SHAKE algo.

To better handle this, move the HASH condition to a dedicated try-expect
condition and check if HASHXOF is None in the relevant code effectively
checking if SHA3 is supported by the SSL library but SHAKE algo needs to
use the sha3module one.

---------
(cherry picked from commit fee778265064c290ae1852916ff47fcc0ab4a29d)

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Co-authored-by: Christian Marangi <ansuelsmth@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
3 weeks ago[3.14] Fix implicit import in `test_monitoring.py` (gh-141795) (gh-141920)
Miss Islington (bot) [Mon, 24 Nov 2025 20:19:20 +0000 (21:19 +0100)] 
[3.14] Fix implicit import in `test_monitoring.py` (gh-141795) (gh-141920)

(cherry picked from commit 369ce2b139a5b76c9c093cba1cee287cb6ffeec1)

Co-authored-by: SubbaraoGarlapati <53627478+SubbaraoGarlapati@users.noreply.github.com>
3 weeks ago[3.14] gh-141004: Document stack effect C APIs (GH-141843) (GH-141916)
Miss Islington (bot) [Mon, 24 Nov 2025 17:24:41 +0000 (18:24 +0100)] 
[3.14] gh-141004: Document stack effect C APIs (GH-141843) (GH-141916)

gh-141004: Document stack effect C APIs (GH-141843)
(cherry picked from commit e1f1df4082e2bc6cdb46be9984124c88a7b2ff0f)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-141004: Document `PyImport_Inittab` (GH-141844) (GH-141915)
Miss Islington (bot) [Mon, 24 Nov 2025 17:16:31 +0000 (18:16 +0100)] 
[3.14] gh-141004: Document `PyImport_Inittab` (GH-141844) (GH-141915)

gh-141004: Document `PyImport_Inittab` (GH-141844)
(cherry picked from commit 5f35702bb641230131c400500bb8bbacde7465b2)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-129441: Fix some flakiness in test_instrumentation (gh-141881) (gh-141913)
Miss Islington (bot) [Mon, 24 Nov 2025 16:44:54 +0000 (17:44 +0100)] 
[3.14] gh-129441: Fix some flakiness in test_instrumentation (gh-141881) (gh-141913)

Most of the `self.assertTrue(self.called)` checks are flaky because
the worker threads may sometimes finish before the main thread calls
`self.during_threads()`.
(cherry picked from commit 71126ab19c76d8227fc3b9c7c59b957ca82af4dd)

Co-authored-by: Sam Gross <colesbury@gmail.com>
3 weeks ago[3.14] gh-116749: Fix code comment for _PyConfig_GIL_DEFAULT (gh-141804) (gh-141911)
Miss Islington (bot) [Mon, 24 Nov 2025 16:10:59 +0000 (17:10 +0100)] 
[3.14] gh-116749: Fix code comment for _PyConfig_GIL_DEFAULT (gh-141804) (gh-141911)

(cherry picked from commit c490ffb7ac43e7132f866103cefd872afa067a6a)

Co-authored-by: Sam Gross <colesbury@gmail.com>
3 weeks ago[3.14] gh-106318: Add examples for str.join() (GH-140315) (#141906)
Miss Islington (bot) [Mon, 24 Nov 2025 14:59:22 +0000 (15:59 +0100)] 
[3.14] gh-106318: Add examples for str.join() (GH-140315) (#141906)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
3 weeks ago[3.14] gh-106318: Add example for str.format() (GH-137018) (#141904)
Miss Islington (bot) [Mon, 24 Nov 2025 14:56:59 +0000 (15:56 +0100)] 
[3.14] gh-106318: Add example for str.format() (GH-137018) (#141904)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
3 weeks ago[3.14] gh-106318: Add example for str.isalpha() (GH-137557) (#141901)
Hugo van Kemenade [Mon, 24 Nov 2025 14:28:49 +0000 (16:28 +0200)] 
[3.14] gh-106318: Add example for str.isalpha() (GH-137557) (#141901)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-106318: Add example for str.isascii() (GH-137558) (#141898)
Miss Islington (bot) [Mon, 24 Nov 2025 14:07:58 +0000 (15:07 +0100)] 
[3.14] gh-106318: Add example for str.isascii() (GH-137558) (#141898)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
3 weeks ago[3.14] gh-141004: Document `Py_ARRAY_LENGTH` (GH-141601) (GH-141895)
Miss Islington (bot) [Mon, 24 Nov 2025 13:40:01 +0000 (14:40 +0100)] 
[3.14] gh-141004: Document `Py_ARRAY_LENGTH` (GH-141601) (GH-141895)

gh-141004: Document `Py_ARRAY_LENGTH` (GH-141601)
(cherry picked from commit e0773eacb7e660b4fd6bd702b0a119e25ab3b012)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
3 weeks ago[3.14] gh-106318: Add example for str.isdecimal() (GH-137559) (#141893)
Miss Islington (bot) [Mon, 24 Nov 2025 13:20:02 +0000 (14:20 +0100)] 
[3.14] gh-106318: Add example for str.isdecimal() (GH-137559) (#141893)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
3 weeks ago[3.14] gh-135335: Simplify preload regression test using __main__ (GH-138686) (#141886)
Miss Islington (bot) [Mon, 24 Nov 2025 03:09:34 +0000 (04:09 +0100)] 
[3.14] gh-135335: Simplify preload regression test using __main__ (GH-138686) (#141886)

gh-135335: Simplify preload regression test using __main__ (GH-138686)

Simplify preload regression test using `__main__`

With the fix for gh-126631 `__main__` modules can be preloaded and the regression
test for gh-135335 can be simplified to just use a self-contained script rather
than requiring a module.

Note this assumes and implicitly tests that `__main__` is preloaded by default.
(cherry picked from commit 425f24e4fad672c211307a9f0018c8d39c4db9de)

Co-authored-by: Duane Griffin <duaneg@dghda.com>
3 weeks ago[3.14] GH-139914: Handle stack growth direction on HPPA (GH-140028) (#141404)
Stefano Rivera [Sun, 23 Nov 2025 23:55:33 +0000 (15:55 -0800)] 
[3.14] GH-139914: Handle stack growth direction on HPPA (GH-140028) (#141404)

* [3.14] GH-139914: Handle stack growth direction on HPPA (GH-140028)

Adapted from a patch for Python 3.14 submitted to the Debian BTS by John David Anglin https://bugs.debian.org/1105111#20

* Forgot to update test_call

* WTF typo

3 weeks ago[3.14] gh-141865: Fix translation of strings in `changes.py` extension (GH-141882...
Miss Islington (bot) [Sun, 23 Nov 2025 17:34:01 +0000 (18:34 +0100)] 
[3.14] gh-141865: Fix translation of strings in `changes.py` extension (GH-141882) (#141883)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
3 weeks ago[3.14] gh-120158: Fix inconsistent monitoring state when setting events too frequentl...
Miss Islington (bot) [Sun, 23 Nov 2025 15:31:56 +0000 (16:31 +0100)] 
[3.14] gh-120158: Fix inconsistent monitoring state when setting events too frequently (gh-141845) (gh-141879)

If we overflowed the global version counter (i.e., after 2*24 calls to
`_PyMonitoring_SetEvents`), we bailed out after setting global monitoring
events but before instrumenting code objects, which led to assertion errors
later on.

Also add a `time.sleep()` to `test_free_threading.test_monitoring` to avoid
overflowing the global version counter.
(cherry picked from commit e457d60daafe66534283e0f79c81517634408e57)

Co-authored-by: Sam Gross <colesbury@gmail.com>
3 weeks ago[3.14] gh-98552: Revert (unneeded, already done elsewhere) "flush std streams in...
Miss Islington (bot) [Sun, 23 Nov 2025 10:17:20 +0000 (11:17 +0100)] 
[3.14] gh-98552: Revert (unneeded, already done elsewhere) "flush std streams in the multiprocessing forkserver before fork (GH-141849)" (GH-141871) (#141872)

gh-98552: Revert (unneeded, already done elsewhere) "flush std streams in the multiprocessing forkserver before fork (GH-141849)" (GH-141871)

Revert (unneeded, already done elsewhere) "gh-98552: flush std streams in the multiprocessing forkserver before fork (GH-141849)"

This reverts commit 58badb1711e12b6e8b5240ab96cdd01b95012de7.
(cherry picked from commit 614a28b3da1c898f29c34c14f59bf2d496dbd31d)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
3 weeks ago[3.14] gh-98552: flush std streams in the multiprocessing forkserver before fork...
Miss Islington (bot) [Sat, 22 Nov 2025 20:23:22 +0000 (21:23 +0100)] 
[3.14] gh-98552: flush std streams in the multiprocessing forkserver before fork (GH-141849) (#141851)

gh-98552: flush std streams in the multiprocessing forkserver before fork (GH-141849)

* flush std streams in the multiprocessing forkserver before fork

* NEWS
(cherry picked from commit 58badb1711e12b6e8b5240ab96cdd01b95012de7)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
3 weeks ago[3.14] GH-101100: Resolve reference warnings in library/stdtypes.rst (GH-138420)...
Miss Islington (bot) [Sat, 22 Nov 2025 19:33:09 +0000 (20:33 +0100)] 
[3.14] GH-101100: Resolve reference warnings in library/stdtypes.rst (GH-138420) (#141855)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 weeks ago[3.14] gh-101100: Fix sphinx warnings in `library/unittest.rst` (GH-140109) (#141853)
Miss Islington (bot) [Sat, 22 Nov 2025 19:23:59 +0000 (20:23 +0100)] 
[3.14] gh-101100: Fix sphinx warnings in `library/unittest.rst` (GH-140109) (#141853)

Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
3 weeks ago[3.14] gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802) (#141847)
Miss Islington (bot) [Sat, 22 Nov 2025 18:53:06 +0000 (19:53 +0100)] 
[3.14] gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802) (#141847)

gh-141801: Use accessors for ASN1_STRING fields in libssl (GH-141802)

* gh-141801: Use accessors for ASN1_STRING fields

While ASN1_STRING is currently exposed, it is better to use the
accessors. See https://github.com/openssl/openssl/issues/29117 where, if
the type were opaque, OpenSSL's X509 objects could be much more
memory-efficient.

* Update Modules/_ssl.c

* Update Modules/_ssl.c

---------
(cherry picked from commit c41fce08a5d7aae8fd9e3fa25e0ba521600e097c)

Co-authored-by: David Benjamin <davidben@davidben.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
3 weeks ago[3.14] gh-141600: Fix musl version detection on Void Linux (GH-141850)
Miss Islington (bot) [Sat, 22 Nov 2025 18:47:47 +0000 (19:47 +0100)] 
[3.14] gh-141600: Fix musl version detection on Void Linux (GH-141850)

(cherry picked from commit 08477dbf300020cc67006c180917c02ee8a5cec8)

Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
3 weeks ago[3.14] gh-141612: improve `test_trampoline_works_with_forks` coverage (GH-141613...
Miss Islington (bot) [Sat, 22 Nov 2025 09:38:52 +0000 (10:38 +0100)] 
[3.14] gh-141612: improve `test_trampoline_works_with_forks` coverage (GH-141613) (#141824)

gh-141612: improve `test_trampoline_works_with_forks` coverage (GH-141613)
(cherry picked from commit f15f6d0ba3715c67643e58959459b0e84a67b183)

Co-authored-by: Paresh Joshi <rahulj9223@gmail.com>
3 weeks ago[3.14] gh-129559: add `bytearray.resize` thread safety test for free-threading (GH...
Cody Maloney [Sat, 22 Nov 2025 04:11:20 +0000 (20:11 -0800)] 
[3.14] gh-129559: add `bytearray.resize` thread safety test for free-threading (GH-141739) (#141835)

[3.14] gh-129559: add `bytearray.resize` thread safety test for free-threading  (GH-141739)
(cherry picked from commit 019c315a8e52978da67a3108e441ed5ee376f504)

3 weeks ago[3.14] gh-141729: Doc PyTypeObject.tp_vectorcall grammar fix (GH-141730) (#141815)
Miss Islington (bot) [Fri, 21 Nov 2025 20:14:43 +0000 (21:14 +0100)] 
[3.14] gh-141729: Doc PyTypeObject.tp_vectorcall grammar fix (GH-141730) (#141815)

gh-141729: Doc PyTypeObject.tp_vectorcall grammar fix (GH-141730)

[3.14] Doc PyTypeObject.tp_vectorcall grammar fix
(cherry picked from commit 20b69aac0d19a5e5358362410d9710887762f0e7)

Co-authored-by: Michael Kiper <77862413+michaelkiper@users.noreply.github.com>
Co-authored-by: makiper <michael.kiper@jpl.nasa.gov>
3 weeks ago[3.14] gh-137422: Fix race condition in PyImport_AddModuleRef (gh-141822) (gh-141830)
Miss Islington (bot) [Fri, 21 Nov 2025 18:57:30 +0000 (19:57 +0100)] 
[3.14] gh-137422: Fix race condition in PyImport_AddModuleRef (gh-141822) (gh-141830)

(cherry picked from commit 2d50dd242e04b94f86cb23c4972c1b423c670175)

Co-authored-by: Sam Gross <colesbury@gmail.com>
3 weeks ago[3.14] gh-116738: Make csv module thread-safe (gh-141365) (gh-141825)
Miss Islington (bot) [Fri, 21 Nov 2025 16:47:13 +0000 (17:47 +0100)] 
[3.14] gh-116738: Make csv module thread-safe (gh-141365) (gh-141825)

Added a critical section to protect the states of `ReaderObj` and `WriterObj` in the free-threading build. Without the critical sections, both new free-threading tests were crashing.
(cherry picked from commit fb26d9c2ef739cbfdc134da5ab89470511f1f5fd)

Co-authored-by: Alper <alperyoney@fb.com>
3 weeks ago[3.14] gh-141784: Fix _remote_debugging_module.c compilation on 32-bit Linux (#141796...
Victor Stinner [Thu, 20 Nov 2025 17:13:03 +0000 (18:13 +0100)] 
[3.14] gh-141784: Fix _remote_debugging_module.c compilation on 32-bit Linux (#141796) (#141800)

gh-141784: Fix _remote_debugging_module.c compilation on 32-bit Linux (#141796)

Include Python.h before system headers to make sure that
_remote_debugging_module.c uses the same types (ABI) than Python.

(cherry picked from commit 722f4bb8c9c6b32a7221e4813058cbb5c3989c10)

3 weeks ago[3.14] Docs: Fix typo in socketserver documentation (GH-140956) (#141799)
Miss Islington (bot) [Thu, 20 Nov 2025 16:35:09 +0000 (17:35 +0100)] 
[3.14] Docs: Fix typo in socketserver documentation (GH-140956) (#141799)

Co-authored-by: Thomas Ballard <thomasballard0503@gmail.com>
3 weeks ago[3.14] GH-137841: Open tzdata/zones file with UTF-8 encoding (GH-137872) (#141607)
Miss Islington (bot) [Thu, 20 Nov 2025 16:23:40 +0000 (17:23 +0100)] 
[3.14] GH-137841: Open tzdata/zones file with UTF-8 encoding (GH-137872) (#141607)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 weeks ago[3.14] gh-141004: Document missing `PyDateTime*` APIs (GH-141543) (GH-141791)
Miss Islington (bot) [Thu, 20 Nov 2025 13:54:48 +0000 (14:54 +0100)] 
[3.14] gh-141004: Document missing `PyDateTime*` APIs (GH-141543) (GH-141791)

gh-141004: Document missing `PyDateTime*` APIs (GH-141543)
(cherry picked from commit 4273616ebfbfe2a7cfd93460a08364f5a40f89e2)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-141004: Document missing generator APIs (GH-141409) (GH-141789)
Miss Islington (bot) [Thu, 20 Nov 2025 13:52:07 +0000 (14:52 +0100)] 
[3.14] gh-141004: Document missing generator APIs (GH-141409) (GH-141789)

gh-141004: Document missing generator APIs (GH-141409)
(cherry picked from commit 2da7ecc680548804ea99d62ba4d228cfa5011671)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-141004: Document `Py_MakePendingCalls` (GH-141137) (GH-141787)
Miss Islington (bot) [Thu, 20 Nov 2025 13:48:11 +0000 (14:48 +0100)] 
[3.14] gh-141004: Document `Py_MakePendingCalls` (GH-141137) (GH-141787)

gh-141004: Document `Py_MakePendingCalls` (GH-141137)
(cherry picked from commit ce701032a3d5d3597466d5836ebe989db6eda2aa)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks ago[3.14] gh-141757: Comply with pickle protocol in test_reduce_5tuple (GH-141759) ...
Miss Islington (bot) [Thu, 20 Nov 2025 09:22:52 +0000 (10:22 +0100)] 
[3.14] gh-141757: Comply with pickle protocol in test_reduce_5tuple (GH-141759) (GH-141782)

The 5th element of the __reduce__ tuple should be an iterator.
(cherry picked from commit 41b9ad5b38e913194a5cc88f0e7cfc096787b664)

Co-authored-by: Arseny Boykov <36469655+Bobronium@users.noreply.github.com>
3 weeks ago[3.14] gh-141489: Simplify closure/freevar iteration in `annotationlib._build_closure...
Miss Islington (bot) [Thu, 20 Nov 2025 04:33:18 +0000 (05:33 +0100)] 
[3.14] gh-141489: Simplify closure/freevar iteration in `annotationlib._build_closure()` (GH-141490) (#141776)

gh-141489: Simplify closure/freevar iteration in `annotationlib._build_closure()` (GH-141490)
(cherry picked from commit a35c683da55e77c96828fd0421640787337cfc64)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
3 weeks ago[3.14] gh-132657: optimize `PySet_Contains` for `frozenset` (GH-141183) (gh-141773)
Miss Islington (bot) [Thu, 20 Nov 2025 01:01:49 +0000 (02:01 +0100)] 
[3.14] gh-132657: optimize `PySet_Contains` for `frozenset` (GH-141183) (gh-141773)

(cherry picked from commit 7211a34fe1d9704935342af8c9b46725629f2d97)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
3 weeks ago[3.14] gh-132657: avoid locks and refcounting in `frozenset` lookups (GH-136107)...
Miss Islington (bot) [Thu, 20 Nov 2025 01:00:42 +0000 (02:00 +0100)] 
[3.14] gh-132657: avoid locks and refcounting in `frozenset` lookups (GH-136107) (gh-141772)

gh-132657: avoid locks and refcounting in `frozenset` lookups (GH-136107)
(cherry picked from commit f58a7c717584241467970623384ce61cbd776f29)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
4 weeks ago[3.14] Remove GvR from '_stdauthor' in Doc/conf.py (GH-141765) (#141767)
Miss Islington (bot) [Wed, 19 Nov 2025 20:36:24 +0000 (21:36 +0100)] 
[3.14] Remove GvR from '_stdauthor' in Doc/conf.py (GH-141765) (#141767)

Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Guido van Rossum <gvanrossum@microsoft.com>
4 weeks ago[3.14] Move the NEWS entry for gh-141659 to the correct section (GH-141744) (GH-141766)
Miss Islington (bot) [Wed, 19 Nov 2025 20:17:51 +0000 (21:17 +0100)] 
[3.14] Move the NEWS entry for gh-141659 to the correct section (GH-141744) (GH-141766)

(cherry picked from commit fbc31d14ffaae1f252865db52fc7f5f6311e7b1a)

Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
4 weeks ago[3.14] gh-141004: Document `Py_LOCAL` and `Py_LOCAL_INLINE` (GH-141725) (GH-141761)
Miss Islington (bot) [Wed, 19 Nov 2025 18:38:09 +0000 (19:38 +0100)] 
[3.14] gh-141004: Document `Py_LOCAL` and `Py_LOCAL_INLINE` (GH-141725) (GH-141761)

gh-141004: Document `Py_LOCAL` and `Py_LOCAL_INLINE` (GH-141725)
(cherry picked from commit 3149d64c93f02217eb01c0fd82c26a685b5281c1)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
4 weeks ago[3.14] gh-139103: fix free-threading `dataclass.__init__` perf issue (gh-141596)...
Sam Gross [Wed, 19 Nov 2025 15:00:51 +0000 (10:00 -0500)] 
[3.14] gh-139103: fix free-threading `dataclass.__init__` perf issue (gh-141596) (gh-141750)

The dataclasses `__init__` function is generated dynamically by a call to `exec()` and so doesn't have deferred reference counting enabled. Enable deferred reference counting on functions when assigned as an attribute to type objects to avoid reference count contention when creating dataclass instances.
(cherry picked from commit ce791541769a41beabec0f515cd62e504d46ff1c)

Co-authored-by: Edward Xu <xuxiangad@gmail.com>
4 weeks ago[3.14] gh-141570: can_colorize: Expect fileno() to raise OSError, as documented ...
Miss Islington (bot) [Wed, 19 Nov 2025 14:29:15 +0000 (15:29 +0100)] 
[3.14] gh-141570: can_colorize: Expect fileno() to raise OSError, as documented (GH-141716) (#141747)

gh-141570: can_colorize: Expect fileno() to raise OSError, as documented (GH-141716)

In Fedora, we've been given a slightly incomplete reproducer for a problematic
Python 3.14 color-related change in argparse that leads to an exception when
Python is used from mod_wsgi: https://bugzilla.redhat.com/2414940

mod_wsgi replaces sys.stdout with a custom object that raises OSError on .fileno():

https://github.com/GrahamDumpleton/mod_wsgi/blob/8460dbfcd5c7108892b3cde9fab7cbc1caa27886/src/server/wsgi_logger.c#L434-L440

This should be supported, as the documentation of fileno explicitly says:

> An OSError is raised if the IO object does not use a file descriptor.

https://docs.python.org/3.14/library/io.html#io.IOBase.fileno

The previously expected exception inherits from OSError,
so it is still expected.

Fixes https://github.com/python/cpython/issues/141570
(cherry picked from commit 96f496a949b05054d0d043c3085f00cec2f83bf5)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>