Commit graph

55614 commits

Author SHA1 Message Date
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
Miss Islington (bot)
9bb27cd105
[3.14] gh-140125: Increase object recursion depth for test_json from 200k to 500k (GH-142226) (#142416)
gh-140125: Increase object recursion depth for `test_json` from 200k to 500k (GH-142226)
(cherry picked from commit e3539e99e3)

Co-authored-by: Zanie Blue <contact@zanie.dev>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-12-08 13:31:56 +00:00
Miss Islington (bot)
d2f5a0e72e
[3.14] gh-141794: Reduce size of compiler stress tests to fix Android warnings (GH-142263) (#142386)
gh-141794: Reduce size of compiler stress tests to fix Android warnings (GH-142263)
(cherry picked from commit f193c8fe9e)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-12-08 09:58:21 +02:00
Miss Islington (bot)
7308015d9c
[3.14] gh-142346: Fix usage formatting for mutually exclusive groups in argparse (GH-142381) (GH-142385)
Support groups preceded by positional arguments or followed or intermixed
with other optional arguments. Support empty groups.
(cherry picked from commit 1db9f56bff)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-07 20:03:05 +00:00
Miss Islington (bot)
b188ebeca0
[3.14] gh-142006: Fix HeaderWriteError in email.policy.default caused by extra newline (GH-142008) (#142361)
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:39:47 -05:00
Miss Islington (bot)
1dfe219fec
[3.14] gh-142332: Fix usage formatting for positional arguments in mutually exclusive groups in argparse (GH-142333) (GH-142356)
(cherry picked from commit 70c27ce94b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-06 18:28:54 +00:00
Miss Islington (bot)
4556b9e7dc
[3.14] GH-75949: Fix argparse dropping '|' in mutually exclusive groups on line wrap (GH-142312) (#142347) 2025-12-06 15:37:34 +00:00
Miss Islington (bot)
95d19fc5b6
[3.14] Docs: fix RFC index reference for TLS 1.3 (GH-142262) (#142340)
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 14:51:08 +00:00
Hugo van Kemenade
66d1d7ed37 Merge branch '3.14' of https://github.com/python/cpython into 3.14 2025-12-05 22:00:48 +02:00
Miss Islington (bot)
37c6dd1c91
[3.14] GH-142267: Cache formatter to avoid repeated _set_color calls (GH-142268) (#142313)
GH-142267: Cache formatter to avoid repeated `_set_color` calls (GH-142268)
(cherry picked from commit 4085ff7b32)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2025-12-05 17:14:56 +00:00
Hugo van Kemenade
df793163d5 Python 3.14.2 2025-12-05 18:49:16 +02:00
Hugo van Kemenade
4cb6cbb6fa
[3.14] Revert "gh-140797: Forbid capturing groups in re.Scanner lexicon patterns (GH-140944) (GH-140982)" (#142309) 2025-12-05 16:45:15 +00:00
Miss Islington (bot)
d8b1ce10bd
[3.14] Add explanation comments for tests for overlapped ZIP entries (GH-137152) (GH-142310)
(cherry picked from commit 100c726d98)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-05 16:35:21 +00:00
Miss Islington (bot)
8fd39c0e51
[3.14] gh-140482: Avoid changing terminal settings in test_pty (gh-142202) (gh-142239)
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 11:18:40 -05:00
Serhiy Storchaka
0e4f4f1a46
[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.
2025-12-05 16:20:23 +02:00
Petr Viktorin
f130b06da3
[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).

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-12-05 12:47:30 +01:00
Miss Islington (bot)
654e3c7435
[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 53ec7c8fc0)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-12-05 08:08:15 +00:00
Miss Islington (bot)
88e1f695f3
[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 8392095bf9)

Co-authored-by: Kir Chou <148194051+gkirchou@users.noreply.github.com>
Co-authored-by: Kir Chou <note351@hotmail.com>
2025-12-04 14:03:36 +00:00
Miss Islington (bot)
319c6a2ae1
[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 547d8daf78)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-12-04 00:03:18 +00:00
Miss Islington (bot)
027f21e417
[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 08d8e18ad8)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Jacob Walls <38668450+jacobtylerwalls@users.noreply.github.com>
2025-12-03 19:09:44 +00:00
Hugo van Kemenade
57e0d177c2 Python 3.14.1 2025-12-02 14:51:37 +02:00
Hugo van Kemenade
49fe7574d9
[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)"
2025-12-02 12:06:25 +00:00
Miss Islington (bot)
15a25f44ee
[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 5e58548ebe)

Co-authored-by: LloydZ <35182391+cocolato@users.noreply.github.com>
2025-12-02 05:06:26 +00:00
Hugo van Kemenade
7642070807
[3.14] Revert "GH-91636: Clear weakrefs created by finalizers. (GH-136401) (#141993)" (#142152) 2025-12-01 20:34:37 +02:00
Miss Islington (bot)
4ce27904b5
[3.14] gh-119451: Fix a potential denial of service in http.client (GH-119454) (#142138)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-01 20:34:09 +02:00
Miss Islington (bot)
afce34fbf0
[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>
2025-12-01 18:43:50 +02:00
Miss Islington (bot)
b64441e485
[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 694922cf40)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-01 15:54:58 +00:00
Serhiy Storchaka
29c657a1f2
[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.
2025-12-01 12:59:09 +00:00
Hugo van Kemenade
b95d16a338
[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 db098a475a)

Co-authored-by: Duprat <yduprat@gmail.com>
2025-11-30 13:06:56 -08:00
Miss Islington (bot)
52731c4e62
[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>
2025-11-30 14:35:14 +02:00