]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Sam Gross [Fri, 20 Mar 2026 20:08:29 +0000 (16:08 -0400)]
[3.13] gh-146227: Fix wrong type in _Py_atomic_load_uint16 in pyatomic_std.h (gh-146229) (#146233)
Also fix a related issue in the pyatomic headers:
* Fix pseudo-code comment for _Py_atomic_store_ptr_release in
pyatomic.h.
(cherry picked from commit
1eff27f2c0452b3114bcf139062c87c025842c3e )
Miss Islington (bot) [Fri, 20 Mar 2026 16:40:55 +0000 (17:40 +0100)]
[3.13] gh-146092: Raise MemoryError on allocation failure in _zoneinfo (GH-146165) (#146224)
gh-146092: Raise MemoryError on allocation failure in _zoneinfo (GH-146165)
(cherry picked from commit
6450b1d142b6254d2e3b2eba47d69125ca79b3fe )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Wed, 18 Mar 2026 20:23:26 +0000 (21:23 +0100)]
[3.13] gh-146092: Handle _PyFrame_GetFrameObject() failures properly (GH-146124) (GH-146132) (#146138)
[3.14] gh-146092: Handle _PyFrame_GetFrameObject() failures properly (GH-146124) (GH-146132)
gh-146092: Handle _PyFrame_GetFrameObject() failures properly (GH-146124)
* Fix _PyFrame_GetLocals() and _PyFrame_GetLocals() error handling.
* _PyEval_ExceptionGroupMatch() now fails on _PyFrame_GetLocals()
error.
(cherry picked from commit
8eeb800faf5562e6ce3805416f656ab09243c9a6 )
(cherry picked from commit
e1e4852133ea548479bc9b975420a32331df7cee )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Wed, 18 Mar 2026 17:45:47 +0000 (18:45 +0100)]
[3.13] gh-146093: Fix csv _set_str(): check if PyUnicode_DecodeASCII() failed (GH-146113) (#146131)
gh-146093: Fix csv _set_str(): check if PyUnicode_DecodeASCII() failed (GH-146113)
The function can fail on a memory allocation failure.
Bug reported by devdanzin.
(cherry picked from commit
724c7c8146f44a7c737ec4588a1ee4b9db994f6f )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Wed, 18 Mar 2026 15:20:45 +0000 (16:20 +0100)]
[3.13] gh-146076: Fix crash when a `ZoneInfo` subclass is missing a `_weak_cache` (GH-146082) (GH-146115)
(cherry picked from commit
3b06d68d8a3cc1f37359af1d7ebb3d09e1222296 )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Wed, 18 Mar 2026 12:46:50 +0000 (13:46 +0100)]
[3.13] gh-146054: Limit the growth of `encodings.search_function` cache (GH-146055) (GH-146068)
(cherry picked from commit
9d7621b75bc4935e14d4f12dffb3cb1d89ea1bc6 )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Tue, 17 Mar 2026 09:51:43 +0000 (10:51 +0100)]
[3.13] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long name handling (GH-145818)
(cherry picked from commit
42d754e34c06e57ad6b8e7f92f32af679912d8ab )
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Eashwar Ranganathan <eashwar@eashwar.com>
Miss Islington (bot) [Tue, 17 Mar 2026 09:18:16 +0000 (10:18 +0100)]
[3.13] Docs: a brief note in the sets tutorial about order (GH-145984) (#146050)
Docs: a brief note in the sets tutorial about order (GH-145984)
(cherry picked from commit
4f5e79805ebcaa0d3ba1677694d4120a9e8f4513 )
Docs: a brief note in the sets tut about order
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Miss Islington (bot) [Mon, 16 Mar 2026 20:59:03 +0000 (21:59 +0100)]
[3.13] Docs: remove unmatched parenthesis for `asyncio.TaskGroup` note (GH-146035) (#146038)
Docs: remove unmatched parenthesis for `asyncio.TaskGroup` note (GH-146035)
(cherry picked from commit
4e96282ee42ab51cf325b52a0173ddddbe66c05c )
Co-authored-by: trag1c <dev@jakubr.me>
Sam Gross [Mon, 16 Mar 2026 16:11:56 +0000 (12:11 -0400)]
[3.13] gh-135329: Remove flaky test_repl_eio test (gh-145932) (#146029)
The test doesn't actually test any pyrepl code (it runs Python with -S)
and has a race condition that causes intermittent timeouts on CI.
(cherry picked from commit
e18abc6a1f1b60434b529d4c1ff4855acde0fd13 )
Miss Islington (bot) [Mon, 16 Mar 2026 14:05:13 +0000 (15:05 +0100)]
[3.13] gh-145599, CVE 2026-3644: Reject control characters in `http.cookies.Morsel.update()` (GH-145600) (#146024)
gh-145599, CVE 2026-3644: Reject control characters in `http.cookies.Morsel.update()` (GH-145600)
Reject control characters in `http.cookies.Morsel.update()` and `http.cookies.BaseCookie.js_output`.
(cherry picked from commit
57e88c1cf95e1481b94ae57abe1010469d47a6b4 )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <victor.stinner@gmail.com>
Miss Islington (bot) [Mon, 16 Mar 2026 09:09:27 +0000 (10:09 +0100)]
[3.13] gh-145986: Avoid unbound C recursion in `conv_content_model` in `pyexpat.c` (CVE 2026-4224) (GH-145987) (#145996)
* gh-145986: Avoid unbound C recursion in `conv_content_model` in `pyexpat.c` (CVE 2026-4224) (GH-145987)
Fix C stack overflow (CVE-2026-4224) when an Expat parser
with a registered `ElementDeclHandler` parses inline DTD
containing deeply nested content model.
---------
(cherry picked from commit
eb0e8be3a7e11b87d198a2c3af1ed0eccf532768 )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Remvoe `skip_if_unlimited_stack_size` decorator
* Remove more decorators not on this branch
---------
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Miss Islington (bot) [Mon, 16 Mar 2026 09:08:24 +0000 (10:08 +0100)]
[3.13] gh-145376: Fix GC tracking in `structseq.__replace__` (GH-145820) (#145924)
gh-145376: Fix GC tracking in `structseq.__replace__` (GH-145820)
(cherry picked from commit
00a25859a94b6bf34e58a5176e2befab7e273d20 )
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Miss Islington (bot) [Mon, 16 Mar 2026 06:13:21 +0000 (07:13 +0100)]
[3.13] gh-140814: Fix freeze_support() setting start method as side effect (GH-144608) (#146009)
gh-140814: Fix freeze_support() setting start method as side effect (GH-144608)
freeze_support() called get_start_method() without allow_none=True,
which locked in the default start method context. This caused a
subsequent set_start_method() call to raise "context has already been
set". Use allow_none=True and accept None as a matching value, since
spawn.freeze_support() independently detects spawned child processes.
Test that freeze_support() does not lock in the default start method,
which would prevent a subsequent set_start_method() call.
(cherry picked from commit
ee5318025b0f9f4d30d9358627df68181e0d223f )
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Gregory P. Smith [Sun, 15 Mar 2026 22:35:53 +0000 (15:35 -0700)]
[3.13] gh-145990: sort --help-env first section by name (others and xoptions already sorted) (GH-146003)
* sort `--help-env` sections by environment variable name
Only needed in the first section, in 3.13 the second section was already sorted.
* regression test for --help-env & --help-xoptions sort order
Manual backport of GH-145997
Miss Islington (bot) [Sun, 15 Mar 2026 14:08:23 +0000 (15:08 +0100)]
[3.13] gh-69223: Document that add_argument() returns an Action object (GH-145538) (#145596)
Co-authored-by: Andrew Barnes <bortstheboat@gmail.com>
Miss Islington (bot) [Sun, 15 Mar 2026 10:11:29 +0000 (11:11 +0100)]
[3.13] Bump mypy to 1.19.1 (GH-145956) (#145972)
Bump mypy to 1.19.1 (GH-145956)
(cherry picked from commit
e167e06f8c6b24f7b54e8d6b87c1cac1667dd2cf )
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Miss Islington (bot) [Sun, 15 Mar 2026 03:05:38 +0000 (04:05 +0100)]
[3.13] gh-141004: Document `PyDTrace*` (GH-141856) (GH-145958)
gh-141004: Document `PyDTrace*` (GH-141856)
(cherry picked from commit
1dfe99ae3bed6cac01732b47bf7fa637abadf51b )
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Bénédikt Tran [Sat, 14 Mar 2026 11:00:56 +0000 (12:00 +0100)]
[3.13] gh-143636: fix a crash when calling ``__replace__`` on invalid `SimpleNamespace` instances (GH-143655) (#145940)
[3.13] gh-143636: fix a crash when calling ``__replace__`` on invalid `SimpleNamespace` instances (GH-143655)
(cherry picked from commit
97968564b61965f2a65a9be8af731cee6913eb7a )
Miss Islington (bot) [Sat, 14 Mar 2026 09:25:21 +0000 (10:25 +0100)]
[3.13] Docs: fix missing period in `Doc/library/stdtypes.rst` (GH-145935) (#145937)
Docs: fix missing period in `Doc/library/stdtypes.rst` (GH-145935)
(cherry picked from commit
51e8acf8de1aa1f1751dd5bb84d44b8d42143b9c )
Co-authored-by: Connor Gibson <connor@nextdoortech.net>
Stan Ulbrych [Fri, 13 Mar 2026 18:07:45 +0000 (18:07 +0000)]
[3.13] gh-145783: Propagate errors raised in `NEW_TYPE_COMMENT` (GH-145784) (#145927)
Victor Stinner [Thu, 12 Mar 2026 23:17:00 +0000 (00:17 +0100)]
[3.13] gh-145801: Use gcc -fprofile-update=atomic for PGO builds (#145802) (#145893)
gh-145801: Use gcc -fprofile-update=atomic for PGO builds (#145802)
When Python build is optimized with GCC using PGO, use
-fprofile-update=atomic option to use atomic operations when updating
profile information. This option reduces the risk of gcov Data Files
(.gcda) corruption which can cause random GCC crashes.
(cherry picked from commit
08a018ebe0d673e9c352f790d2e4604d69604188 )
Łukasz Langa [Thu, 12 Mar 2026 17:15:17 +0000 (18:15 +0100)]
[3.13] gh-140131: Fix REPL cursor position on Windows when module completion suggestion line hits console width (GH-140333) (GH-145872)
(cherry picked from commit
e13f6dccd7a2f8df543a18c4a3ad92610dc087cb )
Co-authored-by: Tan Long <tanloong@foxmail.com>
Miss Islington (bot) [Thu, 12 Mar 2026 11:21:43 +0000 (12:21 +0100)]
[3.13] gh-140594: Fix an out of bounds read when feeding NUL byte to PyOS_StdioReadline() (GH-140910) (#145853)
gh-140594: Fix an out of bounds read when feeding NUL byte to PyOS_StdioReadline() (GH-140910)
(cherry picked from commit
86a0756234df7ce42fa4731c91067cb7f2e244d5 )
Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Thu, 12 Mar 2026 09:45:43 +0000 (10:45 +0100)]
[3.13] gh-145492: Fix defaultdict __repr__ infinite recursion (GH-145659) (GH-145746)
(cherry picked from commit
2d35f9bc1cf61b27639ed992dfbf363ab436fd8b )
Includes test fix-up from GH-145788
(cherry picked from commit
aa4240ebea1aacc907b1efa58e7f547d90cff3b1 )
Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
Łukasz Langa [Wed, 11 Mar 2026 21:02:01 +0000 (22:02 +0100)]
[3.13] gh-139933: correctly suggest attributes for classes with a custom `__dir__` (GH-139950) (GH-145827) (GH-145833)
(cherry picked from commit
4722202a1a81974089801e6173d269836b6a074f )
(cherry picked from commit
0a80015ac26d60bff54f57ce9f73ffc5386249b1 )
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Miss Islington (bot) [Wed, 11 Mar 2026 13:31:51 +0000 (14:31 +0100)]
[3.13] gh-99875: Document rounding mode for old-style formatting (GH-126382) (#145812)
gh-99875: Document rounding mode for old-style formatting (GH-126382)
(cherry picked from commit
ce1abaf9b83f8535749c6d3d0a0fabf15d87079f )
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Miss Islington (bot) [Wed, 11 Mar 2026 12:43:12 +0000 (13:43 +0100)]
[3.13] Warn that overriding `__builtins__` for `eval` is not a security mechanism (GH-145773) (GH-145807)
(cherry picked from commit
eb9ae65e5b1cdfcf4f60d36c0353c857bc27b92f )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Miss Islington (bot) [Wed, 11 Mar 2026 08:08:51 +0000 (09:08 +0100)]
[3.13] gh-101100: Fix sphinx reference warnings around I/O (GH-139592) (#145795)
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Miss Islington (bot) [Wed, 11 Mar 2026 04:08:06 +0000 (05:08 +0100)]
[3.13] gh-145607: Ensure BIG_DATA has two compressed blocks in test_bz2 (GH-145730) (#145734)
gh-145607: Ensure BIG_DATA has two compressed blocks in test_bz2 (GH-145730)
(cherry picked from commit
19676e5fc28bdee8325a062a31ddeee60960cf75 )
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Miss Islington (bot) [Tue, 10 Mar 2026 19:12:34 +0000 (20:12 +0100)]
[3.13] gh-142763: Fix race in ZoneInfo cache eviction (gh-144978) (#145782)
The cache may be cleared between the evaluation of the if statement and the
call to popitem.
(cherry picked from commit
665c1db94f46f8e1a18a8c2f89adb3bc72cb83dc )
Co-authored-by: Sam Gross <colesbury@gmail.com>
Stan Ulbrych [Tue, 10 Mar 2026 17:44:10 +0000 (17:44 +0000)]
[3.13] Fix integer overflow for formats "s" and "p" in the struct module (GH-145750) (GH-145777)
(cherry picked from commit
4d0dce0c8ddc4d0321bd590a1a33990edc2e1b08 )
Miss Islington (bot) [Tue, 10 Mar 2026 17:05:07 +0000 (18:05 +0100)]
[3.13] gh-144173: fix flaky test_complex.test_truediv() (GH-144355) (#145767)
gh-144173: fix flaky test_complex.test_truediv() (GH-144355)
Previously, component-wise relative error bound was tested. However,
such bound can't exist already for complex multiplication as one can be
used to perform subtraction of floating-point numbers, e.g. x and y for
z0=1+1j and z1=x+yj.
```pycon
>>> x, y = 1e-9+1j, 1+1j
>>> a = x*y*y.conjugate()/2;a
(1.
0000000272292198e -09+1j)
>>> b = x*(y*y.conjugate()/2);b
(1e-09+1j)
>>> b == x
True
>>> (a.real-b.real)/math.ulp(b.real)
131672427 .0
```
(cherry picked from commit
c4333a12708a917d1cfb6418c04be45793ecc392 )
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Miss Islington (bot) [Tue, 10 Mar 2026 16:52:27 +0000 (17:52 +0100)]
[3.13] gh-145743: Fix inconsistency after calling Struct.__init__() with invalid format (GH-145744) (GH-145764)
Only set the format attribute after successful (re-)initialization.
(cherry picked from commit
3f33bf83e8496737b86333bc9ec55dc3ccb3faca )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Petr Viktorin [Tue, 10 Mar 2026 15:01:52 +0000 (16:01 +0100)]
[3.13] gh-145548: Don't use VMADDR_CID_LOCAL from `socket` (GH-145735)
VMADDR_CID_LOCAL was added to `socekt` in 3.14. The test needs a
local constant in setUp(), as in clientSetUp().
Miss Islington (bot) [Tue, 10 Mar 2026 14:26:18 +0000 (15:26 +0100)]
[3.13] gh-106318: Add examples for str.isspace() docs (GH-145399) (#145753)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Miss Islington (bot) [Tue, 10 Mar 2026 14:17:18 +0000 (15:17 +0100)]
[3.13] Docs: Update programming FAQ (GH-144573) (#145696)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
krylosov-aa [Tue, 10 Mar 2026 13:59:37 +0000 (16:59 +0300)]
[3.13] gh-145301: Fix double-free in hashlib initialization (GH-145321) (GH-145532)
(cherry picked from commit
6acaf659ef0fdee131bc02f0b58685da039b5855 )
Miss Islington (bot) [Tue, 10 Mar 2026 12:34:37 +0000 (13:34 +0100)]
[3.13] gh-142651: use `NonCallableMock._lock` for thread safety of `call_count` (GH-142922) (#145740)
gh-142651: use `NonCallableMock._lock` for thread safety of `call_count` (GH-142922)
(cherry picked from commit
728e4a075e3dae7e04edf90ad137a35073deb141 )
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Hugo van Kemenade [Tue, 10 Mar 2026 11:38:34 +0000 (13:38 +0200)]
[3.13] gh-140715: Improve class reference links on datetime.rst (GH-123980) (#145389)
Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Tue, 10 Mar 2026 09:32:06 +0000 (10:32 +0100)]
[3.13] Document that PyType_GetModule returns a borrowed ref (GH-145612) (GH-145732)
(cherry picked from commit
44855458a423569eaea3df53fd5a0c0032da932d via
30bcdcd379445b942e1278244bbce805dc32b5a2 )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Miss Islington (bot) [Tue, 10 Mar 2026 04:41:21 +0000 (05:41 +0100)]
[3.13] gh-145541: Fix `InvalidStateError` in `BaseSubprocessTransport._call_connection_lost()` (GH-145554) (#145677)
gh-145541: Fix `InvalidStateError` in `BaseSubprocessTransport._call_connection_lost()` (GH-145554)
(cherry picked from commit
1564e231aae7afad5b9b19a277d1efff2b840ad2 )
Co-authored-by: Daan De Meyer <daan.j.demeyer@gmail.com>
Miss Islington (bot) [Mon, 9 Mar 2026 21:44:31 +0000 (22:44 +0100)]
[3.13] gh-145701: Fix `__classdict__` & `__conditional_annotations__` in class-scope inlined comprehensions (GH-145702) (#145711)
* gh-145701: Fix `__classdict__` & `__conditional_annotations__` in class-scope inlined comprehensions (GH-145702)
(cherry picked from commit
63eaaf95999c530cbd75b3addc3e660499d3adbe )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* Add `:oss-fuzz:` macro support
Backports part of https://github.com/python/cpython/commit/
255e79fa955ac5ffef9eb27087e8b1373e98e3bd .
---------
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Mon, 9 Mar 2026 19:49:51 +0000 (20:49 +0100)]
[3.13] Remove the `distutils-sig@python.org` email in 'Installing Python Modules' (GH-145613) (#145709)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Mon, 9 Mar 2026 16:43:01 +0000 (17:43 +0100)]
[3.13] gh-141617: clarify `concurrent.futures.ThreadPoolExecutor` deadlock example (GH-141620) (#145687)
gh-141617: clarify `concurrent.futures.ThreadPoolExecutor` deadlock example (GH-141620)
---------
(cherry picked from commit
171133aa84cd2fa8738bdbb0c76435645810e8d3 )
Co-authored-by: Yashraj <yashrajpala8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Ramin Farajpour Cami [Mon, 9 Mar 2026 16:41:45 +0000 (20:11 +0330)]
[3.13] gh-145623: Fix crashes on uninitialized struct.Struct objects (gh-145624) (GH-145631)
Miss Islington (bot) [Sun, 8 Mar 2026 23:04:57 +0000 (00:04 +0100)]
[3.13] gh-145642: Docs: Avoid warning for invalid escape sequence in tutorial (GH-145643) (#145646)
gh-145642: Docs: Avoid warning for invalid escape sequence in tutorial (GH-145643)
---------
(cherry picked from commit
5a15a52dd1dee37af4f2b3a6b15a9f5735f75c6e )
Co-authored-by: James <snoopjedi@gmail.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Miss Islington (bot) [Sun, 8 Mar 2026 08:02:39 +0000 (09:02 +0100)]
[3.13] gh-145376: Fix refleak in `queuemodule.c` out-of-memory path (GH-145543) (#145621)
gh-145376: Fix refleak in `queuemodule.c` out-of-memory path (GH-145543)
(cherry picked from commit
0aeaaafac476119f242fe717ce60d2070172127b )
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Miss Islington (bot) [Sat, 7 Mar 2026 17:15:16 +0000 (18:15 +0100)]
[3.13] Remove typo in ``functools.lru_cache`` docs (GH-140278) (#145627)
Co-authored-by: Brandon Hubacher <brandon.hubacher@gmail.com>
Pieter Eendebak [Fri, 6 Mar 2026 22:24:20 +0000 (23:24 +0100)]
[3.13] gh-145376: Fix crashes in md5module.c (GH-145422) (#145611)
* gh-145376: Fix crashes in md5module.c
Fix a possible NULL pointer dereference in `md5module.c`.
This can only occur in error paths taken when the interpreter fails to allocate memory.
(cherry-picked from
c1d77683213c400fca144692654845e6f5418981 )
* 📜🤖 Added by blurb_it.
* Update Modules/md5module.c
---------
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Miss Islington (bot) [Fri, 6 Mar 2026 20:34:45 +0000 (21:34 +0100)]
[3.13] gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589) (#145594)
gh-145548: Use VMADDR_CID_LOCAL in VSOCK socket tests (GH-145589)
Prefer VMADDR_CID_LOCAL instead of VMADDR_CID_ANY for bind() in the
server. Skip the test if bind() fails with EADDRNOTAVAIL.
Log vsock CID in test.pythoninfo.
(cherry picked from commit
6c8c72f7feb4207c62ac857443943e61977d6a94 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Fri, 6 Mar 2026 12:45:34 +0000 (13:45 +0100)]
[3.13] gh-144370: Disallow usage of control characters in status in wsgiref.handlers for security (GH-144371) (#145585)
gh-144370: Disallow usage of control characters in status in wsgiref.handlers for security (GH-144371)
Disallow usage of control characters in status in wsgiref.handlers
to prevent HTTP header injections.
(cherry picked from commit
d931725bc850cd096f6703bc285e885f1e015f05 )
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Hugo van Kemenade [Fri, 6 Mar 2026 11:49:53 +0000 (13:49 +0200)]
[3.13] Docs: `import datetime as dt` in examples (GH-145315) (#145584)
Miss Islington (bot) [Fri, 6 Mar 2026 10:22:19 +0000 (11:22 +0100)]
[3.13] gh-122941: Fix test_launcher sporadic failures via py.ini isolation (GH-145090)
Adds _PYLAUNCHER_INIDIR as a private variable since the launcher is deprecated and not getting new features.
(cherry picked from commit
6cdbd7bc5d4ee63459d03a944477ea8671a05198 )
Co-authored-by: Itamar Oren <itamarost@gmail.com>
Miss Islington (bot) [Fri, 6 Mar 2026 08:51:02 +0000 (09:51 +0100)]
[3.13] doc: Clarify logger creation example in logging HOWTO (GH-145540) (GH-145561)
(cherry picked from commit
e0945443a0abdee56a51a5cb82a31edba5f1adab )
Co-authored-by: Yash Kaushik <yash005kaushik@gmail.com>
Miss Islington (bot) [Fri, 6 Mar 2026 06:50:06 +0000 (07:50 +0100)]
[3.13] Docs: use a Sphinx extension to eliminate excessive links (GH-145130) (#145574)
Docs: use a Sphinx extension to eliminate excessive links (GH-145130)
(cherry picked from commit
15f6479c415cc6cd219cd25c1d94bab17d720cbc )
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Miss Islington (bot) [Thu, 5 Mar 2026 17:44:29 +0000 (18:44 +0100)]
[3.13] gh-145417: Do not preserve SELinux context when copying venv scripts (GH-145454) (#145550)
gh-145417: Do not preserve SELinux context when copying venv scripts (GH-145454)
(cherry picked from commit
dbe0007ab2ff679c85d88e62fb875437b2dc2522 )
Co-authored-by: Shrey Naithani <shrey.naithani@shelllite.tech>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Thu, 5 Mar 2026 14:34:49 +0000 (15:34 +0100)]
[3.13] gh-143304: Fix ctypes.CDLL to honor handle parameter on POSIX systems (GH-143318) (GH-145173)
The handle parameter was being ignored in the POSIX implementation
of CDLL._load_library(), causing it to always call _dlopen() even
when a valid handle was provided. This was a regression introduced
in recent refactoring.
(cherry picked from commit
27ded243485670fa836c9bb421e37a6ef16eca8e )
Co-authored-by: Arjit Singh Grover <143692910+Koolvansh07@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Wed, 4 Mar 2026 20:17:04 +0000 (21:17 +0100)]
[3.13] gh-145506: Fixes CVE-2026-2297 by ensuring SourcelessFileLoader uses io.open_code (GH-145507)
(cherry picked from commit
a51b1b512de1d56b3714b65628a2eae2b07e535e )
Co-authored-by: Steve Dower <steve.dower@python.org>
Miss Islington (bot) [Wed, 4 Mar 2026 19:47:34 +0000 (20:47 +0100)]
[3.13] GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740) (GH-145494) (#145510)
[3.14] GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740) (GH-145494)
GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740)
(cherry picked from commit
45e9343d7eed1d9e784e731cc9af853fa8649e59 )
(cherry picked from commit
bcc2dd8d30eb20995186c756bdcd10a56a1bad1c )
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Miss Islington (bot) [Tue, 3 Mar 2026 13:25:13 +0000 (14:25 +0100)]
[3.13] gh-145455: Show output of blurb & sphinx-build version commands (GH-145457) (GH-145462)
In gh-145455, an outdated dependency caused an import error that was not
printed out (`2>&1`); the message instead said that the tools are missing.
Don't redirect stderr, to show warnings and failures.
Also, switch `blurb` to output a version on a single line (`--version` rather
than `help`), and, and don't redirect stdout either.
This results in two version info lines being printed out. These get drowned
in typical Sphinx output, and can be helpful when debugging.
(cherry picked from commit
f1de65b3669226d563802a32b78a2294e971151a )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Miss Islington (bot) [Tue, 3 Mar 2026 12:51:20 +0000 (13:51 +0100)]
[3.13] GH-145450: Document missing `wave.Wave_write` getter methods (GH-145451) (GH-145467)
(cherry picked from commit
db41717cd50af6db7d496b0aa282b1f3370327c6 )
Co-authored-by: Michiel W. Beijen <mb@x14.nl>
Miss Islington (bot) [Tue, 3 Mar 2026 12:13:02 +0000 (13:13 +0100)]
[3.13] gh-106318: Fix incorrectly rendered code block in `str.isalnum()` docs (GH-144718) (GH-144729)
(cherry picked from commit
f912c835b94d75ae4823153c160f0cc674a243bb )
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Miss Islington (bot) [Tue, 3 Mar 2026 11:47:57 +0000 (12:47 +0100)]
[3.13] gh-142781: Fix type confusion in zoneinfo weak cache (GH-142925) (GH-145418)
(cherry picked from commit
b611db491d16ebbb4c833e9a184bb987e41f9fbe )
Co-authored-by: zhong <60600792+superboy-zjc@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Stan Ulbrych [Mon, 2 Mar 2026 23:00:59 +0000 (23:00 +0000)]
[3.13] gh-144872: fix heap buffer overflow `_PyTokenizer_ensure_utf8` (GH-144807) (#145441)
(cherry picked from commit
3fc945df22a169e039c3f21b44c0d08390a00c0c )
Co-authored-by: AdamKorcz <44787359+AdamKorcz@users.noreply.github.com>
Miss Islington (bot) [Mon, 2 Mar 2026 21:31:46 +0000 (22:31 +0100)]
[3.13] gh-143880: Fix data race in `functools.partial` in free threading build (GH-143882) (#145435)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Miss Islington (bot) [Mon, 2 Mar 2026 21:19:05 +0000 (22:19 +0100)]
[3.13] Hide "object" prefix on dunders in contextlib docs & selectivly link some more (GH-145436) (#145444)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Ken Jin [Mon, 2 Mar 2026 20:09:02 +0000 (04:09 +0800)]
[3.13] gh-145008: Maintain stack consistency in CALL_BOUND_METHOD_EXACT_ARGS (GH-145015)
Sam Gross [Mon, 2 Mar 2026 20:03:08 +0000 (15:03 -0500)]
[3.13] gh-130327: Always traverse managed dictionaries, even when inline values are available (GH-130469) (#145440)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Sam Gross [Mon, 2 Mar 2026 18:59:52 +0000 (13:59 -0500)]
[3.13] gh-130555: Fix use-after-free in dict.clear() with embedded values (gh-145268) (#145430)
Miss Islington (bot) [Mon, 2 Mar 2026 18:32:29 +0000 (19:32 +0100)]
[3.13] gh-145335: Fix crash when passing -1 as fd in os.pathconf (GH-145390) (#145432)
gh-145335: Fix crash when passing -1 as fd in os.pathconf (GH-145390)
(cherry picked from commit
5c3a47b94a39f87c36b1f36704d80775802ad034 )
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Thomas Kowalski [Mon, 2 Mar 2026 18:16:33 +0000 (19:16 +0100)]
[3.13] gh-145349: Do not install ccache (#145350) (#145424)
Miss Islington (bot) [Mon, 2 Mar 2026 13:32:13 +0000 (14:32 +0100)]
[3.13] gh-144835: Added missing explanations for some parameters in glob and iglob. (GH-144836) (#145416)
Co-authored-by: Facundo Batista <facundo@taniquetil.com.ar>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Thomas Kowalski [Sun, 1 Mar 2026 20:41:41 +0000 (21:41 +0100)]
[3.13] gh-145351: use `--no-install-recommends` (GH-145352) (#145402)
Miss Islington (bot) [Sun, 1 Mar 2026 20:11:38 +0000 (21:11 +0100)]
[3.13] gh-100538: Add workflow to verify bundled libexpat (GH-145359) (#145400)
gh-100538: Add workflow to verify bundled libexpat (GH-145359)
Add workflow to verify bundled libexpat.
(cherry picked from commit
c9a5d9aae48a9faa553a5e8137ff1b5e261f6bf6 )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Miss Islington (bot) [Sat, 28 Feb 2026 23:20:20 +0000 (00:20 +0100)]
[3.13] gh-145269: simplify bisect.bisect doc example (GH-145270) (#145368)
gh-145269: simplify bisect.bisect doc example (GH-145270)
---------
(cherry picked from commit
fdb4b3527f356a84bc00ca32516181016400e567 )
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Stan Ulbrych [Sat, 28 Feb 2026 19:05:52 +0000 (19:05 +0000)]
[3.13] Move news entry (#145366)
Move news entry
Kumar Aditya [Sat, 28 Feb 2026 18:53:27 +0000 (00:23 +0530)]
[3.13] gh-142352: Fix asyncio start_tls() to transfer buffered data from StreamReader (GH-142354) (#145364)
[3.13] gh-142352: Fix `asyncio` `start_tls()` to transfer buffered data from StreamReader (GH-142354)
(cherry picked from commit
0598f4a8999b96409e0a2bf9c480afc76a876860 )
Co-authored-by: Maksym Kasimov <39828623+kasimov-maxim@users.noreply.github.com>
Stan Ulbrych [Sat, 28 Feb 2026 18:48:12 +0000 (18:48 +0000)]
[3.13] Move NEWS entries out of directories with spaces (GH-145357)
Re-do on updated branch
Stan Ulbrych [Sat, 28 Feb 2026 13:49:37 +0000 (13:49 +0000)]
[3.13] gh-144759: Fix undefined behavior from NULL pointer arithmetic in lexer (GH-144788) (#145355)
Pablo Galindo Salgado [Sat, 28 Feb 2026 01:38:36 +0000 (01:38 +0000)]
[3.13] gh-145234: Normalize decoded CR in string tokenizer (GH-145281) (#145312)
Miss Islington (bot) [Fri, 27 Feb 2026 15:31:49 +0000 (16:31 +0100)]
[3.13] gh-144693: Clarify that `PyFrame_GetBack` does not raise exceptions (GH-144824) (GH-145319)
gh-144693: Clarify that `PyFrame_GetBack` does not raise exceptions (GH-144824)
(cherry picked from commit
8775f900179aa21e6e9ec318dbb5c7cfd3561b66 )
Co-authored-by: Taegyun Kim <k.taegyun@gmail.com>
Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Miss Islington (bot) [Fri, 27 Feb 2026 15:17:22 +0000 (16:17 +0100)]
[3.13] gh-141004: Document missing type flags (GH-145127) (GH-145317)
gh-141004: Document missing type flags (GH-145127)
(cherry picked from commit
dc1b56aa03a1764e7c6bbcbf190b1c293eb5c462 )
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Miss Islington (bot) [Fri, 27 Feb 2026 00:13:08 +0000 (01:13 +0100)]
[3.13] gh-142787: Handle empty sqlite3 blob slices (GH-142824) (#145298)
(cherry picked from commit
06b0920f1292690a22ab2b271dfefe2c63cacf07 )
Co-authored-by: A.Ibrahim <abdulrasheedibrahim47@gmail.com>
Miss Islington (bot) [Thu, 26 Feb 2026 13:48:01 +0000 (14:48 +0100)]
[3.13] gh-106318: Add examples for str.rjust() method (GH-143890) (#145256)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Stan Ulbrych [Tue, 24 Feb 2026 22:27:40 +0000 (22:27 +0000)]
[3.13] gh-88091: Fix `unicodedata.decomposition()` for Hangul Syllables (GH-144993) (GH-145190)
(cherry picked from commit
56c4f10d6e474604a162521228b5f3b5ff79236c )
R. David Murray [Tue, 24 Feb 2026 20:55:54 +0000 (15:55 -0500)]
[3.13] gh-144156: Fix email header folding concatenating encoded words (GH-144692) (#145195)
The fix for gh-92081 (gh-92281) was unfortunately flawed, and broke whitespace handling for encoded word patterns that had previously been working correctly but had no corresponding tests, unfortunately in a way that made the resulting headers not RFC compliant, in such a way that Yahoo started rejecting the resulting emails. This fix was released in 3.14 alpha 1, 3.13 beta 2 and 3.12.5. This PR fixes the original problem in a way that does not break anything, and in fact fixes a small pre-existing bug (a spurious whitespace after the ':' of the header label if the header value is immediately wrapped on to the next line). (RDM)
(cherry picked from commit
0f7cd5544a4dd1d7cf892c93c661510d619caaa7 )
Co-authored-by: Robsdedude <dev@rouvenbauer.de>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Miss Islington (bot) [Tue, 24 Feb 2026 17:20:53 +0000 (18:20 +0100)]
[3.13] gh-137335: Fix unlikely name conflicts for named pipes in multiprocessing and asyncio on Windows (GH-137389) (GH-145171)
Since os.stat() raises an OSError for existing named pipe "\\.\pipe\...",
os.path.exists() always returns False for it, and tempfile.mktemp() can
return a name that matches an existing named pipe.
So, tempfile.mktemp() cannot be used to generate unique names for named
pipes. Instead, CreateNamedPipe() should be called in a loop with
different names until it completes successfully.
(cherry picked from commit
d6a71f4690c702892644b1fbae90ae9ef733a8ab )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Tue, 24 Feb 2026 13:18:48 +0000 (14:18 +0100)]
[3.13] Fix `inspect.Parameter` docstring on the `kind` attribute (GH-143541) (GH-145175)
(cherry picked from commit
4c95ad8e495646eae4130957e0a4c1cc5ef19120 )
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Miss Islington (bot) [Tue, 24 Feb 2026 11:37:52 +0000 (12:37 +0100)]
[3.13] gh-66305: Fix a hang on Windows in the tempfile module (GH-144672) (GH-145169)
It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
(cherry picked from commit
ca66d3c40cd9ac1fb94dd7cd79ccb8fecf019527 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Tue, 24 Feb 2026 01:16:45 +0000 (02:16 +0100)]
[3.13] `_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158) (#145163)
`_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158)
Avoid possible undefined behaviour from signed overflow in `struct` module
As discovered via oss-fuzz.
(cherry picked from commit
fd0400585eb957c7d10812d87a8cb9e1f3c72519 )
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Savannah Ostrowski [Mon, 23 Feb 2026 18:16:00 +0000 (10:16 -0800)]
[3.13] Add Savannah as `jit.yml` CODEOWNER (GH-145152) (#145156)
* Add Savannah as `jit.yml` CODEOWNER (#145152)
(cherry picked from commit
6180e79ed2175f7b095807b78a5ea58b4da3de0b )
Peter Bierma [Mon, 23 Feb 2026 15:11:21 +0000 (10:11 -0500)]
[3.13] gh-141004: Document `PyModuleDef_Type` (GH-145043) (GH-145147)
(cherry picked from commit
24cc998c164f137603f1c6d95b929d640211d237 )
Miss Islington (bot) [Mon, 23 Feb 2026 13:38:04 +0000 (14:38 +0100)]
[3.13] gh-143916: Allow HTAB in wsgiref header values (GH-144762)
(cherry picked from commit
66da7bf6fe7b81e3ecc9c0a25bd47d4616c8d1a6 )
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Sun, 22 Feb 2026 08:28:24 +0000 (09:28 +0100)]
[3.13] gh-145092: Fix compiler warning for memchr() and wcschr() returning const pointer (GH-145093) (GH-145101)
(cherry picked from commit
faea32b729e132172d39d54517822e772ad0017a )
Co-authored-by: Rudi Heitbaum <rudi@heitbaum.com>
Bénédikt Tran [Sat, 21 Feb 2026 15:05:57 +0000 (16:05 +0100)]
[3.13] gh-143698: correctly check `scheduler` and `setpgroup` values for `os.posix_spawn[p]` (GH-143699) (#145074)
* [3.13] gh-143698: correctly check `scheduler` and `setpgroup` values for `os.posix_spawn[p]` (GH-143699)
Fix an issue where passing invalid arguments to `os.posix_spawn[p]` functions
raised a SystemError instead of a TypeError, and allow to explicitly use `None`
for `scheduler` and `setpgroup` as specified in the docs.
(cherry picked from commit
347fc438cf903c1d7fa5063464ae2e93c11b2232 )
Stan Ulbrych [Sat, 21 Feb 2026 12:24:53 +0000 (12:24 +0000)]
[3.13] `compute-changes.py`: Fix & test `process_changed_files()` (GH-144674) (#145014)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
Miss Islington (bot) [Sat, 21 Feb 2026 05:42:39 +0000 (06:42 +0100)]
[3.13] gh-144694: Fix re.Match.group() doc claiming [1..99] range limit (GH-144696) (#145066)
gh-144694: Fix re.Match.group() doc claiming [1..99] range limit (GH-144696)
The documentation incorrectly stated that numeric group arguments
must be in the range [1..99]. This limit was removed in Python 3.5
(bpo-22437). Replace with "a positive integer" since the next
sentence already documents the IndexError for out-of-range values.
(cherry picked from commit
85021bc2477f3ab394172b6dda3110e59f4777dd )
Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
Miss Islington (bot) [Sat, 21 Feb 2026 00:46:53 +0000 (01:46 +0100)]
[3.13] gh-144748: Document 3.12 and 3.14 changes to `PyErr_CheckSignals` (GH-144982) (GH-145063)
* gh-144748: Document 3.12 and 3.14 changes to `PyErr_CheckSignals` (GH-144982)
(cherry picked from commit
06292614ff7cef0ba28da6dfded58fb0e731b2e3 )
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Miss Islington (bot) [Thu, 19 Feb 2026 23:11:16 +0000 (00:11 +0100)]
[3.13] Correct MAX_N in Lib/zipfile ZipExtFile (GH-144973) (GH-145023)
"<<" has lower precedence than "-".
(cherry picked from commit
4141f0a1ee6a6e9d5b4ba24f15a9d17df6933321 )
Co-authored-by: J Berg <j.berg2349@gmail.com>