Commit graph

128811 commits

Author SHA1 Message Date
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)
e69501969b
[3.14] Simplify summary tables in the itertools docs (gh-145050) (gh-145051) 2026-02-20 12:52:26 -06: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
Miss Islington (bot)
24b53097d9
[3.14] Remove unused :platform: in module's docs (GH-144988) (GH-144994)
Remove unused :platform: in module's docs (GH-144988)

It has not been outputted since Sphinx 1.1.
(cherry picked from commit 20caf1c084)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-19 11:51:18 +00:00
Victor Stinner
f67cf83a4e
[3.14] gh-144763: Fix race conditions in tracemalloc (#144779) (#144965)
gh-144763: Fix race conditions in tracemalloc (#144779)

Avoid PyUnstable_InterpreterFrame_GetLine() since it uses a critical
section which can lead to a deadlock.

_PyTraceMalloc_Stop() now also calls PyRefTracer_SetTracer() without
holding TABLES_LOCK() to prevent another deadlock.

(cherry picked from commit 83f4fffe3d)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-02-18 20:55:38 +01:00
Miss Islington (bot)
2ae7c2fadf
[3.14] gh-141984: Reword and reorganize the first part of Atoms docs (GH-144117) (GH-144959)
(cherry picked from commit 112d8ac972)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-18 17:59:17 +01:00
Stan Ulbrych
8fa0f91e6f
[3.14] Datetime: Tidy up docs (GH-144720) (GH-144956)
(cherry picked from commit c6a142f947)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-02-18 15:14:44 +01: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)
dafd35fea7
[3.14] gh-144386: Update equivalent code for "with", "async with" and "async for" (GH-144472) (GH-144945)
They use special method lookup for special methods.
(cherry picked from commit 9e8fa2d4d1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-02-18 11:19:02 +00:00
Ned Batchelder
a81554f587
[3.14] Docs: an "improve this page" feature (GH-144939) (#144943)
---------
(cherry picked from commit 7a7521bcfa)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-18 05:27:09 -05:00
Stan Ulbrych
b1accd51d8
[3.14] Fix typos and grammar errors across documentation (GH-144709) (#144801)
(cherry picked from commit 3718f4be60)

Co-authored-by: Ronald Eddy Jr <ronald_eddy@yahoo.com>
2026-02-17 12:53:42 +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
Ned Deily
8f7e9c239f
[3.14] gh-144551: Update macOS installer to use OpenSSL 3.0.19 (#144897) 2026-02-17 00:42:04 -05: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)
46e7189d09
[3.14] gh-144551: Update Android builds to use OpenSSL 3.0.19 (GH-144866)
(cherry picked from commit 87c7f193b8)

Co-authored-by: Zachary Ware <zach@python.org>
2026-02-15 23:26:34 -06:00
Miss Islington (bot)
15c8bfd04a
[3.14] gh-144551: Update iOS builds to use OpenSSL 3.0.19 (GH-144867)
(cherry picked from commit ebe02e4f39)

Co-authored-by: Zachary Ware <zach@python.org>
2026-02-16 05:21:43 +00:00
Miss Islington (bot)
53b8e64150
[3.14] gh-144833: Fix use-after-free in SSL module when SSL_new() fails (GH-144843) (#144858)
gh-144833: Fix use-after-free in SSL module when SSL_new() fails (GH-144843)

In newPySSLSocket(), when SSL_new() returns NULL, Py_DECREF(self)
was called before _setSSLError(get_state_ctx(self), ...), causing
a use-after-free. Additionally, get_state_ctx() was called with
self (PySSLSocket*) instead of sslctx (PySSLContext*), which is
a type confusion bug.

Fix by calling _setSSLError() before Py_DECREF() and using
sslctx instead of self for get_state_ctx().
(cherry picked from commit c91638ca06)

Co-authored-by: Ramin Farajpour Cami <ramin.blackhat@gmail.com>
2026-02-16 03:10:23 +00: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
Zachary Ware
c7ceb75ada
[3.14] gh-144551: Update CI to use latest OpenSSL versions (GH-144794) (#144799)
[3.14] gh-144551: Update CI to use latest OpenSSL versions

Also update _ssl_data_35.h to include an added symbol from 3.5.5.

(cherry picked from commit b933ef9261)
2026-02-13 22:31:27 +02: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
Zachary Ware
a7f06e3840
[3.14] gh-144551: Update Windows builds to use OpenSSL 3.0.19 (GH-144797)
(cherry picked from commit 928602c0ac)
2026-02-13 19:38:31 +00: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)
fdbdd9fb5c
[3.14] gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736) (GH-144767)
gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736)
(cherry picked from commit 945bf8ce1b)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
2026-02-12 23:21:17 +00: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
Miss Islington (bot)
7f5a3acded
[3.14] gh-57095: Add note about input splitting in datetime.*.strptime (GH-131049) (GH-144735)
(cherry picked from commit 2e3e76e5cd)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-12 11:44:32 +01: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)
3aef49417e
[3.14] gh-142518: Document thread-safety guarantees of dict operations (GH-144184) (#144708)
* Address feedback; move thread safety section below see-also
* Address feedback - don't mention equality comparison only
* Change admonition to rubric; cross-reference glossary

---------
(cherry picked from commit 35dc547ab5)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-11 14:39:40 +01:00
Miss Islington (bot)
8c4ce4be26
[3.14] gh-142518: Define lock-free and per-object lock (GH-144548) (#144704)
gh-142518: Define lock-free and per-object lock (GH-144548)

- Add definitions of lock-free and per-object lock to the glossary
- Cross-reference these from list thread safety notes
- Change admonition to rubric
(cherry picked from commit 12dbae4c02)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2026-02-11 14:16:55 +01:00
Ned Batchelder
78fa4705d8
[3.14] Docs: remove links of modules to themselves (GH-144695) (#144705) 2026-02-11 08:09:56 -05:00
Miss Islington (bot)
a77dde441e
[3.14] gh-106318: Improve str.rstrip() method doc (GH-143893) (#144699)
gh-106318: Improve str.rstrip() method doc (GH-143893)
(cherry picked from commit 936d60dbe1)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-11 08:48:22 +00: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
Savannah Ostrowski
306049ba3c
[3.14] GH-144552: Clean up tail-call.yml CI (GH-144553) (#144683)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-02-10 20:42:18 +02:00
Hugo van Kemenade
1ae5771cba
[3.14] Bump pre-commit hooks (GH-144576) (#144591)
(cherry picked from commit e682141c49)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-02-10 10:10:20 -08: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)
bcbeff52be
[3.14] Clarify the docs for args in asyncio callbacks (GH-143873) (#144663)
Clarify the docs for `args` in asyncio callbacks (GH-143873)
(cherry picked from commit 40a82abe93)

Co-authored-by: Aarni Koskela <akx@iki.fi>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-02-10 13:16:26 +00: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)
3fc48c152b
[3.14] Disable pip version check when upgrading certifi (GH-144632) (#144641)
(cherry picked from commit 80ba4e10f5)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-02-10 03:24:17 +00:00
Miss Islington (bot)
2cc0720bdb
[3.14] gh-144492: Fix process_changed_files outputs for reusable-{macos, wasi}.yml (GH-144518) (#144635)
gh-144492: Fix `process_changed_files` outputs for `reusable-{macos, wasi}.yml` (GH-144518)

Fix `process_changed_files` double-processing reusable-{macos, wasi] ending up with incorrect outputs
(cherry picked from commit fd190d1fa1)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-09 17:57:43 +00:00