Commit graph

34418 commits

Author SHA1 Message Date
Miss Islington (bot)
26a0dbad63
[3.14] gh-130327: Always traverse managed dictionaries, even when inline values are available (GH-130469) (#145438)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-03-02 19:57:10 +00:00
Sam Gross
7f9fcba66d
[3.14] gh-130555: Fix use-after-free in dict.clear() with embedded values (gh-145268) (#145431) 2026-03-02 13:59:35 -05:00
Miss Islington (bot)
504436870b
[3.14] gh-145335: Fix crash when passing -1 as fd in os.pathconf (GH-145390) (#145433)
gh-145335: Fix crash when passing -1 as fd in os.pathconf (GH-145390)
(cherry picked from commit 5c3a47b94a)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-03-02 18:33:47 +00:00
Miss Islington (bot)
4152bbb773
[3.14] gh-145269: simplify bisect.bisect doc example (GH-145270) (#145367)
gh-145269: simplify bisect.bisect doc example (GH-145270)



---------
(cherry picked from commit fdb4b3527f)

Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2026-02-28 19:28:14 +00:00
Miss Islington (bot)
fc2a6cf0d3
[3.14] gh-142352: Fix asyncio start_tls() to transfer buffered data from StreamReader (GH-142354) (#145363)
gh-142352: Fix `asyncio` `start_tls()` to transfer buffered data from StreamReader (GH-142354)
(cherry picked from commit 0598f4a899)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Maksym Kasimov <39828623+kasimov-maxim@users.noreply.github.com>
2026-02-28 18:43:43 +00:00
Miss Islington (bot)
d76c56e958
[3.14] gh-145142: Make str.maketrans safe under free-threading (gh-145157) (#145320)
Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
2026-02-27 16:33:46 +00:00
Miss Islington (bot)
f04aefa418
[3.14] gh-145234: Normalize decoded CR in string tokenizer (GH-145281) (#145310)
gh-145234: Normalize decoded CR in string tokenizer (GH-145281)
(cherry picked from commit 98b1e51927)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2026-02-27 13:11:40 +00:00
Miss Islington (bot)
bc6a7a2b0c
[3.14] gh-142787: Handle empty sqlite3 blob slices (GH-142824) (#145297)
(cherry picked from commit 06b0920f12)

Co-authored-by: A.Ibrahim <abdulrasheedibrahim47@gmail.com>
2026-02-27 01:12:51 +01:00
Miss Islington (bot)
08101240f4
[3.14] gh-144872: fix heap buffer overflow _PyTokenizer_ensure_utf8 (GH-144807) (#145287)
Co-authored-by: AdamKorcz <44787359+AdamKorcz@users.noreply.github.com>
2026-02-26 23:01:12 +00:00
Stan Ulbrych
0701ce636c
[3.14] gh-88091: Fix unicodedata.decomposition() for Hangul Syllables (GH-144993) (GH-145189)
(cherry picked from commit 56c4f10d6e)
2026-02-25 00:27:09 +02:00
Miss Islington (bot)
12092af02e
[3.14] gh-145187: Fix crash on invalid type parameter bound expression in conditional block (GH-145188) (#145196)
gh-145187: Fix crash on invalid type parameter bound expression in conditional block (GH-145188)

Fix parsing crash found by oss-fuzz
(cherry picked from commit 5e61a16c10)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-24 21:13:08 +00:00
Miss Islington (bot)
da03b36f45
[3.14] gh-66305: Fix a hang on Windows in the tempfile module (GH-144672) (GH-145168)
It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
(cherry picked from commit ca66d3c40c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-24 11:32:12 +00:00
Rafael Santos
6d2c5a9f4a
[3.14] gh-145028: Fix blake2 tests in test_hashlib when it is missing due to configure --without-builtin-hashlib-hashes (GH-145029) (#145164)
[3.14] gh-145028: Fix blake2 tests in test_hashlib when it is missing due to build config (GH-145029)

specifically configure --without-builtin-hashlib-hashes means the otherwise guaranteed available blake2 family will not exist.  this allows the test suite to still pass.
(cherry picked from commit 273d5062ca)
2026-02-24 02:52:57 +00:00
Miss Islington (bot)
35a7a6767e
[3.14] _struct.c: Fix UB from integer overflow in prepare_s (GH-145158) (#145162)
`_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 fd0400585e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-24 01:18:32 +00:00
Sam Gross
bbb0f2d880
[3.14] gh-144777: Fix data races in IncrementalNewlineDecoder (gh-144971) (#145143) 2026-02-23 15:25:03 +00:00
Bénédikt Tran
1decc7ee20
[3.14] gh-142516: fix reference leaks in ssl.SSLContext objects (GH-143685) (#145075)
* [3.14] gh-142516: fix reference leaks in `ssl.SSLContext` objects (GH-143685)
(cherry picked from commit 3a2a686cc4)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* fix backport
2026-02-21 13:31:23 -08:00
Bénédikt Tran
dcf96d0ed6
[3.14] gh-143698: correctly check scheduler and setpgroup values for os.posix_spawn[p] (GH-143699) (#145073)
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 347fc438cf)
2026-02-21 16:04:31 +01:00
Stan Ulbrych
8e482eb1ec
[3.14] compute-changes.py: Fix & test process_changed_files() (GH-144674) (#145013)
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2026-02-21 14:24:35 +02:00
Miss Islington (bot)
bfba660085
[3.14] gh-143916: Allow HTAB in wsgiref header values (#144761)
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-21 14:14:51 +02:00
Miss Islington (bot)
07dbda5a57
[3.14] gh-144809: Make deque copy atomic in free-threaded build (gh-144966) (#145053)
(cherry picked from commit 70da972f97)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2026-02-20 15:47:46 -05:00
Miss Islington (bot)
033e0f7e4f
[3.14] Correct MAX_N in Lib/zipfile ZipExtFile (GH-144973) (GH-145022)
"<<" has lower precedence than "-".
(cherry picked from commit 4141f0a1ee)

Co-authored-by: J Berg <j.berg2349@gmail.com>
2026-02-19 23:13:43 +00:00
Miss Islington (bot)
1404a4d9f2
[3.14] gh-144156: Fix email header folding concatenating encoded words (GH-144692) (#145009)
gh-144156: Fix email header folding concatenating encoded words (GH-144692)

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 0f7cd5544a)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2026-02-19 14:53:05 -05:00
Serhiy Storchaka
a3b6be9317
[3.14] gh-140652: Fix a crash in _interpchannels.list_all() after closing a channel (GH-143743) (GH-144954)
(cherry picked from commit 3f50432e31)
2026-02-18 13:29:34 +00:00
Miss Islington (bot)
2df57db47f
[3.14] gh-143637: Fix test_socket.test_sendmsg_reentrant_ancillary_mutation() on Solaris (GH-144890) (#144901)
gh-143637: Fix test_socket.test_sendmsg_reentrant_ancillary_mutation() on Solaris (GH-144890)

Use socket.SCM_RIGHTS operation.
(cherry picked from commit 63531a3867)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-17 10:16:21 +00:00
Miss Islington (bot)
95be16eb7b
[3.14] gh-144782: Make sure that ArgumentParser instances are pickleable (GH-144783) (#144895)
gh-144782: Make sure that ArgumentParser instances are pickleable (GH-144783)
(cherry picked from commit 2f7634c029)

Co-authored-by: Mauricio Villegas <5780272+mauvilsa@users.noreply.github.com>
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-02-17 02:53:51 +00:00
Miss Islington (bot)
907958c4ba
[3.14] gh-144601: Avoid sharing exception objects raised in a PyInit function across multiple interpreters (GH-144602) (GH-144633)
gh-144601: Avoid sharing exception objects raised in a `PyInit` function across multiple interpreters (GH-144602)
(cherry picked from commit fd6b639a49)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-02-16 10:37:46 -05:00
Peter Bierma
d148662326
[3.14] gh-144601: Use _testmultiphase instead of _testsinglephase in test_importlib (GH-144769) 2026-02-16 13:44:49 +01:00
Serhiy Storchaka
bcabbd02f6
[3.14] gh-80667: Fix lookup for Tangut ideographs in unicodedata (GH-144789) (GH-144871)
(cherry picked from commit 8b7b5a9946)

Co-authored-by: Pierre Le Marre <dev@wismill.eu>
2026-02-16 14:25:43 +02:00
Miss Islington (bot)
70ecd56113
[3.14] gh-144759: Fix undefined behavior from NULL pointer arithmetic in lexer (GH-144788) (#144834)
gh-144759: Fix undefined behavior from NULL pointer arithmetic in lexer (GH-144788)

Guard against NULL pointer arithmetic in `_PyLexer_remember_fstring_buffers`
and `_PyLexer_restore_fstring_buffers`. When `start` or `multi_line_start`
are NULL (uninitialized in tok_mode_stack[0]), performing `NULL - tok->buf`
is undefined behavior. Add explicit NULL checks to store -1 as sentinel
and restore NULL accordingly.

Add test_lexer_buffer_realloc_with_null_start to test_repl.py that
exercises the code path where the lexer buffer is reallocated while
tok_mode_stack[0] has NULL start/multi_line_start pointers. This
triggers _PyLexer_remember_fstring_buffers and verifies the NULL
checks prevent undefined behavior.
(cherry picked from commit e6110efd03)

Co-authored-by: Ramin Farajpour Cami <ramin.blackhat@gmail.com>
2026-02-15 15:10:15 +00:00
Miss Islington (bot)
5b0c1f780f
[3.14] gh-143637: Fix re-entrant mutation of ancillary data in socket.sendmsg() (GH-143892) (#144786)
gh-143637: Fix re-entrant mutation of ancillary data in socket.sendmsg() (GH-143892)
(cherry picked from commit 82b92e3cd1)

Co-authored-by: Priyanshu Singh <priyanshu2282@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-02-14 17:07:32 +00:00
Miss Islington (bot)
77b71ac793
[3.14] gh-144766: Fix a crash in fork child process when perf support is enabled. (GH-144795) (#144816) 2026-02-14 12:09:00 +00:00
Miss Islington (bot)
f24009feeb
[3.14] gh-144787: [tests] Allow TLS v1.2 to be minimum version (GH-144790) (#144791)
gh-144787: [tests] Allow TLS v1.2 to be minimum version (GH-144790)

Allow TLS v1.2 to be minimum version

Updates test_min_max_version to allow TLS v1.2 to be minimum version if
TLS 1.0 and 1.1 are disabled in OpenSSL.
(cherry picked from commit d625f7da33)

Co-authored-by: Colin McAllister <colinmca242@gmail.com>
2026-02-13 12:28:06 -08:00
Victor Stinner
c11e70a712
[3.14] gh-135906: Test more internal headers in test_cext/test_cppext (#144758)
* gh-141563: Enable test_cppext internal C API tests on macOS (#144711)

Build the C API in C++11 mode on macOS.

(cherry picked from commit c6e418d174)

* gh-135906: Test more internal headers in test_cext/test_cppext (#144751)

(cherry picked from commit b488f338cf)
2026-02-13 08:30:22 +01:00
Miss Islington (bot)
ac9e9e2c8f
[3.14] gh-80667: Fix case-sensitivity of some Unicode literal escapes (GH-107281) (GH-144753)
Lookup for CJK ideograms and Hangul syllables is now case-insensitive,
as is the case for other character names.
(cherry picked from commit e66f4a5a9c)

Co-authored-by: James <snoopjedi@gmail.com>
2026-02-12 17:22:05 +00:00
Serhiy Storchaka
4d3e8c1c85
[3.14] gh-84424: Use numeric_changed for UCD.numeric (GH-19457) (GH-144731)
This was causing ucd_3_2_0.numeric() to pick up only decimal
changes between Unicode 3.2.0 and the current version.
(cherry picked from commit 3e0322ff16)

Co-authored-by: William Meehan <wmeehan@fb.com>
2026-02-12 08:38:27 +00:00
Hugo van Kemenade
bbd682d1f4
[3.14] gh-144639: Ruff: target Python 3.14 syntax in Lib/test (GH-144656) (#144710)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2026-02-11 17:33:51 +02:00
Miss Islington (bot)
7d074702eb
[3.14] gh-143650: Fix importlib race condition on import failure (GH-143651) (#144662)
gh-143650: Fix importlib race condition on import failure (GH-143651)

Fix a race condition where a thread could receive a partially-initialized
module when another thread's import fails. The race occurs when:

1. Thread 1 starts importing, adds module to sys.modules
2. Thread 2 sees the module in sys.modules via the fast path
3. Thread 1's import fails, removes module from sys.modules
4. Thread 2 returns a stale module reference not in sys.modules

The fix adds verification after the "skip lock" optimization in both Python
and C code paths to check if the module is still in sys.modules. If the
module was removed (due to import failure), we retry the import so the
caller receives the actual exception from the import failure rather than
a stale module reference.
(cherry picked from commit ac8b5b6890)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 06:06:51 +00:00
Victor Stinner
815f21bda9
[3.14] gh-144490: Test the internal C API in test_cext (#144678)
Backport changes from the main branch.

Test also datetime.h in test_cppext.
2026-02-10 20:04:13 +00:00
Miss Islington (bot)
befa954efe
[3.14] gh-144629: Add test for the PyFunction_GetAnnotations() function (GH-144630) (#144670)
gh-144629: Add test for the PyFunction_GetAnnotations() function (GH-144630)
(cherry picked from commit cc81707e40)

Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
2026-02-10 15:05:25 +00:00
Bartosz Sławecki
616e611844
[3.14] gh-144563: Fix remote debugging with duplicate libpython mappings from ctypes (GH-144595) (#144655) 2026-02-10 14:31:49 +00:00
Victor Stinner
8b4210c30e
[3.14] gh-138744: Skip test_dtrace on Windows (#144657)
Co-authored-by: Ken Jin <kenjin@python.org>
2026-02-10 15:30:05 +01:00
Miss Islington (bot)
13b3dd0622
[3.14] gh-143543: Fix re-entrant use-after-free in itertools.groupby (GH-143738) (GH-144626)
(cherry picked from commit a91b5c3fb5)

Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-10 14:01:10 +01:00
Miss Islington (bot)
caab302332
[3.14] gh-144652: Support Windows exit status in support get_signal_name() (GH-144653) (#144658)
gh-144652: Support Windows exit status in support get_signal_name() (GH-144653)

Format Windows exit status as hexadecimal.
(cherry picked from commit b121dc4347)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-10 11:42:26 +00:00
Victor Stinner
2abaf12917
[3.14] gh-144490: Test the internal C API in test_cppext (#144547)
Backport changes from the main branch.
2026-02-10 11:55:57 +01:00
Miss Islington (bot)
9cc8e4948c
[3.14] gh-134179: Use sys._clear_internal_caches() at test_cmd_line (GH-134180) (#144631)
gh-134179: Use sys._clear_internal_caches() at test_cmd_line (GH-134180)

Use sys._clear_internal_caches() instead of deprecated sys._clear_type_cache() at test_cmd_line.
(cherry picked from commit dd2da42ea4)

Co-authored-by: alexey semenyuk <alexsemenyuk88@gmail.com>
2026-02-09 15:06:28 +00:00
Miss Islington (bot)
6006005893
[3.14] gh-144446: Fix some frame object thread-safety issues (gh-144479) (#144546)
Fix thread-safety issues when accessing frame attributes while another
thread is executing the frame:

- Add critical section to frame_repr() to prevent races when accessing
  the frame's code object and line number

- Add _Py_NO_SANITIZE_THREAD to PyUnstable_InterpreterFrame_GetLasti()
  to allow intentional racy reads of instr_ptr.

- Fix take_ownership() to not write to the original frame's f_executable
(cherry picked from commit 5bb3bbb9c6)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2026-02-06 15:25:36 +00:00
Victor Stinner
160810de89
[3.14] gh-144330: Initialize classmethod and staticmethod in new (#144498)
gh-144330: Initialize classmethod and staticmethod in new

Initialize cm_callable and sm_callable to None in classmethod and
staticmethod constructor.

Co-authored-by: Aniket Singh Yadav <singhyadavaniket43@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-06 10:21:02 +01:00
Miss Islington (bot)
72ec166846
[3.14] gh-142555: Fix null pointer dereference in array.__setitem__ via re-entrant __index__ (GH-142713) (#144396)
gh-142555: Fix null pointer dereference in array.__setitem__ via re-entrant __index__ (GH-142713)
(cherry picked from commit 39f16a93ef)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2026-02-03 11:38:50 +01:00
Miss Islington (bot)
5af4e680a9
[3.14] gh-75572: Speed up test_xpickle (GH-144393) (GH-144403)
Run a long living subprocess which handles multiple requests instead of
running a new subprocess for each request.
(cherry picked from commit 29acc08c8d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-03 10:34:16 +00:00
Miss Islington (bot)
b3937135a6
[3.14] gh-144415: Android testbed fixes (GH-142912) (#144416)
Modifies handling of `.gz` files in Android app payloads, and ensures that
when the Android testbed streams logs, stream flushes aren't treated as
newlines. This improves the output of test suites that use "one dot per test"
progress indicators.
(cherry picked from commit cb1dc91dcb)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2026-02-03 17:18:49 +08:00