Commit graph

55643 commits

Author SHA1 Message Date
Miss Islington (bot)
7ff87fa8e1
[3.14] gh-143200: fix UAFs in Element.__{set,get}item__ when the element is concurrently mutated (GH-143226) (#143273)
gh-143200: fix UAFs in `Element.__{set,get}item__` when the element is concurrently mutated (GH-143226)
(cherry picked from commit b6b0e14b3d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-29 17:57:54 +00:00
Miss Islington (bot)
b097fa13f3
[3.14] gh-140870: Full coverage for _pyrepl._module_completer (GH-143244) (#143260)
gh-140870: Full coverage for _pyrepl._module_completer (GH-143244)

Full coverage for _pyrepl._module_completer
(cherry picked from commit c3febba73b)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-12-28 19:31:02 +00:00
Miss Islington (bot)
8def603d85
[3.14] gh-142195: Fixed Popen.communicate indefinite loops (GH-143203) (#143255)
gh-142195: Fixed Popen.communicate indefinite loops (GH-143203)

Changed condition to evaluate if timeout is less than or equals to 0. This is needed for simulated time environments such as Shadow where the time will match exactly on the boundary.

---------
(cherry picked from commit fa9a4254e8)

Co-authored-by: Prithviraj Chaudhuri <p.chaudhuri1993@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-12-28 17:22:47 +00:00
Miss Islington (bot)
4c3e2114b5
[3.14] gh-143241: Fix infinite loop in zoneinfo._common.load_data (GH-143243) (#143251)
gh-143241: Fix infinite loop in `zoneinfo._common.load_data` (GH-143243)

Correctly reject truncated TZif files in `ZoneInfo.from_file`.

---------
(cherry picked from commit 3ca1f2a370)

Co-authored-by: Fatih Çelik <fcelik.ft@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-28 15:14:04 +00:00
Miss Islington (bot)
fd9db61a25
[3.14] gh-142557: fix UAF in bytearray.__mod__ when object is mutated while formatting %-style arguments (GH-143213) (#143227)
gh-142557: fix UAF in `bytearray.__mod__` when object is mutated while formatting `%`-style arguments (GH-143213)
(cherry picked from commit 61ee04834b)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-27 15:23:08 +00:00
Miss Islington (bot)
93029e45b7
[3.14] gh-143195: fix UAF in {bytearray,memoryview}.hex(sep) via re-entrant sep.__len__ (GH-143209) (#143219)
gh-143195: fix UAF in `{bytearray,memoryview}.hex(sep)` via re-entrant `sep.__len__` (GH-143209)
(cherry picked from commit 9976c2b634)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-27 13:57:41 +00:00
Miss Islington (bot)
cb8b96ed25
[3.14] gh-142664: fix UAF in memoryview.__hash__ via re-entrant data's __hash__ (GH-143217) (#143221)
gh-142664: fix UAF in `memoryview.__hash__` via re-entrant data's `__hash__` (GH-143217)
(cherry picked from commit 00e24b80e0)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-27 13:37:32 +00:00
Miss Islington (bot)
723ed8c507
[3.14] gh-143164: Fix incorrect error message for ctypes bitfield overflow (GH-143165) (GH-143176)
(cherry picked from commit b9a4806430)

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
2025-12-25 17:34:02 +00:00
Miss Islington (bot)
8a61b71eee
[3.14] gh-142975: During GC, mark frozen objects with a merged zero refcount for destruction (GH-143156) (GH-143175)
gh-142975: During GC, mark frozen objects with a merged zero refcount for destruction (GH-143156)
(cherry picked from commit 8611f74e08)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-12-25 12:00:42 -05:00
Miss Islington (bot)
240ee20770
[3.14] gh-143004: Fix possible use-after-free in collections.Counter.update() (GH-143044) (GH-143166)
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:10 +02:00
Miss Islington (bot)
6809811036
[3.14] Correctly fold unknown-8bit originating from encoded words. (GH-142517) (#143146)
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:20:05 -05:00
Sam Gross
b921374c78
[3.14] gh-143121: Skip test that leak threads under TSan (gh-143125) (#143141)
(cherry picked from commit 4ee6929d60)
2025-12-24 13:31:05 +00:00
Miss Islington (bot)
41f4687867
[3.14] gh-142145: Avoid timing measurements in quadratic behavior test (gh-143105) (#143139)
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:25:43 +00:00
Miss Islington (bot)
64461f1ca5
[3.14] gh-109263: Start process from spawn context in multiprocessing no longer have side effect (GH-135813) (#143115)
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:04:46 +00:00
Miss Islington (bot)
a007e951ef
[3.14] gh-84232: Fix pydoc docs.python.org link generation (GH-139995) (#143098)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
2025-12-23 18:26:49 +02:00
Miss Islington (bot)
33c9ebe437
[3.14] gh-143010: Prevent a TOCTOU issue by only calling open once (GH-143011) (#143080)
gh-143010: Prevent a TOCTOU issue by only calling open once (GH-143011)

RDM: per  AZero13's research the 'x' option did not exist when this code was written,  This
modernization can thus drop the fd trick in _create_carefully and just use open with 'x' to achieve the same goal more securely.
(cherry picked from commit a88d1b8dab)

Co-authored-by: AZero13 <gfunni234@gmail.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-12-22 13:14:59 -05:00
Miss Islington (bot)
6a3b861cb2
[3.14] gh-143046: Make asyncio REPL respect the -q flag (quiet mode) (GH-143047) (#143060)
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:16 +05:30
Miss Islington (bot)
4646ddc309
[3.14] gh-79986: Add parsing for References/In-Reply-To email headers (GH-137201) (#142573)
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:35:24 -05:00
Miss Islington (bot)
27648a1818
[3.14] gh-142145: relax the no-longer-quadratic test timing (GH-143030) (#143031)
gh-142145: relax the no-longer-quadratic test timing (GH-143030)

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

* require cpu resource
(cherry picked from commit 8d2d7bb2e7)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-12-21 00:25:25 +00:00
Miss Islington (bot)
4424d1b38f
[3.14] gh-142754: Ensure that Element & Attr instances have the ownerDocument attribute (GH-142794) (#142818)
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:47 -08:00
Miss Islington (bot)
dbc7fd61d8
[3.14] gh-142560: prevent use-after-free in search-like methods by exporting buffer in bytearray (GH-142938) (#142983)
gh-142560: prevent use-after-free in search-like methods by exporting buffer in bytearray (GH-142938)
(cherry picked from commit 220f0b1077)

Co-authored-by: wangxiaolei <fatelei@gmail.com>
2025-12-19 16:58:24 +00:00
Miss Islington (bot)
f1288d353f
[3.14] gh-142681: Move NormalizationTest-3.2.0.txt to more safe place. (GH-142935) (GH-142944)
(cherry picked from commit 4a8ecbad80)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-18 18:34:05 +01:00
Miss Islington (bot)
f02231b8a0
[3.14] gh-142784: make the asyncio REPL call loop.close() at exit (GH-142785) (#142933)
gh-142784: make the asyncio REPL call `loop.close()` at exit (GH-142785)
(cherry picked from commit ddfc155d3a)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-12-18 19:25:50 +05:30
Miss Islington (bot)
7134b407dc
[3.14] GH-100964: Fix reference cycle in exhausted generator frames (GH-141112) (#142902)
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 19:48:18 +00:00
Miss Islington (bot)
25a94708e5
[3.14] gh-142766: Clear frame when generator.close() is called (gh-142838) (#142899)
(cherry picked from commit 25397f9541)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-12-17 18:33:15 +00:00
Miss Islington (bot)
8c92d665ee
[3.14] gh-112127: Fix possible use-after-free in atexit.unregister() (GH-114092) (#142878)
gh-112127: Fix possible use-after-free in atexit.unregister() (GH-114092)
(cherry picked from commit 2b466c47c3)

Co-authored-by: Benjamin Johnson <ben332004@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-17 21:36:12 +05:30
Miss Islington (bot)
06137178b0
[3.14] gh-142836: Avoid /proc fd pipes on Solaris (GH-142853) (#142854)
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:34 -05:00
Miss Islington (bot)
57b37a9ca9
[3.14] gh-139743: Avoid print twice verbose version for sqlite tests (GH-142850) (GH-142865)
(cherry picked from commit 454485e564)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
2025-12-17 10:10:46 +00:00
Miss Islington (bot)
897e2b46fb
[3.14] gh-142783: Fix possible use after free in zoneinfo module (GH-142790) (GH-142862)
(cherry picked from commit 8307a14d0e)

Co-authored-by: wangxiaolei <fatelei@gmail.com>
2025-12-17 09:23:59 +00:00
Miss Islington (bot)
4feba4db2c
[3.14] gh-142752: add more thread safety tests for mock (GH-142791) (#142856)
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:14:20 +00:00
Miss Islington (bot)
8b6eaef828
[3.14] gh-142315: Don't pass the "real path" of Pdb script target to system functions (GH-142371) (#142497)
gh-142315: Don't pass the "real path" of Pdb script target to system functions (GH-142371)

* Pick target depending on preconditions

* Clarify the news fragment

* Add test capturing missed expectation.

* Add more idiomatic safe realpath helper

* Restore logic where existance and directoriness are checked on realpath.

* Link GH issue to test.

* Extract a function to check the target. Remove the _safe_realpath, now no longer needed.

* Extract method for replacing sys_path, and isolate realpath usage there.

* Revert "Extract method for replacing sys_path, and isolate realpath usage there."

This reverts commit 855aac3d28.

* Restore _safe_realpath.

---------
(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:52:26 -05:00
Miss Islington (bot)
d089cad656
[3.14] gh-142495: Make defaultdict keep existed value when racing with __missing__ (GH-142668) (GH-142832)
(cherry picked from commit a043407510)

Co-authored-by: Edward Xu <xuxiangad@gmail.com>
2025-12-16 15:31:05 +00:00
Cody Maloney
58da2a9d94
[3.14] gh-142594: fix by property calls io.TextIOWrapper.detach (GH-142706) (GH-142755)
(cherry picked from commit 1d3854a19a)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
2025-12-16 10:55:25 +01:00
Miss Islington (bot)
b9cbdde80d
[3.14] gh-142737: Handle lost io.open in _Py_FindSourceFile (GH-142747) (GH-142773)
gh-142737: Handle lost `io.open` in `_Py_FindSourceFile` (GH-142747)
(cherry picked from commit f277781bba)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-12-15 23:30:00 +00:00
Miss Islington (bot)
f17281741c
[3.14] gh-142651: make Mock.call_count thread-safe (GH-142656) (#142743)
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:21:52 +05:30
Serhiy Storchaka
f6ed94e70e
[3.14] gh-142681: Improve unicodedata tests (GH-142682) (GH-142708)
(cherry picked from commit af7cca3c39)
2025-12-14 13:51:14 +02:00
Bénédikt Tran
77ad3d59c2
[3.14] gh-142451: correctly copy HMAC attributes in HMAC.copy() (GH-142510) (#142698)
Partially cherry-picked from d3ef5ba34d
which ensures that the `block_size` attribute exists on the copy.
2025-12-14 09:27:03 +00:00
Miss Islington (bot)
aef4552d04
[3.14] gh-142554: avoid divmod crashes due to bad _pylong.int_divmod (GH-142673) (#142696)
gh-142554: avoid `divmod` crashes due to bad `_pylong.int_divmod` (GH-142673)
(cherry picked from commit 4e4163676a)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-14 09:04:37 +00:00
Neil Schemenauer
27f27a68b3
[3.14] gh-142531: Fix free-threaded GC performance regression (gh-142562) (gh-142617)
If there are many untracked tuples, the GC will run too often, resulting
in poor performance.  The fix is to include untracked tuples in the
"long lived" object count. The number of frozen objects is also now
included since the free-threaded GC must scan those too.
(cherry picked from commit e38967ed60)
2025-12-12 14:30:20 -08:00
Miss Islington (bot)
ebeb07f132
[3.14] gh-141370: Fix undefined behavior when using Py_ABS() (GH-141548) (GH-142301)
(cherry picked from commit 706fdda8b3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-12-12 15:11:43 +00:00
Miss Islington (bot)
5e425c3f96
[3.14] gh-142353: Isolate tests from personal GNU Readline init files (GH-142370) (#142634)
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-12 15:08:08 +00:00
Sam Gross
12d2b95adf
[3.14] gh-142589: Fix PyUnstable_Object_IsUniqueReferencedTemporary (gh-142593) (#142597)
PyUnstable_Object_IsUniqueReferencedTemporary wasn't handling tagged
ints on the evaluation stack properly.
(cherry picked from commit a26c831bc4)
2025-12-11 20:08:45 +00:00
Miss Islington (bot)
7218be0199
[3.14] gh-142556: fix crash when a task gets re-registered during finalization in asyncio (GH-142565) (#142566)
gh-142556: fix crash when a task gets re-registered during finalization in `asyncio` (GH-142565)
(cherry picked from commit 42d2bedb87)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-12-11 10:00:44 +00:00
Miss Islington (bot)
82ebdd207f
[3.14] GH-139436: Remove PDF and CHM from IDLE HelpSource (GH-140418) (#142552)
GH-139436: Remove PDF and CHM from IDLE HelpSource (GH-140418)
(cherry picked from commit c5825ff4c9)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-11 02:18:36 +00:00
Miss Islington (bot)
cc705be468
gh-140172: Skip JSON tools test during PGO training (GH-140809)
(cherry picked from commit fa448451ab)

Co-authored-by: Steve Dower <steve.dower@python.org>
2025-12-11 01:01:59 +00:00
Miss Islington (bot)
cbec73cf63
[3.14] gh-142489: Increase ssl_handshake_timeout in asyncio tests (GH-142523) (#142545)
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:46:35 +00:00
Serhiy Storchaka
dafac8a47a
[3.14] gh-112527: Fix help text for required options in argparse (GH-112528) (GH-142475)
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:35:49 +00:00
Miss Islington (bot)
5d5d92b62f
[3.14] gh-105836: Fix asyncio.run_coroutine_threadsafe leaving underlying cancelled asyncio task running (GH-141696) (#142358)
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:16:05 +05:30
Miss Islington (bot)
19968c8927
[3.14] gh-142282 Fix winreg.QueryValueEx() under race condition (GH-142283) (GH-142453)
(cherry picked from commit 3ec941b364)

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2025-12-09 12:33:35 +00:00
Miss Islington (bot)
f200776b13
[3.14] gh-68552: fix defects policy (GH-138579) (#142366)
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:01 +00:00