]>
git.ipfire.org Git - thirdparty/Python/cpython.git/log
Miss Islington (bot) [Tue, 16 Jun 2026 16:48:56 +0000 (18:48 +0200)]
[3.15] gh-151218: Replace sys.flags in PyConfig_Set() (GH-151402) (#151552)
gh-151218: Replace sys.flags in PyConfig_Set() (GH-151402)
PyConfig_Set() and sys.set_int_max_str_digits() now replace
sys.flags (create a new object), instead of modifying sys.flags in-place.
Modifying sys.flags in-place can lead to data races when multiple
threads are reading or writing sys.flags in parallel.
Use _Py_atomic functions to get and set max_str_digits members.
(cherry picked from commit
b16d23fc9fe9cb72fa15c8a3036753e5437b5b8c )
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Miss Islington (bot) [Tue, 16 Jun 2026 16:42:24 +0000 (18:42 +0200)]
[3.15] gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (GH-151521) (#151549)
gh-151519: Check effective gid in `_test_all_chown_common` group-0 guard (GH-151521)
The guard that skips the "chown to gid 0 should fail" assertion used
only `os.getgroups()` (supplementary groups). The kernel also accepts
the effective/filesystem gid for chown, so when a process runs with
egid 0 and a non-zero uid (common in containers and user namespaces),
chown(-1, 0) succeeds and the assertion spuriously fails.
Add an `os.getegid() != 0` check alongside the existing
`0 not in os.getgroups()` guard.
(cherry picked from commit
2ce260033b457a0ad2c9767a1d9902bef5a30b0e )
Co-authored-by: Itamar Oren <itamarost@gmail.com>
Miss Islington (bot) [Tue, 16 Jun 2026 12:18:56 +0000 (14:18 +0200)]
[3.15] gh-150771: Fix email serialization for shift_jis and euc-jp (GH-151120) (GH-151541)
Encode the payload with output_charset instead of input_charset.
(cherry picked from commit
0777a58d8012bbdd0d72654b56f9112686ae6ff0 )
Co-authored-by: dev <b.chouksey27@gmail.com>
Miss Islington (bot) [Tue, 16 Jun 2026 11:52:39 +0000 (13:52 +0200)]
[3.15] gh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters (GH-150053) (#151322)
Co-authored-by: Taeknology <20297177+Taeknology@users.noreply.github.com>
Miss Islington (bot) [Tue, 16 Jun 2026 05:54:42 +0000 (07:54 +0200)]
[3.15] gh-151522: Guard against None transport in slow-socket SSL test (GH-151523) (#151528)
gh-151522: Guard against None transport in slow-socket SSL test (GH-151523)
(cherry picked from commit
11f032f904c8019b332a3c367f335e05cde63628 )
Co-authored-by: Itamar Oren <itamarost@gmail.com>
Miss Islington (bot) [Mon, 15 Jun 2026 22:45:45 +0000 (00:45 +0200)]
[3.15] gh-151422: Don't link libffi into _ctypes_test.so (GH-151423) (#151516)
_ctypes_test doesn't use libffi directly, and linking it into the module
causes emscripten tests to fail.
(cherry picked from commit
8646385076ea4f6ef08682d8ef07a544d3b4ef30 )
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Miss Islington (bot) [Mon, 15 Jun 2026 17:22:52 +0000 (19:22 +0200)]
[3.15] gh-151223: fix tsan data races in load global specializations (GH-151393) (#151513)
gh-151223: fix tsan data races in load global specializations (GH-151393)
(cherry picked from commit
e9d5280f6c040f859907eb3c04ec308f4918db9f )
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Miss Islington (bot) [Mon, 15 Jun 2026 14:55:27 +0000 (16:55 +0200)]
[3.15] gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854) (#151506)
gh-148853: Catch PermissionError in test in_systemd_nspawn_sync_suppressed() (GH-148854)
/run/ on my FreeBSD install is not readable causing failing test.
(cherry picked from commit
35ce2e5f98c04cb8d1e442de5439d3151362e21b )
Co-authored-by: Nick Begg <nick@stunttruck.net>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Miss Islington (bot) [Mon, 15 Jun 2026 09:42:09 +0000 (11:42 +0200)]
[3.15] Add `.toml` to `.editorconfig` (GH-151481) (#151491)
Add `.toml` to `.editorconfig` (GH-151481)
(cherry picked from commit
7a70afa199a9bdd5bf65b2b396b9fa76c8842ac2 )
Co-authored-by: sobolevn <mail@sobolevn.me>
Miss Islington (bot) [Mon, 15 Jun 2026 09:01:30 +0000 (11:01 +0200)]
[3.15] gh-149671: Restore compatibility with setuptools -nspkg.pth files in site module (GH-151319) (#151489)
gh-149671: Restore compatibility with setuptools -nspkg.pth files in site module (GH-151319)
Inject the "sitedir" variable in the frame which executes ".pth" code.
(cherry picked from commit
18f3ffec43b98db34c6d378cfc012814a901bb41 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Sun, 14 Jun 2026 18:37:23 +0000 (20:37 +0200)]
[3.15] Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460) (#151468)
Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460)
Since the recursion guard tracks real C-stack bounds (gh-91079), this test
asserts that 500k nesting levels overflow the stack margin. On a 64 MiB stack
(some Nix build envs use one that large), the optimized interpreter uses ~160
bytes/level (raises at ~420k levels) so the assertion holds with only ~16%
margin; the PGO *instrumented* stage inlines less, its per-level scanner frames
are smaller, and the 500k-deep decode completes -- "RecursionError not raised"
fails the profile run and aborts `make profile-opt`. Upstream's
skip_if_unlimited_stack_size (gh-143460) only covers RLIM_INFINITY, not
large-finite stacks like ours.
We could also keep playing whack a mole and raise the 500k to a much larger
number... but there's little value in PGO training on this test anyways.
(cherry picked from commit
e91f68ab40e25dc964afb872eb75873c8b1838d6 )
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Bartosz Sławecki [Sun, 14 Jun 2026 16:38:07 +0000 (18:38 +0200)]
[3.15] gh-151390: Colorize `match +` and `match -` in the REPL (GH-151391) (#151476)
(cherry picked from commit
a7007322c2a70b01e7c2a9e6b3f8f222d241c7d7 )
Miss Islington (bot) [Sun, 14 Jun 2026 12:58:37 +0000 (14:58 +0200)]
[3.15] gh-151461: Fix encoding-related exception handling in file tokenizer (GH-151462) (GH-151470)
(cherry picked from commit
f1a5f68e3761e010ccd4dda1342500c5ae40bbc4 )
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Miss Islington (bot) [Sun, 14 Jun 2026 12:47:39 +0000 (14:47 +0200)]
[3.15] gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893) (GH-151472)
(cherry picked from commit
47b7dc788c9bcf3d5ea69a2ea0aed3d5883647a8 )
Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Sat, 13 Jun 2026 23:40:19 +0000 (01:40 +0200)]
[3.15] gh-151424: Fix impossible stack traces in `RemoteUnwinder(..., cache_frames=True)` by copying chunks on cache miss (GH-151426) (#151459)
gh-151424: Fix impossible stack traces in `RemoteUnwinder(..., cache_frames=True)` by copying chunks on cache miss (GH-151426)
(cherry picked from commit
6ce088e20a13ac25320d94c5775bb1a4edc75ba4 )
Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
Miss Islington (bot) [Sat, 13 Jun 2026 21:32:48 +0000 (23:32 +0200)]
[3.15] gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404) (#151445)
gh-151403: Fix use-after-free when an argv item's __fspath__ mutates args (GH-151404)
---------
(cherry picked from commit
6679ac07d881f6e0ce30b7cc28b5671eafa20d9d )
Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
Miss Islington (bot) [Sat, 13 Jun 2026 18:39:44 +0000 (20:39 +0200)]
[3.15] gh-151443: Fix documented default of `unittest.mock.mock_open`'s `read_data` parameter (GH-151444) (#151450)
(cherry picked from commit
9ad6ba0324a71ae5b51ded6e59b1ea3b653814a5 )
Co-authored-by: Shardul Deshpande <iamsharduld@users.noreply.github.com>
Miss Islington (bot) [Sat, 13 Jun 2026 13:00:54 +0000 (15:00 +0200)]
[3.15] gh-77328: Update `base64` module RFC references to RFC 4648 (GH-151275) (#151438)
(cherry picked from commit
e9339876883f96af2e406a92a05be647b7fbe5d5 )
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Sat, 13 Jun 2026 09:06:55 +0000 (11:06 +0200)]
[3.15] gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268) (#151430)
gh-101267: ProcessPoolExecutor no longer shares 1 BrokenProcessPool exception among all failed futures (GH-101268)
(cherry picked from commit
3c00ebc2bbd902495b163def850bc931420209fc )
Co-authored-by: Daniel Shields <daniel.shields@twosigma.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Miss Islington (bot) [Sat, 13 Jun 2026 08:55:30 +0000 (10:55 +0200)]
[3.15] Docs: Fix method directive signatures in `enum` docs (GH-151429) (#151434)
(cherry picked from commit
5b385197625e669473859c63bee6f14c983d2be6 )
Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
Miss Islington (bot) [Fri, 12 Jun 2026 16:11:06 +0000 (18:11 +0200)]
[3.15] Fix typos in the `curses.ascii` module documentation (GH-129300) (#151413)
(cherry picked from commit
f4f102027a9b0edc72a048f17b696aa92d2e6893 )
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Fri, 12 Jun 2026 15:01:30 +0000 (17:01 +0200)]
[3.15] Docs: avoid repetitions of class references in functions.rst (GH-150891) (#151405)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Miss Islington (bot) [Fri, 12 Jun 2026 13:10:41 +0000 (15:10 +0200)]
[3.15] gh-151284: Fix test_capi on UBSan (GH-151286) (#151323)
gh-151284: Fix test_capi on UBSan (GH-151286)
Comment two checks relying on undefined behavior in
test_fromwidechar() of test_capi.
Enable test_capi in GitHub Action "Reusable Sanitizer".
(cherry picked from commit
d87d77287392b78d36a06660228f6a5ca88888d7 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Fri, 12 Jun 2026 11:31:51 +0000 (13:31 +0200)]
[3.15] gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382) (#151398)
gh-151126: Fix crash on unset memory error in `ctypes.get_errno` (GH-151382)
(cherry picked from commit
6b217ea90b9cd694fded6308bc796e324bbacd19 )
Co-authored-by: sobolevn <mail@sobolevn.me>
Miss Islington (bot) [Fri, 12 Jun 2026 01:47:01 +0000 (03:47 +0200)]
[3.15] gh-151297: Fix undefined behavior in `_PyObject_MiRealloc` (GH-151358) (GH-151388)
The standard says that a call to `memcpy` must pass a valid source and
destination pointer even if the size is 0, so we must avoid calling
`memcpy` when our source pointer is NULL. If we don't, an optimizing
compiler can decide that the pointer must be non-NULL based on the
presence of UB, and optimize out checks for null pointers.
Specifically, note that the standard says:
Where an argument declared as size_t n specifies the length of the
array for a function, n can have the value zero on a call to that
function. Unless explicitly stated otherwise in the description of
a particular function in this subclause, pointer arguments on such
a call shall still have valid values, as described in 7.1.4.
And section 7.1.4 says:
If an argument to a function has an invalid value (such as a value
outside the domain of the function, or a pointer outside the address
space of the program, or a null pointer, or a pointer to
non-modifiable storage when the corresponding parameter is not
const-qualified) or a type (after default argument promotion) not
expected by a function with a variable number of arguments, the
behavior is undefined.
The specification for `memcpy` doesn't state that it's allowed to be
called with null pointers, and Linux's `/usr/include/string.h` declares
`memcpy` as `__nonnull ((1, 2))`.
(cherry picked from commit
c37599200f688538efa34a49f262a9a4a899a953 )
Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
Miss Islington (bot) [Thu, 11 Jun 2026 22:39:37 +0000 (00:39 +0200)]
[3.15] gh-151065: Copy fix for memory leak from mimalloc upstream (GH-151066) (GH-151383)
Applies https://github.com/microsoft/mimalloc/commit/
d7a72c4912943e8aaf135e465ca5ea229ea96646 to our copy of mimalloc.
(cherry picked from commit
80f9467434cecbc4e97b853b3876de13e75aec38 )
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Miss Islington (bot) [Thu, 11 Jun 2026 20:25:05 +0000 (22:25 +0200)]
[3.15] gh-151337: Avoid possible memory leak in `_tkinter.c` on Windows. (GH-151340) (GH-151379)
(cherry picked from commit
71805db4294de9495954571c82a835d94ba67594 )
Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Miss Islington (bot) [Thu, 11 Jun 2026 17:45:30 +0000 (19:45 +0200)]
[3.15] gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007) (#151372)
gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007)
And add tests.
(cherry picked from commit
402668b2b1a63a2b3cfd7a2ede07f6786f9beb8e )
Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Thu, 11 Jun 2026 17:22:52 +0000 (19:22 +0200)]
[3.15] gh-150285: Fix too long docstrings in GenericAlias and __class_getitem__ (GH-151354) (GH-151367)
(cherry picked from commit
65047f2e2fb80e4ad36df56a343d75963a20c110 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Thu, 11 Jun 2026 16:55:19 +0000 (18:55 +0200)]
[3.15] gh-151126: Fix missing memory error in `os._path_splitroot` (GH-151339) (#151360)
gh-151126: Fix missing memory error in `os._path_splitroot` (GH-151339)
(cherry picked from commit
10595b1cb7ac04ba9a3ef3f7da4fa31c9966300d )
Co-authored-by: sobolevn <mail@sobolevn.me>
Miss Islington (bot) [Thu, 11 Jun 2026 16:34:26 +0000 (18:34 +0200)]
[3.15] gh-151228: fix data race on clearing embedded dict values (GH-151330) (#151359)
gh-151228: fix data race on clearing embedded dict values (GH-151330)
(cherry picked from commit
6112d70abee2455bfa44a76a49a5a80472e21134 )
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Miss Islington (bot) [Thu, 11 Jun 2026 15:42:23 +0000 (17:42 +0200)]
[3.15] gh-101100: Fix Sphinx nitpick in `unittest.mock.rst` (GH-151302) (#151355)
(cherry picked from commit
b18168cb32d545ed976b760983478cbd5dde5bdf )
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Miss Islington (bot) [Thu, 11 Jun 2026 15:22:31 +0000 (17:22 +0200)]
[3.15] gh-151112: Fix crash in `compiler_mod()` when entering the current compilation unit fails (GH-151234) (#151350)
(cherry picked from commit
937d89c4d9b7c5fda6730a1127db118d881d13cb )
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Thu, 11 Jun 2026 15:21:26 +0000 (17:21 +0200)]
[3.15] gh-139588: Fix nondeterministic `make latex` doc build under parallel make (GH-151343) (#151352)
(cherry picked from commit
b9bffc09a6e47959cb5c306040fd0bfd77ae2786 )
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Miss Islington (bot) [Thu, 11 Jun 2026 15:15:10 +0000 (17:15 +0200)]
[3.15] gh-150397: Fix pyexpat bigmem test (GH-151329) (#151348)
gh-150397: Fix pyexpat bigmem test (GH-151329)
Add missing parameter (size).
(cherry picked from commit
0bbde07a0bbad3c79073fd133d6df70837e4cfee )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Thu, 11 Jun 2026 15:01:11 +0000 (17:01 +0200)]
[3.15] gh-150285: Suppress showing the __getstate__() comment in the help for dataclasses (GH-151328) (GH-151331)
(cherry picked from commit
0066fd73a20950dc790d219f4e3cfb07e816df47 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Thu, 11 Jun 2026 14:58:13 +0000 (16:58 +0200)]
[3.15] gh-151238: Check for `_get_resized_exprs` failure in `_PyPegen_{joined,template}_str` (GH-151259) (#151344)
(cherry picked from commit
4b44b1e1fd654f3a3fefb02ae7fb26456fe33dc3 )
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Thu, 11 Jun 2026 11:21:26 +0000 (13:21 +0200)]
[3.15] gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (GH-151260) (#151326)
gh-123619: Fix PyUnstable_Object_EnableDeferredRefcount() (GH-151260)
Return 0 if the object is not tracked by the GC.
(cherry picked from commit
72e7eddce6c7137cef06b6eba15641597919e3d4 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Thu, 11 Jun 2026 10:10:55 +0000 (12:10 +0200)]
[3.15] gh-151177: Fix race condition in `_testembed` (GH-151293) (GH-151312)
gh-151177: Fix race condition in `_testembed` (GH-151293)
(cherry picked from commit
f9ffca39351b77197e4dc2775a0d1e4ad64bf0e5 )
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Miss Islington (bot) [Thu, 11 Jun 2026 09:46:04 +0000 (11:46 +0200)]
[3.15] gh-151112: Move an `assert` that may fail in `cfg_builder_check` (GH-151153) (#151313)
(cherry picked from commit
2d3381035df24fbf512d897daa19a1040f7af3fd )
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Thu, 11 Jun 2026 08:55:01 +0000 (10:55 +0200)]
[3.15] Drop historical `:author:`s from HOWTOs (GH-151091) (#151310)
(cherry picked from commit
9620f69cd4cd0b3691bc9feb279ddf45f71a9e7d )
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Thu, 11 Jun 2026 08:30:24 +0000 (10:30 +0200)]
[3.15] gh-151295: Fix use-after-free in bytes.join()/bytearray.join() via re-entrant __buffer__ (GH-151296) (GH-151304)
(cherry picked from commit
84a322aa1555df745a2c115df03bfb7a4ed8c594 )
Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Miss Islington (bot) [Thu, 11 Jun 2026 06:38:03 +0000 (08:38 +0200)]
[3.15] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151299)
(cherry picked from commit
84630e2cb90ef334e41eb9bccd860b3b0a7ff51b )
Miss Islington (bot) [Wed, 10 Jun 2026 20:07:07 +0000 (22:07 +0200)]
[3.15] gh-151278: Fix test_faulthandler on UBSan (GH-151279) (#151281)
gh-151278: Fix test_faulthandler on UBSan (GH-151279)
* Py_FatalError() no longer calls _PyFaulthandler_Fini() if it
doesn't hold the GIL.
* Skip test_faulthandler tests raising signals if run with UBSan.
* Enable test_faulthandler in GitHub Action "Reusable Sanitizer".
(cherry picked from commit
e60c42dc3f5a8dd9b10bc9a8a028ef2765469650 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Victor Stinner [Wed, 10 Jun 2026 20:03:27 +0000 (22:03 +0200)]
[3.15] gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250) (#151269)
gh-151253: Dump the Python path configuration on _PyCodec_InitRegistry() failure (#151250)
If "import encodings" fails at Python startup, dump the Python path
configuration to help users debugging their configuration. The
encodings module is the first module imported during Python startup.
(cherry picked from commit
7b6e98911e1485be13817f2aedbbfadb1c4ea876 )
Miss Islington (bot) [Wed, 10 Jun 2026 17:37:52 +0000 (19:37 +0200)]
[3.15] GHA: Display output when a sanitizer test fails (GH-151268) (#151272)
GHA: Display output when a sanitizer test fails (GH-151268)
Modify GitHub Action "Reusable Sanitizer" to display output when a
test fails: pass -W option.
(cherry picked from commit
3a8bebd86f36be05442fa2f3adcc83c2a4b00ef2 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Wed, 10 Jun 2026 16:48:10 +0000 (18:48 +0200)]
[3.15] gh-109940: Respect VIRTUAL_ENV_DISABLE_PROMPT in activate.bat (GH-151215) (GH-151225)
Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
Miss Islington (bot) [Wed, 10 Jun 2026 16:26:38 +0000 (18:26 +0200)]
[3.15] gh-151126: Fix missing memory errors in `_interpchannelsmodule.c` (GH-151239) (#151265)
gh-151126: Fix missing memory errors in `_interpchannelsmodule.c` (GH-151239)
(cherry picked from commit
9fd1a125bc0ebdc26eae684da6e48ef24ee23b34 )
Co-authored-by: sobolevn <mail@sobolevn.me>
Miss Islington (bot) [Wed, 10 Jun 2026 16:04:48 +0000 (18:04 +0200)]
[3.15] gh-141984: Reword the Generator expressions section (GH-150518) (GH-151261)
(cherry picked from commit
7bbb9607a2e7d1f8a7de11ce02f0a2402d6e7262 )
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Wed, 10 Jun 2026 14:25:33 +0000 (16:25 +0200)]
[3.15] gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (GH-143987) (#151246)
gh-143988: Fix re-entrant mutation crashes in socket sendmsg/recvmsg_into (GH-143987)
Fix crashes in socket.sendmsg() and socket.recvmsg_into() that could
occur if buffer sequences are mutated re-entrantly during argument
parsing via __buffer__ protocol callbacks.
The bug occurs because:
1. PySequence_Fast() returns the original list object when the input
is already a list (not a copy).
2. During iteration, PyObject_GetBuffer() triggers __buffer__
callbacks which may clear the list.
3. Subsequent iterations access invalid memory (heap OOB read).
The fix replaces PySequence_Fast() with PySequence_Tuple() which
always creates a new tuple, ensuring the sequence cannot be mutated
during iteration.
(cherry picked from commit
896f7fdc7d0ba6d4ace06935b9d67c4da0f9ecbe )
Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: tonghuaroot <23011166+tonghuaroot@users.noreply.github.com>
Miss Islington (bot) [Wed, 10 Jun 2026 14:11:26 +0000 (16:11 +0200)]
[3.15] add asyncio guide for Free-Threaded Python (GH-150456) (#151257)
add asyncio guide for Free-Threaded Python (GH-150456)
(cherry picked from commit
e2bd50d2e1cfe474f3b1f88a3d2b7e26cfda1295 )
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Miss Islington (bot) [Wed, 10 Jun 2026 13:36:58 +0000 (15:36 +0200)]
[3.15] Add yet one assertion in test_set_text_charset_cp949 (GH-151224) (GH-151237)
Add yet one assertion in test_set_text_charset_cp949 (GH-151224)
Check bytes(m), not only str(m).
(cherry picked from commit
3ca93ab198497da9451101019b67c52e7873377d )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Wed, 10 Jun 2026 13:21:48 +0000 (15:21 +0200)]
[3.15] Docs: Fix typos in the "Memory Management" section (GH-151243) (GH-151247)
Docs: Fix typos in the "Memory Management" section (GH-151243)
(cherry picked from commit
8c0e2515bb0059b75e264cc5baeb27bb17337c83 )
Co-authored-by: Manoj K M <manojkm24dev@gmail.com>
Miss Islington (bot) [Wed, 10 Jun 2026 13:09:28 +0000 (15:09 +0200)]
[3.15] gh-89554: Document socket.SocketType as a class (GH-150683) (#151244)
gh-89554: Document socket.SocketType as a class (GH-150683)
socket.SocketType is a class (re-exported from _socket as an alias of
_socket.socket, the base class of socket.socket), but was documented with
the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.
Switch the entry to ".. class::", correct the misleading description
(SocketType is the base class of the socket type, not "type(socket(...))"
which is socket.socket; addresses gh-88427), move it into the Socket
Objects section, and document the socket object methods and attributes
nested under the socket class, dropping the redundant "socket." prefix.
(cherry picked from commit
a621e8ad811e7d51d69b0969a2bd07888a02db1e )
Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
Miss Islington (bot) [Wed, 10 Jun 2026 12:56:54 +0000 (14:56 +0200)]
[3.15] gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__()` (GH-150990) (#151240)
gh-150988: Fix refleak in `OSError` when attrs are set before `super().__init__()` (GH-150990)
(cherry picked from commit
f2a0f82282d6307f7fd2d4ccf52a8fd95ac3922f )
Co-authored-by: Lukas Geiger <lukas.geiger94@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Wed, 10 Jun 2026 11:35:01 +0000 (13:35 +0200)]
[3.15] gh-98894: Fix DTrace test_check_probes for shared builds (GH-151122) (#151235)
gh-98894: Fix DTrace test_check_probes for shared builds (GH-151122)
When building with --enable-shared, the SystemTap/DTrace notes
live in libpython. Add detection logic to be used by readelf.
Force the C locale on readelf output.
(cherry picked from commit
3a08e9373977788e7691ec0a973fbe1abe170c91 )
Co-authored-by: stratakis <cstratak@redhat.com>
Serhiy Storchaka [Wed, 10 Jun 2026 10:41:19 +0000 (13:41 +0300)]
[3.15] gh-80384: Fix docs for PyWeakref_NewRef() and PyWeakref_NewProxy() (GH-151146)
The type of the callback argument is not checked.
Cody Maloney [Wed, 10 Jun 2026 09:13:46 +0000 (02:13 -0700)]
[3.15] gh-143008: Fix race re-initializing TextIOWrapper (#151203)
__init__() changes multiple variables and may be called more than once
from multiple threads.
Miss Islington (bot) [Tue, 9 Jun 2026 23:33:04 +0000 (01:33 +0200)]
[3.15] gh-150700: Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends (GH-150735) (#151211)
gh-150700: Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends (GH-150735)
* Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends
In `inline_comprehension()`, when `__class__` / `__classdict__` /
`__conditional_annotations__` appears as `FREE` in a comprehension's
symbol table because a nested scope captured it (e.g. nested lambdas),
this name is still discarded from `comp_free` unconditionally.
This prevents `drop_class_free()` from seeing it, so the appropriate
`ste_needs_(...)` flag is never set on the enclosing class.
That leads to `codegen_make_closure()` throwing `SystemError` when it
couldn't find `__class__` / `__classdict__` /
`__conditional_annotations__` in the class's cellvars.
From now on we just discard from `comp_free` when no child scope
(e.g. a lambda) still needs the name as `FREE`. When a child scope does
need it, keep it in `comp_free` so `drop_class_free()` can set the
appropriate flag and the class creates the implicit cell.
* Fix tests
* Fix typo
* Fix formatting
* Add test checking validity of `__class__` returned
* Prefer 'used' to 'deferred'
(cherry picked from commit
ce916dc50644bb1de940f5fb580bd9907cceb959 )
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Miss Islington (bot) [Tue, 9 Jun 2026 20:16:42 +0000 (22:16 +0200)]
[3.15] gh-151112: Fix double free in `assemble_init` when out of memory (GH-151142) (#151205)
gh-151112: Fix double free in `assemble_init` when out of memory (GH-151142)
(cherry picked from commit
580499177ca91477b53b4a40afcec7d3370265b0 )
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 18:56:57 +0000 (20:56 +0200)]
[3.15] gh-151163: Update Android, macOS installer, and Windows builds to SQLite 3.53.2 (GH-151204)
(cherry picked from commit
ab8ebe9034a85c441d1bb4208fa2d667fd38cc4d )
Co-authored-by: Zachary Ware <zach@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 17:57:09 +0000 (19:57 +0200)]
[3.15] gh-151159: Update CI to use latest SSL library versions (GH-151199)
(cherry picked from commit
7053bbd7fd4967b8782bf0c8f6ad00248f0b0c5b )
Co-authored-by: Zachary Ware <zach@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 17:54:25 +0000 (19:54 +0200)]
[3.15] gh-151159: Bump OpenSSL versions for iOS and Android (GH-151197)
(cherry picked from commit
627dd14346b4c4c13d9203430c32556467b7fbd3 )
Co-authored-by: Zachary Ware <zach@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 17:44:44 +0000 (19:44 +0200)]
[3.15] gh-151159: Update Windows builds to use OpenSSL 3.5.7 (GH-151189)
(cherry picked from commit
6688b0c71536ac99ed629fbd5ea4b226245ffac6 )
Co-authored-by: Zachary Ware <zach@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 17:33:23 +0000 (19:33 +0200)]
[3.15] gh-151159: Update macOS installer to use OpenSSL 3.5.7. (GH-151171) (#151192)
(cherry picked from commit
720fb82603a3c93b5941144feac1f25eacf74c03 )
Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Miss Islington (bot) [Tue, 9 Jun 2026 17:15:41 +0000 (19:15 +0200)]
[3.15] GH-59633: Clarify dest collisions in argparse docs (GH-150987) (#151188)
GH-59633: Clarify dest collisions in argparse docs (GH-150987)
(cherry picked from commit
82cb7d4bf62041b75a08628baa1f9fe761fd6a79 )
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 17:10:18 +0000 (19:10 +0200)]
[3.15] gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module (GH-151154) (#151180)
gh-151126: Add missing `PyErr_NoMemory` in `_winapi` module (GH-151154)
(cherry picked from commit
8d94fa7b8696db6a7942f8a4b930289e69e9b174 )
Co-authored-by: sobolevn <mail@sobolevn.me>
Miss Islington (bot) [Tue, 9 Jun 2026 16:41:54 +0000 (18:41 +0200)]
[3.15] gh-150285: Fix too long docstrings in the asyncio package (GH-151074) (GH-151172)
(cherry picked from commit
ed2b04248aa1f608099e03437aa280d1be6e80c3 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Tue, 9 Jun 2026 16:41:26 +0000 (18:41 +0200)]
[3.15] gh-150285: Fix too long docstrings in the concurrent package (GH-151076) (GH-151173)
(cherry picked from commit
0fa06f4d7fb3494a62ba2631362ce8b98a7eec25 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Tue, 9 Jun 2026 15:46:39 +0000 (17:46 +0200)]
[3.15] GH-61082: Clarify nargs='*' positional default behavior (GH-150989) (#151168)
GH-61082: Clarify nargs='*' positional default behavior (GH-150989)
(cherry picked from commit
bc37a227b2f481d0f260f9beae5229e8d432a0cc )
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 15:45:23 +0000 (17:45 +0200)]
[3.15] GH-54732: Tweak wording around empty lines in argument files (GH-150980) (#151165)
GH-54732: Tweak wording around empty lines in argument files (GH-150980)
(cherry picked from commit
528550e0e753d64714f65a02d567bdc1d63ae3f1 )
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 13:24:28 +0000 (15:24 +0200)]
[3.15] Docs: Only add `profiling-sampling-visualization.{css,js}` to files when necessary (GH-151150)
(cherry picked from commit
0a179e748bcf158bdcdd47f0e57a1983993f4610 )
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Tue, 9 Jun 2026 13:06:30 +0000 (15:06 +0200)]
[3.15] gh-109503: Fix document for shutil.move() on usage of os.rename() since it's inaccurate (GH-109507) (GH-150611)
Nonatomic move might be used even if the files are
on the same filesystem in some cases.
(cherry picked from commit
6ecd197c03c43412fc400235949fd8297f142e89 )
Co-authored-by: Fang Li <fangli@users.noreply.github.com>
Miss Islington (bot) [Tue, 9 Jun 2026 12:14:47 +0000 (14:14 +0200)]
[3.15] gh-151039: Fix a crash when `_datetime` types outlive `_datetime` module (GH-151044) (#151143)
gh-151039: Fix a crash when `_datetime` types outlive `_datetime` module (GH-151044)
(cherry picked from commit
9fdbade99e6bcc607d9f12416bfca5bbf94022b9 )
Co-authored-by: sobolevn <mail@sobolevn.me>
Miss Islington (bot) [Tue, 9 Jun 2026 11:37:56 +0000 (13:37 +0200)]
[3.15] gh-151130: Add more tests for PyWeakref_* C API (GH-151131) (GH-151140)
(cherry picked from commit
c3cd75afdf86f6a811663c71da22cc24c784a6f4 )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Tue, 9 Jun 2026 10:33:02 +0000 (12:33 +0200)]
[3.15] gh-151126: Fix missing `PyErr_NoMemory()` in `remove_unused_consts` (GH-151127) (#151134)
gh-151126: Fix missing `PyErr_NoMemory()` in `remove_unused_consts` (GH-151127)
(cherry picked from commit
3186547c1ec76e1afab82ec32271ec5b9467fdeb )
Co-authored-by: sobolevn <mail@sobolevn.me>
Pablo Galindo Salgado [Mon, 8 Jun 2026 22:55:57 +0000 (23:55 +0100)]
[3.15] gh-149321: Remove lazy_imports=none startup mode (GH-149389) (#150129)
Miss Islington (bot) [Mon, 8 Jun 2026 22:04:06 +0000 (00:04 +0200)]
[3.15] gh-148932: Fix `profiling.sampling` on Windows virtual environments (GH-150541) (#151097)
gh-148932: Fix `profiling.sampling` on Windows virtual environments (GH-150541)
(cherry picked from commit
5c1321731403031d933ca469977e4bb3859c8680 )
Co-authored-by: Eduardo Villalpando Mello <eduardovil@microsoft.com>
Miss Islington (bot) [Mon, 8 Jun 2026 20:04:02 +0000 (22:04 +0200)]
[3.15] gh-150633: Minor improvement of a newly added test (GH-151103) (#151106)
gh-150633: Minor improvement of a newly added test (GH-151103)
Minor improvement of a newly added test.
(cherry picked from commit
fccf67a35449920484ea11d8a16566b58b0c4519 )
Co-authored-by: Barry Warsaw <barry@python.org>
Miss Islington (bot) [Mon, 8 Jun 2026 19:47:05 +0000 (21:47 +0200)]
[3.15] gh-151070: Fix class referencing typo in collections.abc docs (GH-151088) (GH-151110)
(cherry picked from commit
29a920e80e21490b5bdb7178373f80fe606a4403 )
Co-authored-by: Arshal Aromal <arshalaromal19@gmail.com>
Miss Islington (bot) [Mon, 8 Jun 2026 18:58:11 +0000 (20:58 +0200)]
[3.15] gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634) (GH-151100)
(cherry picked from commit
54de5475cd753e2519692c3e54af0f150e0a8b62 )
Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
Miss Islington (bot) [Mon, 8 Jun 2026 18:01:52 +0000 (20:01 +0200)]
[3.15] gh-119949: Refactor test_exc() helper in test_format.py (GH-135452) (GH-150329)
Use assertRaisesRegex() context and fix
https://github.com/python/cpython/pull/119781#pullrequestreview-
2088240959
(cherry picked from commit
0851700a9d99ca4bebd8d5f9d73c8c9ab1084405 )
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Miss Islington (bot) [Mon, 8 Jun 2026 18:01:31 +0000 (20:01 +0200)]
[3.15] gh-149816: Fix SNI callback callable race (GH-150018) (GH-150099)
(cherry picked from commit
8b31d08e62b9714cf8dd1d8b19afa5ecbad2414a )
Co-authored-by: Kirill Ignatev <kiri11@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Miss Islington (bot) [Mon, 8 Jun 2026 17:25:50 +0000 (19:25 +0200)]
[3.15] gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087) (#151093)
gh-151019: Fix test_os on 32-bit FreeBSD (GH-151087)
Remove references to server.handler_instance. This attribute has been
removed in 2022 by commit
3ae975f1ac880c47d51cca6c9e305547bd365be7 .
(cherry picked from commit
a9002349cbe3f2243fe53a9fcadd02318dd0caf9 )
Co-authored-by: Victor Stinner <vstinner@python.org>
Miss Islington (bot) [Mon, 8 Jun 2026 12:59:46 +0000 (14:59 +0200)]
[3.15] gh-106318: Add examples to the `str.isdigit()` method docs (GH-144721)
(cherry picked from commit
f051c68923b4060b03566d0ea1df06d911ebe238 )
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Mon, 8 Jun 2026 12:21:22 +0000 (14:21 +0200)]
[3.15] gh-141623: Clarify operator function descriptions (GH-141846)
(cherry picked from commit
bd5fa31c5ff47866f0f93ef2a674e78d56d2e44c )
Co-authored-by: Doron Behar <doron.behar@gmail.com>
Miss Islington (bot) [Mon, 8 Jun 2026 11:47:55 +0000 (13:47 +0200)]
[3.15] Mention `frozendict` in `object.__hash__()` documentation (GH-148867) (#151077)
(cherry picked from commit
e3762114e514f7790e9b4cf3a7b9478f2f306901 )
Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
Miss Islington (bot) [Mon, 8 Jun 2026 10:32:43 +0000 (12:32 +0200)]
[3.15] gh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation (GH-151058)
(cherry picked from commit
a1873300eebe9c634f59592c3333035768f09de9 )
Co-authored-by: Christian Zinck <christian.zinck@gmail.com>
Miss Islington (bot) [Mon, 8 Jun 2026 09:47:41 +0000 (11:47 +0200)]
[3.15] Docs: Fix missing colon in `bisect` example function (GH-151061) (GH-151067)
Docs: Fix missing colon in `bisect` example function (GH-151061)
(cherry picked from commit
16ede813ebad81e41874f1c0a1b3c83fc98a38ca )
Co-authored-by: Sergio López Gómez <sergiolopezgmz.dam@gmail.com>
Miss Islington (bot) [Sun, 7 Jun 2026 17:25:37 +0000 (19:25 +0200)]
[3.15] Update an error message in the 'Functional Programming HOWTO' (GH-151047)
(cherry picked from commit
81965c1683d7129a70e3fde22ea8a02b9398e227 )
Co-authored-by: saber-bit <bryanventura0324@gmail.com>
Miss Islington (bot) [Sun, 7 Jun 2026 16:48:30 +0000 (18:48 +0200)]
[3.15] gh-150599: Prevent bz2 decompressor reuse after errors (GH-150600)
(cherry picked from commit
5755d0f083949ff3c5bf3a37e673e24e306b036e )
Co-authored-by: Stan Ulbrych <stan@python.org>
Miss Islington (bot) [Sun, 7 Jun 2026 13:27:26 +0000 (15:27 +0200)]
[3.15] gh-151021: Fix mmap empty searches past the end (GH-151023) (GH-151041)
(cherry picked from commit
f2cab7b0cf019fcc3112018db5e20c00976f33d4 )
Co-authored-by: esadomer <54475303+esadomer@users.noreply.github.com>
Miss Islington (bot) [Sun, 7 Jun 2026 07:52:40 +0000 (09:52 +0200)]
[3.15] gh-148954: Escape methodname in xmlrpc.client.dumps() to prevent XML injection (GH-148968) (GH-151033)
(cherry picked from commit
ab930175e7e909aaa3ec7e761bfdbb886677bebb )
Co-authored-by: Sanyam Kumat <124618873+sanyamk23@users.noreply.github.com>
Miss Islington (bot) [Sat, 6 Jun 2026 21:11:55 +0000 (23:11 +0200)]
[3.15] gh-50948: IDLE: Warn if saving a file will overwrite a newer version (GH-17578) (GH-151026)
(cherry picked from commit
69851a64076cc240513b834d87d654064f7ac597 )
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Guilherme Polo <ggpolo@gmail.com>
Co-authored-by: Priya Pappachan <priyapappachan010@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Miss Islington (bot) [Sat, 6 Jun 2026 13:13:52 +0000 (15:13 +0200)]
[3.15] gh-149083: Use sentinel for urllib.parse._UNSPECIFIED (GH-149612) (#151017)
This was added in 3.15; let's use a real sentinel instead of an ad-hoc list object.
(cherry picked from commit
884ac3e3ec02347301939ff1f124972d4973f015 )
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Miss Islington (bot) [Sat, 6 Jun 2026 12:45:53 +0000 (14:45 +0200)]
[3.15] gh-150662: Stop unbounded memory growth in Tachyon `--gecko` collector (GH-150845) (#151000)
Miss Islington (bot) [Sat, 6 Jun 2026 12:06:37 +0000 (14:06 +0200)]
[3.15] Doc: fix order of PyLong_FromUnsignedLongLong (GH-150937) (GH-151012)
(cherry picked from commit
4833b2031edc97a79f44afacd2a8f40f51a9b2c5 )
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Miss Islington (bot) [Sat, 6 Jun 2026 11:59:53 +0000 (13:59 +0200)]
[3.15] Delete mention encoding and errors for importlib.resources.path() (GH-143111) (GH-151014)
(cherry picked from commit
fded34d6fe8c300f5625b7fddb86a4c56ecc35c5 )
Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
Miss Islington (bot) [Sat, 6 Jun 2026 10:29:57 +0000 (12:29 +0200)]
[3.15] gh-149835: Use realpath() instead of abspath() in shutil.move() (GH-149986) (GH-151009)
(cherry picked from commit
fab449bddbc4ff03677d49448cf6ea1f9d6a319f )
Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
Miss Islington (bot) [Sat, 6 Jun 2026 02:46:55 +0000 (04:46 +0200)]
[3.15] gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing (GH-150275) (#150996)
gh-150207: Raise MemoryError on tokenizer allocation failure instead of crashing (GH-150275)
(cherry picked from commit
262625fa30e5a1b5cf33c9dbce5d2b713093c7be )
Co-authored-by: Grant Herman <grantlouisherman041@gmail.com>