Commit graph

32901 commits

Author SHA1 Message Date
Miss Islington (bot)
4dd9d94619
[3.13] gh-143004: Fix possible use-after-free in collections.Counter.update() (GH-143044) (GH-143167)
This happened when the Counter was mutated when incrementing
the value for an existing key.
(cherry picked from commit 86d904588e)

Co-authored-by: kaushal trivedi <155625932+Kaushalt2004@users.noreply.github.com>
2025-12-25 13:41:24 +02:00
Cody Maloney
a9e068f0be
[3.13] gh-142560: prevent use-after-free in search-like methods by exporting buffer in bytearray (GH-142938) (GH-142986)
(cherry picked from commit 220f0b1077)

Co-authored-by: wangxiaolei <fatelei@gmail.com>
2025-12-24 19:13:47 +00:00
Miss Islington (bot)
88025560aa
[3.13] Correctly fold unknown-8bit originating from encoded words. (GH-142517) (#143147)
The unknown-8bit trick was designed to deal with unknown bytes in an
ASCII message, and it works fine for that.  However, I also tried to
extend it to handle bytes that can't be decoded using the charset
specified in an encoded word, and there it fails because there can be
other non-ASCII characters that were *successfully* decoded.  The fix is
simple: do the unknown-8bit encoding using the utf-8 codec.  This is
especially appropriate since anyone trying to do recovery on an unknown
byte string will probably attempt utf-8 first.
(cherry picked from commit 1e17ccd030)

Co-authored-by: R. David Murray <rdmurray@bitdance.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-24 13:19:28 -05:00
Sam Gross
86504f26bd
[3.13] gh-143121: Skip test that leak threads under TSan (gh-143125) (#143142)
(cherry picked from commit 4ee6929d60)
2025-12-24 13:29:13 +00:00
Miss Islington (bot)
e91c11449c
[3.13] gh-142145: Avoid timing measurements in quadratic behavior test (gh-143105) (#143140)
Count the number of Element attribute accesses as a proxy for work done.
With double the amount of work, a ratio of 2.0 indicates linear scaling
and 4.0 quadratic scaling. Use 3.2 as an intermediate threshold.
(cherry picked from commit 57937a8e5e)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-12-24 13:26:07 +00:00
Miss Islington (bot)
e20863f223
[3.13] gh-109263: Start process from spawn context in multiprocessing no longer have side effect (GH-135813) (#143116)
gh-109263: Start process from spawn context in multiprocessing no longer have side effect (GH-135813)
(cherry picked from commit c2202a7e66)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2025-12-24 03:03:47 +00:00
Hugo van Kemenade
7dc6acc1e9
[3.13] gh-84232: Fix pydoc docs.python.org link generation (GH-139995) (#143099)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
2025-12-23 18:29:28 +02:00
Miss Islington (bot)
931c4d6258
[3.13] gh-139743: Avoid print twice verbose version for sqlite tests (GH-142850) (GH-142866)
(cherry picked from commit 454485e564)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
2025-12-22 11:12:34 +00:00
Miss Islington (bot)
96bc410fec
[3.13] gh-143046: Make asyncio REPL respect the -q flag (quiet mode) (GH-143047) (#143061)
gh-143046: Make asyncio REPL respect the `-q` flag (quiet mode) (GH-143047)
(cherry picked from commit 6213a512bf)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-12-22 13:48:28 +05:30
Miss Islington (bot)
c084a66568
[3.13] gh-79986: Add parsing for References/In-Reply-To email headers (GH-137201) (#142574)
gh-79986: Add parsing for References/In-Reply-To email headers (GH-137201)

This is a followup to 46d88a1131 (GH-13397),
which added parsing for Message-ID. Similar handling is needed for the
other two identification headers.
(cherry picked from commit 79aa43a979)

Co-authored-by: elenril <anton@khirnov.net>
2025-12-21 14:36:23 -05:00
Gregory P. Smith
a696ba8b4d
[3.13] gh-142145: relax the no-longer-quadratic test timing (GH-143030) (#143032)
gh-142145: relax the no-longer-quadratic test timing (#143030)

* gh-142145: relax the no-longer-quadratic test timing

* require cpu resource

(cherry picked from commit 8d2d7bb)
2025-12-21 00:22:07 +00:00
Miss Islington (bot)
86747f1a1a
[3.13] gh-142754: Ensure that Element & Attr instances have the ownerDocument attribute (GH-142794) (#142819)
gh-142754: Ensure that Element & Attr instances have the ownerDocument attribute (GH-142794)
(cherry picked from commit 1cc7551b3f)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-20 15:56:59 -08:00
Mikhail Efimov
4504ff89d5
[3.13] gh-140373: Correctly emit PY_UNWIND event when generator is closed (GH-140767) (#140821) 2025-12-20 16:21:11 +02:00
Miss Islington (bot)
ae3834c97e
[3.13] gh-142681: Move NormalizationTest-3.2.0.txt to more safe place. (GH-142935) (GH-142945)
(cherry picked from commit 4a8ecbad80)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-19 13:34:18 +01:00
Savannah Ostrowski
8f7c4f1cef
[3.13] GH-100964: Fix reference cycle in exhausted generator frames (G… (#142904)
* [3.13] GH-100964: Fix reference cycle in exhausted generator frames (GH-141112)
(cherry picked from commit 92243dc62c)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2025-12-17 20:04:53 +00:00
Sam Gross
db552ddb1e
[3.13] gh-142766: Clear frame when generator.close() is called (gh-142838) (#142900)
(cherry picked from commit 25397f9541)
2025-12-17 18:46:23 +00:00
Serhiy Storchaka
08d665d607
[3.13] gh-112127: Fix possible use-after-free in atexit.unregister() (GH-114092) (GH-142880)
(cherry picked from commit 2b466c47c3)

Co-authored-by: Benjamin Johnson <ben332004@gmail.com>
2025-12-17 17:15:21 +00:00
Miss Islington (bot)
7c2d9c9498
[3.13] gh-142836: Avoid /proc fd pipes on Solaris (GH-142853) (#142855)
gh-142836: Avoid /proc fd pipes on Solaris (GH-142853)
(cherry picked from commit c35b812e77)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2025-12-17 08:20:28 -05:00
Miss Islington (bot)
88b8e63c54
[3.13] gh-142783: Fix possible use after free in zoneinfo module (GH-142790) (GH-142861)
(cherry picked from commit 8307a14d0e)

Co-authored-by: wangxiaolei <fatelei@gmail.com>
2025-12-17 09:21:20 +00:00
Serhiy Storchaka
9361207bc2
[3.13] gh-142495: Make defaultdict keep existed value when racing with __missing__ (GH-142668) (GH-142858)
(cherry picked from commit a043407510)

Co-authored-by: Edward Xu <xuxiangad@gmail.com>
2025-12-17 08:40:47 +00:00
Miss Islington (bot)
e07cda302e
[3.13] gh-142752: add more thread safety tests for mock (GH-142791) (#142857)
gh-142752: add more thread safety tests for mock (GH-142791)
(cherry picked from commit 4fd006e712)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-12-17 08:09:59 +00:00
Miss Islington (bot)
fb5474726c
[3.13] gh-142315: Don't pass the "real path" of Pdb script target to system functions (GH-142371) (#142498)
gh-142315: Don't pass the "real path" of Pdb script target to system functions (GH-142371

---------
(cherry picked from commit d716e3b2dd)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2025-12-16 10:53:09 -05:00
Cody Maloney
affd2f2ff2
[3.13] gh-142594: fix by property calls io.TextIOWrapper.detach (GH-142706) (GH-142757)
(cherry picked from commit 1d3854a19a)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
2025-12-16 10:55:35 +01:00
Bartosz Sławecki
3e45440382
[3.13] gh-142737: Handle lost io.open in _Py_FindSourceFile (GH-142747) (GH-142774)
(cherry picked from commit f277781bba)
2025-12-15 23:27:15 +00:00
Miss Islington (bot)
8ebda57bb1
[3.13] gh-142651: make Mock.call_count thread-safe (GH-142656) (#142744)
gh-142651: make `Mock.call_count` thread-safe (GH-142656)
(cherry picked from commit 850f95f6f6)

Co-authored-by: chaope <pengchaoandy@gmail.com>
2025-12-15 18:22:11 +05:30
Miss Islington (bot)
7957bfd1ac
[3.13] gh-90871: fix connection backlog offset in asyncio (gh-134392) (#142739)
gh-90871: fix connection backlog offset in asyncio (gh-134392)
(cherry picked from commit 109f7597d2)

Co-authored-by: Christian Harries <68507104+ChristianHrs@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-12-15 06:12:12 +00:00
Miss Islington (bot)
18bd88f899
[3.13] gh-127529: Correct asyncio's accept_connection behaviour for handling ConnectionAbortedError (GH-127532) (#142738)
gh-127529: Correct asyncio's `accept_connection` behaviour for handling `ConnectionAbortedError` (GH-127532)
(cherry picked from commit 830e10651b)

Co-authored-by: jb2170 <email@jb2170.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-12-15 05:44:52 +00:00
Serhiy Storchaka
d94a1811e6
[3.13] gh-142681: Improve unicodedata tests (GH-142682) (GH-142708) (GH-142710)
(cherry picked from commit f6ed94e70e)
(cherry picked from commit af7cca3c39)
2025-12-14 12:22:24 +00:00
Bénédikt Tran
d209fd911e
[3.13] gh-142451: correctly copy HMAC attributes in HMAC.copy() (GH-142510) (#142701)
Partially cherry-picked from d3ef5ba34d
which ensures that the `block_size` attribute exists on the copy.
2025-12-14 09:36:26 +00:00
Bénédikt Tran
2249043874
[3.13] gh-142554: avoid divmod crashes due to bad _pylong.int_divmod (GH-142673) (#142697)
gh-142554: avoid `divmod` crashes due to bad `_pylong.int_divmod` (#142673)

(cherry picked from commit 4e4163676a)
2025-12-14 09:03:14 +00:00
Miss Islington (bot)
e7bb732d8b
[3.13] gh-142353: Isolate tests from personal GNU Readline init files (GH-142370) (#142635)
gh-142353: Isolate tests from personal GNU Readline init files (GH-142370)

Isolate tests from personal Readline init files using `INPUTRC=/dev/null` trick.
(cherry picked from commit f564654bae)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-12-13 10:58:43 +00:00
Miss Islington (bot)
746f8ed65d
[3.13] gh-142489: Increase ssl_handshake_timeout in asyncio tests (GH-142523) (#142546)
gh-142489: Increase ssl_handshake_timeout in asyncio tests (GH-142523)

Replace SHORT_TIMEOUT with LONG_TIMEOUT for very slow CIs.
And add the HANDSHAKE_TIMEOUT constant.
(cherry picked from commit dc3ece2bc0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-12-10 22:43:56 +00:00
Serhiy Storchaka
24036f55e4
[3.13] gh-112527: Fix help text for required options in argparse (GH-112528) (GH-142477)
For optional arguments with required=True, the ArgumentDefaultsHelpFormatter
would always add a " (default: None)" to the end of the help text.
Since that's a bit misleading, it is removed with this commit.
(cherry picked from commit 1adb17b1a2)

Co-authored-by: Fabian Henze <32638720+henzef@users.noreply.github.com>
2025-12-09 17:36:24 +00:00
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
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
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
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
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
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
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