Commit graph

125265 commits

Author SHA1 Message Date
Serhiy Storchaka
55e16b74fd
[3.13] gh-142282 Fix winreg.QueryValueEx() under race condition (GH-142283) (GH-142456)
(cherry picked from commit 3ec941b364)

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2025-12-09 16:46:24 +02:00
Miss Islington (bot)
b2fff0ea85
[3.13] gh-105836: Fix asyncio.run_coroutine_threadsafe leaving underlying cancelled asyncio task running (GH-141696) (#142359)
gh-105836: Fix `asyncio.run_coroutine_threadsafe` leaving underlying cancelled asyncio task running (GH-141696)
(cherry picked from commit 14715e3a64)

Co-authored-by: Kaisheng Xu <iaalmsimon@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-12-09 20:15:50 +05:30
Sam Gross
85f48038aa
[3.13] gh-142342: Fix m68k assembler operand constraints for %fpcr access (gh-142343) (#142459)
On m68k, an fmove instruction accessing %fpcr may only move from
or to a data register or a memory operand. The constraint "g" also
permits the use of address registers, which is invalid. The correct
constraint is "dm". Beginning with GCC 15, the register allocator
picks an address register in the code which causes SIGILL during
runtime.
(cherry picked from commit 02c085d48b)

Co-authored-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Co-authored-by: Michael Karcher <github@mkarcher.dialup.fu-berlin.de>
2025-12-09 14:13:35 +00:00
Miss Islington (bot)
b57d69588c
[3.13] gh-68552: fix defects policy (GH-138579) (#142367)
Co-authored-by: Ivo Bellin Salarin <nilleb@users.noreply.github.com>
Co-authored-by: Martin Panter <vadmium@users.noreply.github.com>
Co-authored-by: Ivo Bellin Salarin <ivo@nilleb.com>
2025-12-09 07:39:03 +00:00
Miss Islington (bot)
e1a6727df6
[3.13] Fix typo in Tools/wasm/README.md (GH-142426) (GH-142430)
Fix typo in `Tools/wasm/README.md` (GH-142426)
(cherry picked from commit 719d7960e2)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-08 20:54:12 +00:00
dr-carlos
d768900ca4
[3.13] gh-141732: Fix ExceptionGroup repr changing when original exception sequence is mutated (GH-141736) (#142391)
* [3.13] gh-141732: Fix `ExceptionGroup` repr changing when original exception sequence is mutated (GH-141736)
(cherry picked from commit ff2577f56e)

Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
2025-12-08 18:46:55 +00:00
Miss Islington (bot)
2c3e3ef6a2
[3.13] gh-123241: Document restrictions for tp_traverse implementations (gh-142272) (#142422)
(cherry picked from commit 37988c57ea)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-12-08 17:28:21 +00:00
Malcolm Smith
2ef7698127
[3.13] gh-141794: Reduce size of compiler stress tests to fix Android warnings (GH-142263) (#142409)
(cherry picked from commit f193c8fe9e)
2025-12-08 12:37:53 +02:00
Stan Ulbrych
a12841c197
[3.13] gh-101100: Fix references to the set methods (GH-141857) (GH-142345)
(cherry picked from commit 1d8f3ed2eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-08 09:50:43 +02:00
Miss Islington (bot)
90ca216cdc
[3.13] gh-142006: Fix HeaderWriteError in email.policy.default caused by extra newline (GH-142008) (#142362)
gh-142006: Fix HeaderWriteError in email.policy.default caused by extra newline (GH-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.
(cherry picked from commit 07eff899d8)

Co-authored-by: Paresh Joshi <rahulj9223@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-12-06 16:40:07 -05:00
Miss Islington (bot)
f28409cb8c
[3.13] GH-75949: Fix argparse dropping '|' in mutually exclusive groups on line wrap (GH-142312) (#142348) 2025-12-06 15:35:01 +00:00
Miss Islington (bot)
462541c0d7
[3.13] Docs: fix RFC index reference for TLS 1.3 (GH-142262) (#142341)
Docs: fix RFC index reference for TLS 1.3 (GH-142262)
(cherry picked from commit 61823a5382)

Co-authored-by: Y. Z. Chen <754097987@qq.com>
2025-12-06 13:29:54 +00:00
Miss Islington (bot)
7147ef4337
[3.13] Add explanation comments for tests for overlapped ZIP entries (GH-137152) (GH-142311)
(cherry picked from commit 100c726d98)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-05 23:29:37 +02:00
Miss Islington (bot)
b44cd567fc
[3.13] gh-140482: Avoid changing terminal settings in test_pty (gh-142202) (gh-142238)
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
(cherry picked from commit c0c65141b3)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-12-05 15:20:42 -05:00
Thomas Wouters
10d1e9369a Post 3.13.11 2025-12-05 20:43:39 +01:00
Thomas Wouters
627894459a Python 3.13.11 2025-12-05 17:06:33 +01:00
Serhiy Storchaka
93d5c481af
[3.13] gh-141370: Fix undefined behavior when using Py_ABS() (GH-141548) (#142304)
(cherry picked from commit 706fdda8b3)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-12-05 15:52:12 +00:00
Miss Islington (bot)
9303573c74
[3.13] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-142216) (#142296)
[3.14] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-142216)

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,
therefore the memory consumption is proportional to the amount of sent
data.
(cherry picked from commit 0e4f4f1a46)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-05 15:37:09 +00:00
Miss Islington (bot)
ddcd2acd85
[3.13] gh-142145: Remove quadratic behavior in node ID cache clearing (GH-142146) (#142210)
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 08d8e18ad8)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>
2025-12-05 15:24:38 +00:00
Miss Islington (bot)
289f29b0fe
[3.13] gh-119451: Fix a potential denial of service in http.client (GH-119454) (#142139)
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.
(cherry picked from commit 5a4c4a033a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-05 16:21:57 +01:00
Miss Islington (bot)
e7d2f62bb3
[3.13] Fix disk space issues in Android CI (GH-142289) (#142293)
Fix disk space issues in Android CI (GH-142289)
(cherry picked from commit cac4b04973)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-12-05 16:12:05 +01:00
Serhiy Storchaka
6f47a134bc
[3.13] Revert "[3.13] gh-140797: Forbid capturing groups in re.Scanner lexicon patterns (GH-140944) (GH-140983)" (GH-142231)
Revert "[3.13] gh-140797: Forbid capturing groups in re.Scanner lexicon patterns (GH-140944) (GH-140983)"

This reverts commit ee894d2abb.
2025-12-05 15:31:34 +02:00
Miss Islington (bot)
29100c8e87
[3.13] gh-142206: multiprocessing.resource_tracker: Decode messages using older protocol (GH-142215) (#142287)
[3.14] gh-142206: multiprocessing.resource_tracker: Decode messages using older protocol (GH-142215) (GH-142285)

(cherry picked from commit 4172644d78)

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

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-12-05 12:13:05 +00:00
Miss Islington (bot)
e68066eb09
[3.13] gh-129483: Make TestLocalTimeDisambiguation's time format locale independent (GH-142193) (#142259)
gh-129483: Make `TestLocalTimeDisambiguation`'s time format locale independent (GH-142193)

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

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

Co-authored-by: Kir Chou <148194051+gkirchou@users.noreply.github.com>
Co-authored-by: Kir Chou <note351@hotmail.com>
2025-12-04 14:01:01 +00:00
Sam Gross
1a75c0fb05
[3.13] gh-142218: Fix split table dictionary crash (gh-142229) (gh-142245)
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 547d8daf78)
2025-12-04 07:46:24 +00:00
Thomas Wouters
03cceb1a51 Merge branch '3.13' of https://github.com/python/cpython into 3.13 2025-12-02 17:44:32 +01:00
Thomas Wouters
fedefc5f3a Post 3.13.10 2025-12-02 17:41:30 +01:00
Miss Islington (bot)
caf1794b88
[3.13] Document None for timeout argument of select.select (GH-142177)
cherry picked from commit 82274c491a (GH-142182)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-12-02 14:32:04 +01:00
Thomas Wouters
4fd884356d Python 3.13.10 2025-12-02 13:49:50 +01:00
Hugo van Kemenade
a62caed6a6
[3.13] Revert "gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-119455) (GH-142130)" (#142185)
Revert "[3.13] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-119455) (GH-142130)"

This reverts commit 6c922bbe28.
2025-12-02 12:04:25 +00:00
Tian Gao
9d99b5b2ca
[3.13] gh-59000: Fix pdb breakpoint resolution for class methods when… (#142172)
* [3.13] gh-59000: Fix pdb breakpoint resolution for class methods when module not imported (GH-141949)
(cherry picked from commit 5e58548ebe)

Co-authored-by: LloydZ <35182391+cocolato@users.noreply.github.com>
2025-12-02 05:07:52 +00:00
Sam Gross
01393ffbe6
[3.13] gh-142048: Fix quadratically increasing GC delays (gh-142051) (#142167)
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 eb892868b3)

Co-authored-by: Kevin Wang <kevmo314@gmail.com>
2025-12-02 00:31:36 +00:00
Stan Ulbrych
8d920ac1a5
[3.13] GH-138562: Remove `sort()` from the common sequence methods in the data model (GH-138563) (#140676)
(cherry picked from commit d0c9943869)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-01 23:29:13 +01:00
Hugo van Kemenade
5d7cacb1db
[3.13] GH-101100: Remove some entries from `nitpick_ignore` (GH-138464) (#141827)
(cherry picked from commit 22cb9ba8f9)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-01 23:26:32 +01:00
Cody Maloney
ed5d71752b
[3.13] gh-141930: Use the regular IO stack to write .pyc files for a better error message on failure (GH-141931) (#142023)
* Use open() to write the bytecode
* Convert to unittest style asserts
* Tweak news, thanks @vstinner
* Tidy
* reword NEWS, avoid word "retried"
(cherry picked from commit 656a64b37f)

Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2025-12-01 23:23:07 +01:00
Miss Islington (bot)
f61e9fcdb6
[3.13] gh-141004: Document descriptor and dict proxy type objects (GH-141803) (GH-142148)
gh-141004: Document descriptor and dict proxy type objects (GH-141803)
(cherry picked from commit 52f9b5f580)

Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-12-01 15:57:53 +00:00
Miss Islington (bot)
71fa8eb823
[3.13] gh-119342: Fix a potential denial of service in plistlib (GH-119343) (GH-142144)
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 694922cf40)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-01 15:50:28 +00:00
Miss Islington (bot)
6c922bbe28
[3.13] gh-119452: Fix a potential virtual memory allocation denial of service in http.server (GH-119455) (GH-142130)
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.
(cherry picked from commit 29c657a1f2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-01 14:22:10 +00:00
Miss Islington (bot)
69fbef0d60
[3.13] Docs: Upgrade Sphinx to 9.0 (GH-142114) (#142129)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-01 11:23:13 +00:00
Miss Islington (bot)
6871aa160f
[3.13] gh-141473: Document not calling Popen.wait after Popen.communicate times out. (GH-142101) (#142125)
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 3e2c557493)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-12-01 02:56:30 +00:00
Miss Islington (bot)
42c6e75ba1
[3.13] Improve clarity in tutorial introduction (GH-140669) (#142113)
Co-authored-by: Thierry Martos <81799048+ThierryMT@users.noreply.github.com>
2025-11-30 12:53:10 +00:00
Miss Islington (bot)
b34ecec682
[3.13] gh-136063: fix quadratic-complexity parsing in email.message._parseparam (GH-136072) (#140828)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-11-30 14:34:22 +02:00
Prithviraj Chaudhuri
2d05a0cc2e
[3.13] gh-140042: Removing unsafe call to sqlite3_shutdown (GH-141793) (#141812) 2025-11-30 14:33:05 +02:00
Miss Islington (bot)
bb8984f895
[3.13] Docs: Prepare for Sphinx 9 (GH-142057) (#142092) 2025-11-29 15:52:05 +00:00
Miss Islington (bot)
342c9e0287
[3.13] GH-121970: Remove Docutils list monkeypatch (GH-142056) (#142089) 2025-11-29 14:56:41 +00:00
Miss Islington (bot)
99b70fe4eb
[3.13] gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush error when closed (GH-142061) (#142065)
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 923056b2d4)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-11-28 23:33:47 -08:00
Itamar Oren
385688d4b4
[3.13] gh-140011: Delete importdl assertion that prevents importing embedded modules from packages (GH-141605) (#141987)
gh-140011: Delete importdl assertion that prevents importing embedded modules from packages (GH-141605)

(cherry picked from commit 27f62eb711)
2025-11-28 23:31:11 -08:00
Miss Islington (bot)
09ceaa606a
[3.13] GH-141963: Clarify argparse documentation (GH-141964) (#142077)
GH-141963: Clarify argparse documentation (GH-141964)

Clarify argparse documentation

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

Co-authored-by: Moshe Kaplan <mosheekaplan@gmail.com>
2025-11-29 07:29:50 +00:00
Miss Islington (bot)
12471131a7
[3.13] gh-87512: Fix subprocess using timeout= on Windows blocking with a large input= (GH-142058) (#142069)
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 5b1862bdd8)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-11-29 07:22:46 +00:00
Miss Islington (bot)
c4df097c41
[3.13] Fix multiprocessing queue test_get() (GH-142024) (#142071)
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 5e749d3743)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-29 07:22:27 +00:00