Commit graph

128575 commits

Author SHA1 Message Date
Miss Islington (bot)
38f23604c1
[3.14] gh-115634: document ProcessPoolExecutor max_tasks_per_child bug (GH-140897) (#143302)
gh-115634: document ProcessPoolExecutor max_tasks_per_child bug (GH-140897)
(cherry picked from commit 04899b8539)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-12-30 23:29:56 +00:00
Miss Islington (bot)
acd2846b9b
[3.14] gh-130167: Add a What's New entry for changes to `textwrap.{de,in}dent` (GH-131924) (#143292)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.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: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-30 13:03:03 +00:00
Miss Islington (bot)
d951905ec9
[3.14] gh-143284: Temporarily install Sphinx<9 to fix Chinese search (GH-143286) (#143290)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-30 12:39:28 +00:00
Miss Islington (bot)
ed73d4f281
[3.14] gh-69686: Remove untrue part of __import__ replacement docs (GH-143261) (#143281)
gh-69686: Remove untrue part of `__import__` replacement docs (GH-143261)

Remove untrue part of `__import__` replacement docs

The original statement effectively says that replacing `__import__` at global scope affects import statements, and not only that, but only import statements within the rest of the executing module. None of that has been true since at least Python 2.7, I think.

This was likely missed in python/cpython#69686.
(cherry picked from commit 79c03ac001)

Co-authored-by: Thanos <111999343+Sachaa-Thanasius@users.noreply.github.com>
2025-12-30 05:22:38 +00:00
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)
6583951e7d
[3.14] gh-131421: Fix ASDL kw_defaults being expr* instead of expr?* (GH-133773) (GH-143269)
Also fix docs ASDL highlighting.
(cherry picked from commit f37f57dfe6)

Co-authored-by: Samuel <samuel@knutsen.co>
2025-12-29 12:09:11 +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)
44841574ad
[3.14] gh-142994, gh-142996: document missing async generator and coroutine field entries in inspect (GH-142997) (#143258)
gh-142994, gh-142996: document missing async generator and coroutine field entries in `inspect` (GH-142997)
(cherry picked from commit 0efbad60e1)

Co-authored-by: wangxiaolei <fatelei@gmail.com>
2025-12-28 18:09:00 +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
Pablo Galindo Salgado
892757f056
[3.14] gh-143228: Fix UAF in perf trampoline during finalization (GH-143233) (#143247) 2025-12-28 14:32:11 +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)
bbe9ed95d4
[3.14] gh-142664: fix PyObject_Hash invokation post GH-143217 (GH-143223) (#143224)
gh-142664: fix `PyObject_Hash` invokation post GH-143217 (GH-143223)
(cherry picked from commit 84fcdbd86e)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-27 14:55:45 +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)
bae4cd6608
[3.14] no-issue: Fix override value in os.rst (gh-123522) (gh-143211) 2025-12-27 10:53:40 +00:00
Miss Islington (bot)
9316e4bb7e
[3.14] Fix typos in docs (GH-143193) (#143207)
Fix typos in docs (GH-143193)
(cherry picked from commit 57d569942c)

Co-authored-by: SYan212 <syan235711@gmail.com>
2025-12-27 07:58:01 +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)
88a4d0d34b
[3.14] gh-143145: Fix possible reference leak in ctypes _build_result() (GH-143131) (GH-143169)
The result tuple was leaked if __ctypes_from_outparam__() failed for any item.
(cherry picked from commit 579c5b496b)

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
2025-12-25 19:09:53 +02: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)
02282e5479
[3.14] gh-140717: Add exc_text to LogRecord attributes table (GH-140718) (GH-143152)
Co-authored-by: Tom Kuson <mail@tjkuson.me>
2025-12-25 12:41:42 +00: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)
bac24eed2a
[3.14] Move News for gh-142560 to Core and Builtins (GH-143154) (GH-143155)
(cherry picked from commit 305aff0a66)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-12-24 21:33:12 +02:00
Miss Islington (bot)
73c40bb8ba
[3.14] gh-143135: Fix sys.flags.inspect when PYTHONINSPECT=0 (GH-143136) (GH-143153)
(cherry picked from commit 3509fa5a12)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-24 18:23:41 +00: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
Hugo van Kemenade
e6b11c8861
[3.14] Update pre-commit with zizmor and Ruff fixes (GH-143095) (#143102) 2025-12-23 16:51:54 +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)
aee8c217bd
[3.14] gh-122431: Correct the non-negative error message in readline.append_history_file (GH-143075) (GH-143090)
gh-122431: Correct the non-negative error message in `readline.append_history_file` (GH-143075)

"positive" -> "non-negative", since zero is included.
(cherry picked from commit a273bc99d2)

Co-authored-by: Zheng Yu <dataisland@outlook.com>
2025-12-23 05:01:41 +00:00
Miss Islington (bot)
e25083abee
[3.14] gh-89152: Note truth testing exception in stdtypes.rst (GH-137640) (#143081)
gh-89152: Note truth testing exception in `stdtypes.rst` (GH-137640)
(cherry picked from commit 3c0888b25b)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-12-22 19:42:24 +00: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)
98f6db7e82
[3.14] gh-143057: avoid locking in tracemalloc C-APIs when it is not enabled (GH-143065) (#143071)
gh-143057: avoid locking in `tracemalloc` C-APIs when it is not enabled (GH-143065)
(cherry picked from commit e728b006de)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-12-22 16:04:24 +00: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)
362d11e545
[3.14] gh-70647: Better promote how to safely parse yearless dates in datetime. (GH-116179) (#143037)
gh-70647: Better promote how to safely parse yearless dates in datetime. (GH-116179)

* gh-70647: Better promote how to safely parse yearless dates in datetime.

Every four years people encounter this because it just isn't obvious.
This moves the footnote up to a note with a code example.

We'd love to change the default year value for datetime but doing
that could have other consequences for existing code.  This documented
workaround *always* works.

* doctest code within note is bad, dedent.

* Update to match the error message.

* remove no longer referenced footnote

* ignore the warning in the doctest

* use Petr's suggestion for the docs to hide the warning processing

* cover date.strptime (3.14) as well
(cherry picked from commit b8d3fddba6)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2025-12-21 06:52:55 +00: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)
586047a8d8
[3.14] gh-143012: use Py_ssize_t cast for PyBytes_FromStringAndSize (GH-143013) (#143014)
gh-143012: use `Py_ssize_t` cast for `PyBytes_FromStringAndSize` (GH-143013)
(cherry picked from commit 5989095dfd)

Co-authored-by: AZero13 <gfunni234@gmail.com>
2025-12-20 08:02:44 +00:00
stratakis
dcbde6b792
[3.14] gh-142776: Ensure fp file descriptor is closed on all code paths in import.c (GH-142777) (#142988)
gh-142776: Ensure fp file descriptor is closed on all code paths in import.c (GH-142777)

(cherry picked from commit 6a4f10325d)
2025-12-20 12:49:23 +05:30
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)
b46ce52a53
[3.14] gh-142527: Docs: Clarify that random.seed() discards the sign of an integer input (GH-142483) (#142970)
gh-142527: Docs: Clarify that random.seed() discards the sign of an integer input (GH-142483)

If *a* is an integer, the sign of *a* is discarded in the C source code. Clarify this behavior to prevent foot guns, where a common use case might naively assume that flipping the sign will produce different sequences (e.g. for a train/test split of a synthetic data generator in machine learning).
(cherry picked from commit 610aabfef2)

Co-authored-by: Andrej <andrej.karpathy@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-19 08:34:54 +00:00
Miss Islington (bot)
e48fb94d8c
[3.14] gh-118342: [Enum] update docs (GH-137290) (GH-142953)
gh-118342: [Enum] update docs (GH-137290)

(cherry picked from commit e79c39101a)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-18 11:18:46 -08: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)
693d8a1a10
[3.14] gh-137063: Document that ast node types replaced by Constant are no longer available (GH-137064) (GH-142930)
(cherry picked from commit fc80096a07)

Co-authored-by: James <snoopjedi@gmail.com>
2025-12-18 13:24:54 +01:00
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)
338bdb2415
[3.14] gh-142873: Do not check for PyContextVar_CheckExact twice in PyContextVar_Set (GH-142874) (#142893)
gh-142873: Do not check for `PyContextVar_CheckExact` twice in `PyContextVar_Set` (GH-142874)
(cherry picked from commit e61a447d0e)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-12-17 18:28:37 +00:00