Commit graph

30515 commits

Author SHA1 Message Date
Miss Islington (bot)
4dfcdbe22c
[3.13] gh-148157: Check for _PyPegen_add_type_comment_to_arg fail in _PyPegen_name_default_pair (GH-148158) (#148163)
(cherry picked from commit 1795fccfbc)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-06 12:13:32 +00:00
Miss Islington (bot)
06f11ecff4
[3.13] gh-144418: Increase Android testbed emulator RAM to 4 GB (GH-148054) (#148151)
Pre-create the Android emulator image so that the the configuration can be
modified to use 4GB of RAM.
(cherry picked from commit a95ee3a21d)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2026-04-06 14:09:20 +08:00
Malcolm Smith
3ea97a26b6
[3.13] gh-146541: Allow building the Android testbed for 32-bit targets (GH-146542) (#148107)
Allows building the Android testbed for 32-bit targets, adding the target triplets
`arm-linux-androideabi` and `i686-linux-android`.
(cherry picked from commit 848bbe9ff2)

Co-authored-by: Robert Kirkman <31490854+robertkirkman@users.noreply.github.com>
2026-04-06 07:47:01 +08:00
Miss Islington (bot)
df89a705d0
[3.13] gh-145883: Fix two heap-buffer-overflows in _zoneinfo (GH-145885) (#148086)
(cherry picked from commit fe9befc1ca)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-04 17:14:19 +01:00
Miss Islington (bot)
140074eae6
[3.13] gh-146450: Normalise feature set of Android build script with other platform build scripts (GH-146451) (#148066)
Allows for cleaning a subset of targets, customization of the download cache and
cross-build directories, and modifies the build command to allow 'all', 'build'
and 'hosts' targets.
(cherry picked from commit b8470deb5d)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2026-04-04 12:27:56 +08:00
Miss Islington (bot)
9ff584503e
[3.13] gh-126676: Expand argparse docs for type=bool with warning and alternatives (GH-146435) (#148049)
gh-126676: Expand argparse docs for type=bool with warning and alternatives (GH-146435)
(cherry picked from commit 80d0a85d96)

Co-authored-by: Joshua Swanson <22283299+joshuaswanson@users.noreply.github.com>
Co-authored-by: joshuaswanson <joshuaswanson@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-04-03 12:10:09 -07:00
Łukasz Langa
89bfb8e5ed
[3.13] gh-143930: Tweak the exception message and increase test coverage (GH-146476) (GH-148045)
(cherry picked from commit 3681d47a44)
2026-04-03 19:45:02 +02:00
Miss Islington (bot)
52bc5c26a7
[3.13] gh-146615: Fix crash in __get__() for METH_METHOD descriptors with invalid type argument (GH-146634) (GH-146648)
(cherry picked from commit 72d29ea363)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2026-03-31 09:22:59 +00:00
AN Long
c09ccd9c42
[3.13] gh-146250: Fix memory leak in re-initialization of SyntaxError (GH-146251) (#146519)
* [3.13] gh-146250: Fix memory leak in re-initialization of `SyntaxError` (GH-146251)
(cherry picked from commit 0de4e08a59)

Co-authored-by: Brij Kapadia <97006829+bkap123@users.noreply.github.com>

* Minimize the changes

* Minimize the changes

* Minimize the changes

---------

Co-authored-by: Brij Kapadia <97006829+bkap123@users.noreply.github.com>
2026-03-30 21:36:52 +05:30
Miss Islington (bot)
472f1afa1c
[3.13] gh-146083: Upgrade bundled Expat to 2.7.5 (GH-146085) (#146604)
(cherry picked from commit e39d84a37d)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-29 18:50:07 +01:00
Miss Islington (bot)
6fdf084644
[3.13] gh-146090: fix memory management of internal sqlite3 callback contexts (GH-146569) (#146596)
gh-146090: fix memory management of internal `sqlite3` callback contexts (GH-146569)
(cherry picked from commit aa6680775d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-29 15:14:58 +02:00
Bénédikt Tran
59f33e82ff
[3.13] gh-146080: fix a crash in SNI callbacks when the SSL object is gone (GH-146573) (#146598)
(cherry picked from commit 24db78c532)
2026-03-29 13:07:15 +00:00
Malcolm Smith
793812b104
[3.13] gh-145616: Detect Android sysconfig ABI correctly on 32-bit ARM Android on 64-bit ARM kernel (GH-145617) (#146539)
When Python is running on 32-bit ARM Android on a 64-bit ARM kernel, `os.uname().machine` is `armv8l`. Such devices run the same userspace code as `armv7l` devices, so apply the same `armeabi_v7a` Android ABI to them, which works.
(cherry picked from commit 3a2b81e919)

Co-authored-by: Robert Kirkman <31490854+robertkirkman@users.noreply.github.com>
2026-03-28 08:25:35 +01:00
Miss Islington (bot)
78b8716af6
[3.13] gh-146310: Fix ensurepip to treat empty WHEEL_PKG_DIR as unset (GH-146357) (#146535)
gh-146310: Fix ensurepip to treat empty WHEEL_PKG_DIR as unset (GH-146357)

Path('') resolves to CWD, so an empty WHEEL_PKG_DIR string caused
ensurepip to search the current working directory for wheel files.
Add a truthiness check to treat empty strings the same as None.
(cherry picked from commit 73cc1fd4f4)

Co-authored-by: Imgyu Kim <kimimgo@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-27 21:10:44 +00:00
Brian Schubert
f4f598a28a
[3.13] gh-138891: fix star-unpack in get_annotations (GH-138951) (#146491)
(cherry picked from commit c6be6e4537)

Co-authored-by: Christoph Walcher <christoph-wa@gmx.de>
2026-03-26 21:39:27 +00:00
Victor Stinner
921515f603
[3.13] gh-145633: Fix struct.pack('f') on s390x (#146422) (#146461)
gh-145633: Fix struct.pack('f') on s390x (#146422)

Use PyFloat_Pack4() to raise OverflowError.
Add more tests on packing/unpacking floats.


(cherry picked from commit 8de70b31c5)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-03-26 11:45:10 +00:00
Matas Kaminskas
793a86f8a0
[3.13] gh-129259: Fix AIX build failures caused by incorrect struct alignment (GH-144917) 2026-03-24 02:47:53 +01:00
Brij Kapadia
4e372077c5
[3.13] gh-144475: Fix reference management in partial_repr (GH-145362) (#145882)
(cherry picked from commit 671a953dd6)
2026-03-24 02:30:45 +01:00
T. Wouters
684e7af8cd
[3.13] gh-142183: Cache one datachunk per tstate to prevent alloc/dealloc thrashing (GH-145789) (#146123)
* gh-142183: Cache one datachunk per tstate to prevent alloc/dealloc thrashing (GH-145789) (#145828)

Cache one datachunk per tstate to prevent alloc/dealloc thrashing when repeatedly hitting the same call depth at exactly the wrong boundary.

Move new _ts member to the end to not mess up remote debuggers' ideas of the
struct's layout. (The struct is only created by the runtime, and the new
field only used by the runtime, so it should be safe.)

(cherry picked from commit 706fd4ec08)
(cherry picked from commit 19cbcc0f85)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
2026-03-24 02:27:57 +01:00
Miss Islington (bot)
0d82ce82f1
[3.13] gh-146202: Create tmp_dir in regrtest worker (GH-146347) (#146350)
gh-146202: Create tmp_dir in regrtest worker (GH-146347)

Create tmp_dir in libregrtest.worker since the directory can be
different than the --tempdir directory.
(cherry picked from commit bcff99cb3f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-24 00:10:25 +00:00
Miss Islington (bot)
1f9958f909
[3.13] gh-145264: Do not ignore excess Base64 data after the first padded quad (GH-145267) (GH-146326) (GH-146348)
Base64 decoder (see binascii.a2b_base64(), base64.b64decode(), etc)
no longer ignores excess data after the first padded quad in non-strict
(default) mode.  Instead, in conformance with RFC 4648, it ignores the
pad character, "=", if it is present before the end of the encoded data.
(cherry picked from commit 4561f6418a)
(cherry picked from commit e31c551216)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-03-24 00:52:20 +01:00
Sergey Miryanov
eda53e6cf1
[3.13] GH-91636: Clear weakrefs created by finalizers. (GH-136401) (GH-144214)
Weakrefs to unreachable garbage that are created during running of
finalizers need to be cleared.  This avoids exposing objects that
have `tp_clear` called on them to Python-level code.
(cherry picked from commit b6b99bf7f1)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2026-03-24 00:50:41 +01:00
Miss Islington (bot)
43fe06b96f
[3.13] gh-143930: Reject leading dashes in webbrowser URLs (GH-146215)
(cherry picked from commit 82a24a4442)

Co-authored-by: Seth Michael Larson <seth@python.org>
2026-03-24 00:17:50 +01:00
Miss Islington (bot)
2f1e341b28
[3.13] gh-146245: Fix reference and buffer leaks via audit hook in socket module (GH-146248) (GH-146275)
(cherry picked from commit c30fae4bea)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-03-22 11:51:54 +00:00
Serhiy Storchaka
fab82679d3
[3.13] gh-146056: Fix repr() for lists containing NULLs (GH-146129) (GH-146155) (GH-146271)
(cherry picked from commit 0f2246b155)
(cherry picked from commit 796513306f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-22 08:06:17 +00:00
Sam Gross
fa2f9a3bf8
[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 1eff27f2c0)
2026-03-20 20:08:29 +00:00
Miss Islington (bot)
450e9eaf73
[3.13] gh-146076: Fix crash when a ZoneInfo subclass is missing a _weak_cache (GH-146082) (GH-146115)
(cherry picked from commit 3b06d68d8a)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-18 15:20:45 +00:00
Miss Islington (bot)
2147a5c9de
[3.13] gh-146054: Limit the growth of encodings.search_function cache (GH-146055) (GH-146068)
(cherry picked from commit 9d7621b75b)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-18 13:46:50 +01:00
Miss Islington (bot)
ae99fe3a33
[3.13] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long name handling (GH-145818)
(cherry picked from commit 42d754e34c)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Eashwar Ranganathan <eashwar@eashwar.com>
2026-03-17 10:51:43 +01:00
Miss Islington (bot)
d16ecc6c36
[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 57e88c1cf9)

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>
2026-03-16 14:05:13 +00:00
Miss Islington (bot)
196edfb06a
[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 eb0e8be3a7)

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>
2026-03-16 14:39:27 +05:30
Miss Islington (bot)
1d6e037b62
[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 00a25859a9)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2026-03-16 14:38:24 +05:30
Miss Islington (bot)
2070401411
[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 ee5318025b)

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>
2026-03-16 06:13:21 +00:00
Gregory P. Smith
102cd61763
[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
2026-03-15 22:35:53 +00:00
Bénédikt Tran
cd2e47135c
[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 97968564b6)
2026-03-14 11:00:56 +00:00
Stan Ulbrych
0b4f4c77f9
[3.13] gh-145783: Propagate errors raised in NEW_TYPE_COMMENT (GH-145784) (#145927) 2026-03-13 18:07:45 +00:00
Victor Stinner
b012f6817f
[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 08a018ebe0)
2026-03-12 23:17:00 +00:00
Łukasz Langa
3ae8cc8310
[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 e13f6dccd7)

Co-authored-by: Tan Long <tanloong@foxmail.com>
2026-03-12 18:15:17 +01:00
Miss Islington (bot)
e98936171b
[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 86a0756234)

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>
2026-03-12 11:21:43 +00:00
Miss Islington (bot)
cef423cbe2
[3.13] gh-145492: Fix defaultdict __repr__ infinite recursion (GH-145659) (GH-145746)
(cherry picked from commit 2d35f9bc1c)

Includes test fix-up from GH-145788
(cherry picked from commit aa4240ebea)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
2026-03-12 10:45:43 +01:00
Łukasz Langa
881cc06bac
[3.13] gh-139933: correctly suggest attributes for classes with a custom __dir__ (GH-139950) (GH-145827) (GH-145833)
(cherry picked from commit 4722202a1a)
(cherry picked from commit 0a80015ac2)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-11 22:02:01 +01:00
Miss Islington (bot)
af1ad53163
[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 665c1db94f)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2026-03-10 19:12:34 +00:00
Stan Ulbrych
37e9d846ff
[3.13] Fix integer overflow for formats "s" and "p" in the struct module (GH-145750) (GH-145777)
(cherry picked from commit 4d0dce0c8d)
2026-03-10 17:44:10 +00:00
krylosov-aa
ba0d1b7dee
[3.13] gh-145301: Fix double-free in hashlib initialization (GH-145321) (GH-145532)
(cherry picked from commit 6acaf659ef)
2026-03-10 14:59:37 +01:00
Miss Islington (bot)
cba8d1258a
[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 1564e231aa)

Co-authored-by: Daan De Meyer <daan.j.demeyer@gmail.com>
2026-03-10 10:11:21 +05:30
Miss Islington (bot)
321daaba4e
[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 63eaaf9599)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

* Add `:oss-fuzz:` macro support

Backports part of 255e79fa95.

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-09 14:44:31 -07:00
Ramin Farajpour Cami
b2894626aa
[3.13] gh-145623: Fix crashes on uninitialized struct.Struct objects (gh-145624) (GH-145631) 2026-03-09 17:41:45 +01:00
Pieter Eendebak
ae7206eb3b
[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 c1d7768321)

* 📜🤖 Added by blurb_it.

* Update Modules/md5module.c

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-06 22:24:20 +00:00
Miss Islington (bot)
5db017755b
[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 d931725bc8)

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>
2026-03-06 12:45:34 +00:00
Miss Islington (bot)
cc2c276f22
[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 dbe0007ab2)

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>
2026-03-05 17:44:29 +00:00