Commit graph

125679 commits

Author SHA1 Message Date
Serhiy Storchaka
def8ea08a1
[3.13] gh-146615: Fix format specifiers in test cextensions (GH-146618) (GH-146653)
(cherry picked from commit b7055533ab)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2026-03-31 08:38: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
Hugo van Kemenade
0dcb625be4
[3.13] gh-145098: Run Apple Silicon macOS CI on macos-26 (Tahoe) (GH-145099) (GH-146412) (#146414)
Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: clintonsteiner <47841949+clintonsteiner@users.noreply.github.com>
2026-03-30 16:21:40 +03:00
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
Miss Islington (bot)
d0991b1e0f
[3.13] gh-146544: Fix asyncio.Queue docstring ambiguity (GH-146545) (#146568)
gh-146544: Fix `asyncio.Queue` docstring ambiguity (GH-146545)
(cherry picked from commit 578d726d46)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
2026-03-28 11:27:59 +00:00
Miss Islington (bot)
7aeb66ca9e
[3.13] Docs: don't rely on implicit 'above' directions in socket docs (GH-146426) (#146561)
Docs: don't rely on implicit 'above' directions in socket docs (GH-146426)
(cherry picked from commit 3ff582238f)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2026-03-28 05:53:21 -04: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
Sergey Miryanov
ef8475f492
[3.13] Fix possible memory leak in OrderedDict popitem (GH-145247) (#146538) 2026-03-27 21:40:23 +00: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
Miss Islington (bot)
b0fab92039
[3.13] Mention _Float16 (type from Annex H of the C23) in the struct docs (GH-146243) (#146530)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2026-03-27 17:44:29 +00:00
Victor Stinner
04fe383602
[3.13] gh-146480: Add tests on _PyErr_SetKeyError() (#146486) (#146512)
gh-146480: Add tests on _PyErr_SetKeyError() (#146486)

(cherry picked from commit d4153a9f76)
2026-03-27 14:09:46 +01:00
Miss Islington (bot)
9ee6b67ee9
[3.13] gh-146059: Cleanup pickle fast_save_enter() test (GH-146481) (#146510)
gh-146059: Cleanup pickle fast_save_enter() test (GH-146481)

Remove {"key": data}, it's not required to reproduce the bug.
Simplify also deep_nested_struct(): remove the seed parameter.
Fix a typo in a comment.
(cherry picked from commit 0c7a75aeef)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-27 10:49:57 +00:00
Miss Islington (bot)
de1644cd40
[3.13] gh-146059: Call fast_save_leave() in pickle save_frozenset() (GH-146173) (#146474)
gh-146059: Call fast_save_leave() in pickle save_frozenset() (GH-146173)

Add more pickle tests: test also nested structures.
(cherry picked from commit 5c0dcb3e0d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-27 08:47:53 +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
Miss Islington (bot)
2bb1ac2162
[3.13] gh-144837: Improve documentation for more collection methods (GH-144841) (GH-146484)
Use uniform standard signature syntax in the tutorial and in
the array and collections modules documentation.
(cherry picked from commit 17070f41d4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-03-26 19:52:07 +00:00
Miss Islington (bot)
7d565d6ae8
[3.13] gh-146318: Document that signal.SIGSTOP is Unix-only (GH-146319) (#146469)
gh-146318: Document that signal.SIGSTOP is Unix-only (GH-146319)
(cherry picked from commit e44993a665)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
2026-03-26 16:49:46 +01: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
Miss Islington (bot)
fc4b4221e5
[3.13] gh-146244: Fix initconfig.c SET_ITEM macro leaks dict on expression failure (GH-146246) (GH-146433)
(cherry picked from commit 9343518c6f)

Co-authored-by: Wulian233 <1055917385@qq.com>
2026-03-25 19:32:20 +00:00
Miss Islington (bot)
5a4959b92c
[3.13] Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250) (GH-145303)
It occurs in a code which perhaps never executed.
(cherry picked from commit 6ea84b2726)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-03-24 02:18:19 +00:00
Miss Islington (bot)
f17ed5e9bf
[3.13] gh-74955: Document that __all__ must contain strings in normalization form NFKC (GH-144504) (GH-144520)
(cherry picked from commit c81e1843d4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-03-24 02:01:06 +00:00
Miss Islington (bot)
dbe2500e0e
[3.13] gh-145305: Update ocert.org URLs in docs from http to https (GH-145304) (GH-145323)
(cherry picked from commit 11eec7a492)

Co-authored-by: indoor47 <indoor47@gmail.com>
Co-authored-by: Adam (indoor47) <adamai@agentmail.to>
2026-03-24 02:51:43 +01:00
Łukasz Langa
14b8655cc3
[3.13] gh-140196: Add constructor behavior changes in ast.rst for python 3.13 (GH-140243) (GH-146354)
(cherry picked from commit fae5761a76)

Co-authored-by: Parman Mohammadalizadeh <prmma23@gmail.com>
2026-03-24 02:49:45 +01:00
Hugo van Kemenade
2ea48506a2
[3.13] Bump pre-commit hooks (GH-144576) (GH-144593)
(cherry picked from commit e682141c49)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Xianpeng Shen <xianpeng.shen@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-24 02:49:26 +01: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)
daa4106426
[3.13] docs: fix f-string in ExceptionGroup example (GH-146108) (GH-146127)
(cherry picked from commit 2c6afb935a)

Co-authored-by: Bartosz Grabowski <58475557+bartosz-grabowski@users.noreply.github.com>
2026-03-24 00:08:07 +01:00
Miss Islington (bot)
ec8e33b99a
[3.13] gh-136672: Docs: Move parts of Enum HOWTO to API Docs (GH-139176) (GH-144803)
To avoid duplicate content in the Enum HOWTO and
API documentation which is not automatically synced,
the section about supported __dunder__ and _sunder
names is moved from HOWTO to API docs.

See also https://github.com/python/cpython/pull/136791
(cherry picked from commit 629a363ddd)

Co-authored-by: Rafael Weingartner-Ortner <38643099+RafaelWO@users.noreply.github.com>
2026-03-23 21:26:01 +01:00
Serhiy Storchaka
3a14b7faec
[3.13] gh-145144: Add more tests for UserList, UserDict, etc (GH-145145) (GH-146296)
(cherry picked from commit 161329cde2)
2026-03-22 18:06:01 +02:00
Miss Islington (bot)
0aa9153cf7
[3.13] gh-143959: Fix test_datetime if _datetime is unavailable (GH-145248) (GH-146289)
(cherry picked from commit 97c725cd39)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-03-22 14:39:08 +00: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
Miss Islington (bot)
5d71935bb3
[3.13] Docs: replace all datetime imports with import datetime as dt (GH-145640) (#146259)
Docs: replace all `datetime` imports with `import datetime as dt` (GH-145640)
(cherry picked from commit 83360b5869)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-03-21 18:41:50 +00:00
Miss Islington (bot)
29303db78c
[3.13] gh-138234: clarify returncode behavior for subprocesses created with shell=True (GH-138536) (#146255)
gh-138234: clarify returncode behavior for subprocesses created with `shell=True` (GH-138536)
(cherry picked from commit 8a531f89df)

Co-authored-by: andreuu-tsai <32549555+andreuu-tsai@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-03-21 12:38:56 +00:00
Miss Islington (bot)
84c1fa3bcc
[3.13] GH-100108: Add async generators best practices section (GH-141885) (#146253)
GH-100108: Add async generators best practices section (GH-141885)
(cherry picked from commit 897fa231a7)

Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-03-21 12:06:05 +00:00
AN Long
d513f9ef8f
[3.13] gh-129849: Add tests for Py_tp_bases (GH-143208) (#146226)
(cherry picked from commit 6f8867a676)
2026-03-21 15:22:45 +05:30
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)
cfd7f94c12
[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 6450b1d142)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-20 16:40:55 +00:00
Miss Islington (bot)
53b544a6a7
[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 8eeb800faf)


(cherry picked from commit e1e4852133)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-18 21:23:26 +01:00
Miss Islington (bot)
c7d7e1c1a0
[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 724c7c8146)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-18 17:45:47 +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)
2705364de2
[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 4f5e79805e)


Docs: a brief note in the sets tut about order

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2026-03-17 05:18:16 -04:00