]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 weeks agogh-141984: Reword and reorganize the first part of Atoms docs (GH-144117)
Petr Viktorin [Wed, 18 Feb 2026 13:13:21 +0000 (14:13 +0100)] 
gh-141984: Reword and reorganize the first part of Atoms docs (GH-144117)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
7 weeks agogh-140652: Fix a crash in _interpchannels.list_all() after closing a channel (ПР...
Serhiy Storchaka [Wed, 18 Feb 2026 12:54:48 +0000 (14:54 +0200)] 
gh-140652: Fix a crash in _interpchannels.list_all() after closing a channel (ПР-143743)

7 weeks agogh-141510: Implement copy and deepcopy for frozendict (#144905)
Pieter Eendebak [Wed, 18 Feb 2026 11:30:26 +0000 (12:30 +0100)] 
gh-141510: Implement copy and deepcopy for frozendict (#144905)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
7 weeks agogh-135573: Make pickled lists, sets and dicts a tiny bit smaller (GH-144162)
Serhiy Storchaka [Wed, 18 Feb 2026 11:20:31 +0000 (13:20 +0200)] 
gh-135573: Make pickled lists, sets and dicts a tiny bit smaller (GH-144162)

Ensure that APPENDS and SETITEMS are never used for a batch of size 1.
Ensure that ADDITEMS and SETITEMS are never used for a batch of size 0.

This harmonizes the C implementation with the Python implementation
which already guarantees this and makes a pickle a tiny bit smaller
with a tiny chance (about 0.1%).

Saves 1 byte for list and dict with size 1001, 2001, ...
Saves 2 bytes for set and dict with size 1000, 2000, ...

7 weeks agogh-144386: Update equivalent code for "with", "async with" and "async for" (GH-144472)
Serhiy Storchaka [Wed, 18 Feb 2026 11:13:32 +0000 (13:13 +0200)] 
gh-144386: Update equivalent code for "with", "async with" and "async for" (GH-144472)

They use special method lookup for special methods.

7 weeks agogh-144882: Optimize name tables in unicodedata by excluding names derived by rule...
Serhiy Storchaka [Wed, 18 Feb 2026 10:58:21 +0000 (12:58 +0200)] 
gh-144882: Optimize name tables in unicodedata by excluding names derived by rule NR2 (GH-144883)

Since the code for rule NR2 is already here, to support CJK unified
ideographs and Tangut ideographs, it can also be used for other names
derived by rule NR2.

7 weeks agogh-142224: unicodedata: support bidi classes for unassigned code points (GH-144815)
Stan Ulbrych [Wed, 18 Feb 2026 10:54:07 +0000 (10:54 +0000)] 
gh-142224: unicodedata: support bidi classes for unassigned code points (GH-144815)

7 weeks agoDocs: an "improve this page" feature (#144939)
Ned Batchelder [Wed, 18 Feb 2026 09:58:30 +0000 (04:58 -0500)] 
Docs: an "improve this page" feature (#144939)

* Docs: a start on an 'improve this page' feature

* pr feedback: simplify the link, and don't scare people with the cla

* pr feedback answered

- use the actual page URL
- tighten the wording

* fix the improve link on the improve page

* news item

* Update Doc/improve-page.rst

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

* A nojs version of the page

* comments to help people keep the two pages in sync

* protect against XSS

* use template for issues from the nojs page

* use the template from the JS page as well

* give the docs issue template a fillable description field

* ugh, getting sloppy

* remove more sloppiness

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
7 weeks agoDocs: Remove unnecessary entry from `nitpick_ignore` (GH-144933)
Stan Ulbrych [Wed, 18 Feb 2026 07:52:04 +0000 (07:52 +0000)] 
Docs: Remove unnecessary entry from `nitpick_ignore` (GH-144933)

7 weeks agoMove CODEOWNERS rule from devguide (GH-144924)
Stan Ulbrych [Wed, 18 Feb 2026 07:51:45 +0000 (07:51 +0000)] 
Move CODEOWNERS rule from devguide (GH-144924)

7 weeks agogh-144914: use `mimalloc` for raw allocations on free-threading (#144916)
Kumar Aditya [Wed, 18 Feb 2026 04:16:27 +0000 (09:46 +0530)] 
gh-144914: use `mimalloc` for raw allocations on free-threading (#144916)

7 weeks agogh-141510: Mention frozendict in dict documentation (#144934)
Victor Stinner [Tue, 17 Feb 2026 22:03:22 +0000 (23:03 +0100)] 
gh-141510: Mention frozendict in dict documentation (#144934)

test_genericalias now tests also frozendict.

7 weeks agogh-141510: Optimize {frozen}dict.fromkeys for frozendict (gh-144915)
Donghee Na [Tue, 17 Feb 2026 21:46:20 +0000 (06:46 +0900)] 
gh-141510: Optimize {frozen}dict.fromkeys for frozendict (gh-144915)

7 weeks agogh-141510: Update `test_xpickle` for `frozendict` (#144927)
Stan Ulbrych [Tue, 17 Feb 2026 20:26:29 +0000 (20:26 +0000)] 
gh-141510: Update `test_xpickle` for `frozendict` (#144927)

7 weeks agogh-141510: Change repr(frozendict) for empty dict (#144921)
Victor Stinner [Tue, 17 Feb 2026 18:04:17 +0000 (19:04 +0100)] 
gh-141510: Change repr(frozendict) for empty dict (#144921)

repr(frozendict()) returns "frozendict()" instead of
"frozendict({})".

7 weeks agogh-141510: Optimize hash(frozendict) (#144919)
Victor Stinner [Tue, 17 Feb 2026 17:39:33 +0000 (18:39 +0100)] 
gh-141510: Optimize hash(frozendict) (#144919)

hash(frozendict) no longer creates a temporary items view and a
temporary frozenset object.

Copy frozenset_hash() code to frozendict_hash().

7 weeks agogh-144438: Fix false sharing between QSBR and tlbc_index (gh-144554)
Sam Gross [Tue, 17 Feb 2026 16:12:25 +0000 (09:12 -0700)] 
gh-144438: Fix false sharing between QSBR and tlbc_index (gh-144554)

Align the QSBR thread state array to a 64-byte cache line boundary
and add padding at the end of _PyThreadStateImpl. Depending on heap
layout, the QSBR array could end up sharing a cache line with a
thread's tlbc_index, causing QSBR quiescent state updates to contend
with reads of tlbc_index in RESUME_CHECK. This is sensitive to
earlier allocations during interpreter init and can appear or
disappear with seemingly unrelated changes.

Either change alone is sufficient to fix the specific issue, but both
are worthwhile to avoid similar problems in the future.

7 weeks agogh-141510: Remove unncessary lock holding for frozendict repr (gh-144920)
Donghee Na [Tue, 17 Feb 2026 14:52:50 +0000 (23:52 +0900)] 
gh-141510: Remove unncessary lock holding for frozendict repr (gh-144920)

7 weeks agogh-141510: Update mp_length of frozendict to use non atomic operation (gh-144913)
Donghee Na [Tue, 17 Feb 2026 13:39:56 +0000 (22:39 +0900)] 
gh-141510: Update mp_length of frozendict to use non atomic operation (gh-144913)

7 weeks agoEnable CPU tests on default ARM build (#144743)
Hugo van Kemenade [Tue, 17 Feb 2026 10:49:31 +0000 (12:49 +0200)] 
Enable CPU tests on default ARM build (#144743)

7 weeks agogh-141510, PEP 814: Add built-in frozendict type (#144757)
Victor Stinner [Tue, 17 Feb 2026 09:54:41 +0000 (10:54 +0100)] 
gh-141510, PEP 814: Add built-in frozendict type (#144757)

Add TYPE_FROZENDICT to the marshal module.

Add C API functions:

* PyAnyDict_Check()
* PyAnyDict_CheckExact()
* PyFrozenDict_Check()
* PyFrozenDict_CheckExact()
* PyFrozenDict_New()

Add PyFrozenDict_Type C type.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
7 weeks agogh-143637: Fix test_socket.test_sendmsg_reentrant_ancillary_mutation() on Solaris...
Victor Stinner [Tue, 17 Feb 2026 09:49:30 +0000 (10:49 +0100)] 
gh-143637: Fix test_socket.test_sendmsg_reentrant_ancillary_mutation() on Solaris (#144890)

Use socket.SCM_RIGHTS operation.

7 weeks agogh-144782: Make sure that ArgumentParser instances are pickleable (#144783)
Mauricio Villegas [Tue, 17 Feb 2026 02:28:21 +0000 (03:28 +0100)] 
gh-144782: Make sure that ArgumentParser instances are pickleable (#144783)

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>
7 weeks agogh-142349: Fix ast.unparse for lazy import statements (#144893)
Pablo Galindo Salgado [Mon, 16 Feb 2026 22:57:49 +0000 (22:57 +0000)] 
gh-142349: Fix ast.unparse for lazy import statements (#144893)

The unparser was not handling the `is_lazy` attribute on Import and
ImportFrom AST nodes, causing lazy imports to be unparsed as regular
imports. This broke the round-trip (parse → unparse → reparse) for
any file containing `lazy import` statements.

7 weeks agogh-140715: Add `%D` format code support to `strptime()` (GH-144819)
Jason Yalim, PhD [Mon, 16 Feb 2026 22:20:37 +0000 (15:20 -0700)] 
gh-140715: Add `%D` format code support to `strptime()` (GH-144819)

* %D support for strptime, including test and Doc update
* additional %D test
* change documentation example date for %D so it is more legible to non-US readers
* change testing date for %D so it is more legible to non-US readers
* mv News blurb to Library, consistent with previous %F change
* change invalid format code from %D to C-standard unused %!
* Fix erroneous and misleading example Doc to %y from %Y, use correct C99+ definition for C99 %D; update additional tests

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
7 weeks agogh-144878: Gate PEP 810 builtins in xpickle compat tests (#144889)
Pablo Galindo Salgado [Mon, 16 Feb 2026 21:48:08 +0000 (21:48 +0000)] 
gh-144878: Gate PEP 810 builtins in xpickle compat tests (#144889)

7 weeks agobpo-32234: Allow mailbox instances as context managers (GH-4770)
sblondon [Mon, 16 Feb 2026 13:14:26 +0000 (14:14 +0100)] 
bpo-32234: Allow mailbox instances as context managers (GH-4770)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
7 weeks agogh-80667: Fix Tangut ideographs names in unicodedata (GH-144789)
Serhiy Storchaka [Mon, 16 Feb 2026 11:31:18 +0000 (13:31 +0200)] 
gh-80667: Fix Tangut ideographs names in unicodedata (GH-144789)

Co-authored-by: Pierre Le Marre <dev@wismill.eu>
7 weeks agogh-144551: Update iOS builds to use OpenSSL 3.0.19 (GH-144865)
Zachary Ware [Mon, 16 Feb 2026 05:02:23 +0000 (23:02 -0600)] 
gh-144551: Update iOS builds to use OpenSSL 3.0.19 (GH-144865)

7 weeks agogh-144551: Update Android builds to use OpenSSL 3.0.19 (GH-144864)
Zachary Ware [Mon, 16 Feb 2026 05:02:07 +0000 (23:02 -0600)] 
gh-144551: Update Android builds to use OpenSSL 3.0.19 (GH-144864)

7 weeks agogh-144833: Fix use-after-free in SSL module when SSL_new() fails (GH-144843)
Ramin Farajpour Cami [Mon, 16 Feb 2026 02:43:07 +0000 (06:13 +0330)] 
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().

7 weeks agogh-86519: Add prefixmatch APIs to the re module (GH-31137)
Gregory P. Smith [Mon, 16 Feb 2026 01:43:39 +0000 (17:43 -0800)] 
gh-86519: Add prefixmatch APIs to the re module (GH-31137)

Adds `prefixmatch` APIs to the re module as an alternate name for our long existing `match` APIs to help alleviate a common Python confusion for those coming from other languages regular expression libraries.

These alleviate common confusion around what "match" means as Python is different than other popular languages regex libraries in our use of the term as an API name.  The original `match` names are **NOT being deprecated**.  Source tooling like linters, IDEs, and LLMs could suggest using `prefixmatch` instead of match to improve code health and reduce cognitive burden of understanding the intent of code when configured for a modern minimum Python version.

See the documentation changes for a better description.

Discussions took place in the PR, in the issue, and finally at https://discuss.python.org/t/add-re-prefixmatch-deprecate-re-match/105927

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 weeks agogh-144727: Add test for circular lazy import crash (#144727) (#144838)
Pablo Galindo Salgado [Sun, 15 Feb 2026 18:36:47 +0000 (18:36 +0000)] 
gh-144727: Add test for circular lazy import crash (#144727) (#144838)

Add a regression test ensuring that circular lazy imports raise a proper
error (ImportCycleError) instead of crashing with a segfault. The crash
was fixed in gh-144733 but no test was added at the time.

7 weeks agoFormat CODEOWNERS file (#144842)
Pablo Galindo Salgado [Sun, 15 Feb 2026 16:11:16 +0000 (16:11 +0000)] 
Format CODEOWNERS file (#144842)

7 weeks agogh-142349: Add CODEOWNERS for lazy imports (#144840)
Pablo Galindo Salgado [Sun, 15 Feb 2026 16:07:03 +0000 (16:07 +0000)] 
gh-142349: Add CODEOWNERS for lazy imports (#144840)

7 weeks agoadd whatsnew entry for `PyUnstable_SetImmortal` and `PyDatetime_IMPORT` (#144830)
Kumar Aditya [Sun, 15 Feb 2026 14:51:54 +0000 (20:21 +0530)] 
add whatsnew entry for `PyUnstable_SetImmortal` and `PyDatetime_IMPORT` (#144830)

7 weeks agogh-144759: Fix undefined behavior from NULL pointer arithmetic in lexer (#144788)
Ramin Farajpour Cami [Sun, 15 Feb 2026 14:39:57 +0000 (18:09 +0330)] 
gh-144759: Fix undefined behavior from NULL pointer arithmetic in lexer (#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.

8 weeks agogh-144822: remove redundant decref in `codegen.c` (#144823)
Benedikt Johannes [Sat, 14 Feb 2026 19:20:33 +0000 (20:20 +0100)] 
gh-144822: remove redundant decref in `codegen.c` (#144823)

8 weeks agofix warnings in jit builds (GH-144817)
Chris Eibl [Sat, 14 Feb 2026 17:39:10 +0000 (18:39 +0100)] 
fix warnings in jit builds (GH-144817)

8 weeks agoremove unused _PyFunction_LookupByVersion (GH-144814)
Chris Eibl [Sat, 14 Feb 2026 14:09:01 +0000 (15:09 +0100)] 
remove unused _PyFunction_LookupByVersion (GH-144814)

8 weeks agogh-144766: Fix a crash in fork child process when perf support is enabled. (#144795)
Yilei [Sat, 14 Feb 2026 11:41:28 +0000 (03:41 -0800)] 
gh-144766: Fix a crash in fork child process when perf support is enabled. (#144795)

8 weeks agogh-138912: Improve MATCH_CLASS opcode performance (GH-138915)
Marc Mueller [Sat, 14 Feb 2026 05:06:15 +0000 (06:06 +0100)] 
gh-138912: Improve MATCH_CLASS opcode performance (GH-138915)

Only check for duplicates if there is at least one positional pattern.
With a test case for duplicate keyword attributes.

8 weeks agogh-144551: Update various CI jobs to OpenSSL 3.5 (GH-144808)
Zachary Ware [Fri, 13 Feb 2026 23:02:11 +0000 (17:02 -0600)] 
gh-144551: Update various CI jobs to OpenSSL 3.5 (GH-144808)

Also includes a fix to the address sanitizer build to build the `_ssl`
module against the expected OpenSSL build.

8 weeks agogh-144551: Update OpenSSL version references in Mac/BuildScript/ (GH-144810)
Zachary Ware [Fri, 13 Feb 2026 22:50:15 +0000 (16:50 -0600)] 
gh-144551: Update OpenSSL version references in Mac/BuildScript/ (GH-144810)

8 weeks agogh-144551: Update Windows builds to use OpenSSL 3.5.5 (GH-144796)
Zachary Ware [Fri, 13 Feb 2026 21:43:05 +0000 (15:43 -0600)] 
gh-144551: Update Windows builds to use OpenSSL 3.5.5 (GH-144796)

8 weeks agogh-136672: Docs: Move parts of Enum HOWTO to API Docs (GH-139176)
Rafael Weingartner-Ortner [Fri, 13 Feb 2026 19:51:56 +0000 (20:51 +0100)] 
gh-136672: Docs: Move parts of Enum HOWTO to API Docs (GH-139176)

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

8 weeks agogh-144551: Update CI to use latest OpenSSL versions (GH-144794)
Zachary Ware [Fri, 13 Feb 2026 19:06:07 +0000 (13:06 -0600)] 
gh-144551: Update CI to use latest OpenSSL versions (GH-144794)

Also update _ssl_data_36.h to include an added symbol from 3.6.1.

8 weeks agogh-144551: Update Windows builds to use OpenSSL 3.0.19 (GH-144793)
Zachary Ware [Fri, 13 Feb 2026 18:48:52 +0000 (12:48 -0600)] 
gh-144551: Update Windows builds to use OpenSSL 3.0.19 (GH-144793)

8 weeks agogh-144787: [tests] Allow TLS v1.2 to be minimum version (GH-144790)
Colin McAllister [Fri, 13 Feb 2026 17:17:53 +0000 (11:17 -0600)] 
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.

8 weeks agogh-143637: Fix re-entrant mutation of ancillary data in socket.sendmsg() (#143892)
Priyanshu Singh [Fri, 13 Feb 2026 15:35:08 +0000 (21:05 +0530)] 
gh-143637: Fix re-entrant mutation of ancillary data in socket.sendmsg() (#143892)

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>
8 weeks agogh-144706: Warn against using synchronization primitives within signal handlers ...
Robsdedude [Thu, 12 Feb 2026 23:15:23 +0000 (00:15 +0100)] 
gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736)

8 weeks agogh-143916: Allow HTAB in wsgiref header values
Seth Michael Larson [Thu, 12 Feb 2026 20:40:21 +0000 (14:40 -0600)] 
gh-143916: Allow HTAB in wsgiref header values

Co-authored-by: Victor Stinner <vstinner@python.org>
8 weeks agogh-135906: Test more internal headers in test_cext/test_cppext (#144751)
Victor Stinner [Thu, 12 Feb 2026 18:40:42 +0000 (19:40 +0100)] 
gh-135906: Test more internal headers in test_cext/test_cppext (#144751)

8 weeks agogh-80667: Fix case-sensitivity of some Unicode literal escapes (GH-107281)
James [Thu, 12 Feb 2026 16:50:40 +0000 (11:50 -0500)] 
gh-80667: Fix case-sensitivity of some Unicode literal escapes (GH-107281)

Lookup for CJK ideograms and Hangul syllables is now case-insensitive,
as is the case for other character names.

8 weeks agogh-121617: Include <string.h> for Py_CLEAR() macro (#144666)
Victor Stinner [Thu, 12 Feb 2026 16:03:55 +0000 (17:03 +0100)] 
gh-121617: Include <string.h> for Py_CLEAR() macro (#144666)

Python.h now also includes <string.h> in the limited C API version 3.11
and newer to fix the Py_CLEAR() macro which uses memcpy().

Add a Py_CLEAR() test in test_cext.

Modify also _Py_TYPEOF to use C23 typeof() if available.

8 weeks agogh-138744: Upgrade Windows to 2025 in GitHub Actions (#144682)
Victor Stinner [Thu, 12 Feb 2026 15:19:50 +0000 (16:19 +0100)] 
gh-138744: Upgrade Windows to 2025 in GitHub Actions (#144682)

Replace windows-2022 with windows-2025.

8 weeks agogh-144285: Improve `AttributeError` attribute suggestions (#144299)
Bartosz Sławecki [Thu, 12 Feb 2026 14:12:49 +0000 (15:12 +0100)] 
gh-144285: Improve `AttributeError` attribute suggestions (#144299)

8 weeks agogh-142349: Fix refcount corruption in lazy import specialization (#144733)
Pablo Galindo Salgado [Thu, 12 Feb 2026 11:45:28 +0000 (11:45 +0000)] 
gh-142349: Fix refcount corruption in lazy import specialization (#144733)

Remove spurious Py_DECREF on borrowed ref in LOAD_GLOBAL specialization

_PyDict_LookupIndexAndValue() returns a borrowed reference via
_Py_dict_lookup(), but specialize_load_global_lock_held() called
Py_DECREF(value) on it when bailing out for lazy imports. Each time
the adaptive counter fired while a lazy import was still in globals,
this stole one reference from the dict's object. With 8+ threads
racing through LOAD_GLOBAL during concurrent lazy import resolution,
enough triggers accumulated to drive the refcount to zero while the
dict and other threads still referenced the object, causing
use-after-free.

8 weeks agogh-57095: Add note about input splitting in `datetime.*.strptime` (GH-131049)
Stan Ulbrych [Thu, 12 Feb 2026 10:35:42 +0000 (10:35 +0000)] 
gh-57095: Add note about input splitting in `datetime.*.strptime` (GH-131049)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
8 weeks agoAdd missing step to `Modules/expat/refresh.sh` instructions (GH-144719)
Stan Ulbrych [Thu, 12 Feb 2026 08:55:26 +0000 (08:55 +0000)] 
Add missing step to `Modules/expat/refresh.sh` instructions (GH-144719)

8 weeks agogh-142349: Fix build errors from PEP 810 (#144726)
Pablo Galindo Salgado [Thu, 12 Feb 2026 08:18:36 +0000 (08:18 +0000)] 
gh-142349: Fix build errors from PEP 810 (#144726)

8 weeks agogh-106318: Fix incorrectly rendered code block in `str.isalnum()` docs (GH-144718)
Adorilson Bezerra [Thu, 12 Feb 2026 07:40:17 +0000 (07:40 +0000)] 
gh-106318: Fix incorrectly rendered code block in `str.isalnum()` docs (GH-144718)

8 weeks agogh-142349: Implement PEP 810 - Explicit lazy imports (#142351)
Pablo Galindo Salgado [Thu, 12 Feb 2026 00:15:33 +0000 (00:15 +0000)] 
gh-142349: Implement PEP 810 - Explicit lazy imports (#142351)

Co-authored-by: T. Wouters <twouters@meta.com >
Co-authored-by: Brittany Reynoso <breynoso@meta.com>
Co-authored-by: Dino Viehland <dinoviehland@meta.com>
8 weeks agogh-144675: update to WASI SDK 30 (#144676)
Roman Volosatovs [Thu, 12 Feb 2026 00:12:08 +0000 (01:12 +0100)] 
gh-144675: update to WASI SDK 30 (#144676)

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
8 weeks agogh-84424: Use numeric_changed for UCD.numeric (GH-19457)
William Meehan [Wed, 11 Feb 2026 20:58:24 +0000 (15:58 -0500)] 
gh-84424: Use numeric_changed for UCD.numeric (GH-19457)

This was causing ucd_3_2_0.numeric() to pick up only decimal
changes between Unicode 3.2.0 and the current version.

8 weeks agogh-141563: Enable test_cppext internal C API tests on macOS (#144711)
Victor Stinner [Wed, 11 Feb 2026 17:38:23 +0000 (18:38 +0100)] 
gh-141563: Enable test_cppext internal C API tests on macOS (#144711)

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

8 weeks agoFix typos and grammar errors across documentation (#144709)
Ronald Eddy Jr [Wed, 11 Feb 2026 16:35:25 +0000 (11:35 -0500)] 
Fix typos and grammar errors across documentation (#144709)

8 weeks agoMerge branch 'main' of https://github.com/python/cpython
Hugo van Kemenade [Wed, 11 Feb 2026 15:34:44 +0000 (17:34 +0200)] 
Merge branch 'main' of https://github.com/python/cpython

8 weeks agoPost 3.15.0a6
Hugo van Kemenade [Wed, 11 Feb 2026 15:33:36 +0000 (17:33 +0200)] 
Post 3.15.0a6

8 weeks agogh-143300: implement `PyUnstable_SetImmortal` for marking objects as immortal (#144543)
Kumar Aditya [Wed, 11 Feb 2026 15:29:31 +0000 (20:59 +0530)] 
gh-143300: implement `PyUnstable_SetImmortal` for marking objects as immortal (#144543)

8 weeks agogh-144639: Ruff: target Python 3.14 syntax in `Lib/test` (#144656)
Hugo van Kemenade [Wed, 11 Feb 2026 14:12:31 +0000 (16:12 +0200)] 
gh-144639: Ruff: target Python 3.14 syntax in `Lib/test` (#144656)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
8 weeks agogh-142518: Document thread-safety guarantees of dict operations (#144184)
Lysandros Nikolaou [Wed, 11 Feb 2026 13:33:00 +0000 (14:33 +0100)] 
gh-142518: Document thread-safety guarantees of dict operations (#144184)

* Address feedback; move thread safety section below see-also
* Address feedback - don't mention equality comparison only
* Change admonition to rubric; cross-reference glossary

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
8 weeks agoDocs: remove links of modules to themselves (#144695)
Ned Batchelder [Wed, 11 Feb 2026 12:56:36 +0000 (07:56 -0500)] 
Docs: remove links of modules to themselves (#144695)

8 weeks agogh-142518: Define lock-free and per-object lock (#144548)
Lysandros Nikolaou [Wed, 11 Feb 2026 12:55:36 +0000 (13:55 +0100)] 
gh-142518: Define lock-free and per-object lock (#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

8 weeks agogh-144321: Fix named tuple bug when input is a non-sequence iterable (#144600)
bkap123 [Wed, 11 Feb 2026 12:44:22 +0000 (07:44 -0500)] 
gh-144321: Fix named tuple bug when input is a non-sequence iterable (#144600)

8 weeks agoPython 3.15.0a6 v3.15.0a6
Hugo van Kemenade [Wed, 11 Feb 2026 12:22:36 +0000 (14:22 +0200)] 
Python 3.15.0a6

8 weeks agogh-106318: Improve str.rstrip() method doc (#143893)
Adorilson Bezerra [Wed, 11 Feb 2026 08:41:37 +0000 (08:41 +0000)] 
gh-106318: Improve str.rstrip() method doc (#143893)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
8 weeks agogh-140421: Disable perf trampoline on older macOS (#144647)
Joshua Root [Wed, 11 Feb 2026 04:27:16 +0000 (15:27 +1100)] 
gh-140421: Disable perf trampoline on older macOS (#144647)

Trampoline requires clock_gettime() which was added in macOS 10.12.

8 weeks agogh-138122: Add sampling profiler visualisation to docs (#142772)
László Kiss Kollár [Tue, 10 Feb 2026 23:09:07 +0000 (23:09 +0000)] 
gh-138122: Add sampling profiler visualisation to docs (#142772)

Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
8 weeks agodocs: profiling.sampling: Fix sampling-rate default value description typo (#144686)
Dov Murik [Tue, 10 Feb 2026 21:55:40 +0000 (16:55 -0500)] 
docs: profiling.sampling: Fix sampling-rate default value description typo (#144686)

8 weeks agogh-141563: Fix test_cppext on macOS (#144685)
Victor Stinner [Tue, 10 Feb 2026 19:31:12 +0000 (20:31 +0100)] 
gh-141563: Fix test_cppext on macOS (#144685)

Don't test internal header files including mimalloc on macOS since
mimalloc emits compiler warnings:

  In file included from extension.cpp:21:
  In file included from Include/internal/pycore_backoff.h:15:
  In file included from Include/internal/pycore_interp_structs.h:15:
  In file included from Include/internal/pycore_tstate.h:14:
  In file included from Include/internal/pycore_mimalloc.h:43:
  Include/internal/mimalloc/mimalloc.h:464:85: error: defaulted
  function definitions are a C++11 extension
  [-Werror,-Wc++11-extensions]
    mi_stl_allocator() mi_attr_noexcept = default;
                                                                                      ^
  Include/internal/mimalloc/mimalloc.h:465:85: error: defaulted
  function definitions are a C++11 extension
  [-Werror,-Wc++11-extensions]
    mi_stl_allocator(const mi_stl_allocator&) mi_attr_noexcept = default;

Log also CXX and CXXFLAGS env vars in test_cppext. Log also CPPFLAGS
in test_cext.

8 weeks agogh-141563: Fix test_cext on Windows (#144677)
Victor Stinner [Tue, 10 Feb 2026 17:27:44 +0000 (18:27 +0100)] 
gh-141563: Fix test_cext on Windows (#144677)

The 'module' argument is now always needed to call the test_datetime
method.

8 weeks agogh-133879: Copyedit "What's new in Python 3.15" (#144661)
Hugo van Kemenade [Tue, 10 Feb 2026 16:49:20 +0000 (18:49 +0200)] 
gh-133879: Copyedit "What's new in Python 3.15" (#144661)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
8 weeks agogh-141563: Don't test datetime.h with the limited C API (#144673)
Victor Stinner [Tue, 10 Feb 2026 15:45:24 +0000 (16:45 +0100)] 
gh-141563: Don't test datetime.h with the limited C API (#144673)

Fix test_cext and test_cppext.

8 weeks agogh-141563: Add missing cast to _PyDateTime_IMPORT() (#144667)
Victor Stinner [Tue, 10 Feb 2026 14:47:12 +0000 (15:47 +0100)] 
gh-141563: Add missing cast to _PyDateTime_IMPORT() (#144667)

Fix compilation on C++.

Add test on PyDateTime_IMPORT in test_cext and test_cppext.

8 weeks agogh-144629: Add test for the PyFunction_GetAnnotations() function (#144630)
Nybblista [Tue, 10 Feb 2026 14:38:24 +0000 (17:38 +0300)] 
gh-144629: Add test for the PyFunction_GetAnnotations() function (#144630)

8 weeks agogh-134584: Optimize `_BINARY_OP_SUBSCR_LIST_SLICE` (GH-144659)
Sacul [Tue, 10 Feb 2026 14:33:32 +0000 (22:33 +0800)] 
gh-134584: Optimize `_BINARY_OP_SUBSCR_LIST_SLICE` (GH-144659)

8 weeks agoClarify the docs for `args` in asyncio callbacks (#143873)
Aarni Koskela [Tue, 10 Feb 2026 13:10:01 +0000 (15:10 +0200)] 
Clarify the docs for `args` in asyncio callbacks (#143873)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
8 weeks agogh-143650: Fix importlib race condition on import failure (GH-143651)
Gregory P. Smith [Tue, 10 Feb 2026 13:08:33 +0000 (05:08 -0800)] 
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.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8 weeks agogh-144652: Support Windows exit status in support get_signal_name() (#144653)
Victor Stinner [Tue, 10 Feb 2026 11:15:14 +0000 (12:15 +0100)] 
gh-144652: Support Windows exit status in support get_signal_name() (#144653)

Format Windows exit status as hexadecimal.

8 weeks agogh-144490: Fix mimalloc debug build for C++ (#144620)
Alper [Tue, 10 Feb 2026 10:56:52 +0000 (02:56 -0800)] 
gh-144490: Fix mimalloc debug build for C++ (#144620)

8 weeks agogh-72798: Add mapping example to str.translate documentation (#144454)
kovan [Tue, 10 Feb 2026 10:13:40 +0000 (11:13 +0100)] 
gh-72798: Add mapping example to str.translate documentation (#144454)

Add an example showing how to use str.translate() with a dictionary
mapping directly, demonstrating character replacement and deletion.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
8 weeks agogh-144563: Fix remote debugging with duplicate libpython mappings from ctypes (#144595)
Pablo Galindo Salgado [Tue, 10 Feb 2026 10:04:50 +0000 (10:04 +0000)] 
gh-144563: Fix remote debugging with duplicate libpython mappings from ctypes (#144595)

When _ctypes is imported, it may call dlopen on the libpython shared
library, causing the dynamic linker to load a second mapping of the
library into the process address space. The remote debugging code
iterates memory regions from low addresses upward and returns the first
mapping whose filename matches libpython. After _ctypes is imported, it
finds the dlopen'd copy first, but that copy's PyRuntime section was
never initialized, so reading debug offsets from it fails.

Fix this by validating each candidate PyRuntime address before accepting
it. The validation reads the first 8 bytes and checks for the "xdebugpy"
cookie that is only present in an initialized PyRuntime. Uninitialized
duplicate mappings will fail this check and be skipped, allowing the
search to continue to the real, initialized PyRuntime.

8 weeks agogh-144648: Improve libproc usage in _remote_debugging (#144649)
Joshua Root [Tue, 10 Feb 2026 08:29:55 +0000 (19:29 +1100)] 
gh-144648: Improve libproc usage in _remote_debugging (#144649)

8 weeks agogh-144551: Update macOS installer to use OpenSSL 3.5.5 (#144645)
Ned Deily [Tue, 10 Feb 2026 06:45:55 +0000 (01:45 -0500)] 
gh-144551: Update macOS installer to use OpenSSL 3.5.5 (#144645)

8 weeks agogh-124111: Update macOS installer to use Tcl/Tk 9.0.3 (#144646)
Ned Deily [Tue, 10 Feb 2026 06:45:06 +0000 (01:45 -0500)] 
gh-124111: Update macOS installer to use Tcl/Tk 9.0.3 (#144646)

2 months agoDisable pip version check when upgrading certifi (#144632)
Hugo van Kemenade [Tue, 10 Feb 2026 03:04:52 +0000 (05:04 +0200)] 
Disable pip version check when upgrading certifi (#144632)

2 months agogh-144278: Enable overriding sys.implementation's name and cache_tag when building...
Steve Dower [Tue, 10 Feb 2026 00:01:17 +0000 (00:01 +0000)] 
gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293)

Changing the values requires forking and patching, which is intentional. Simply rebuilding from source does not change the implementation enough to justify changing these values - they would still be `cpython` and compatible with existing `.pyc` files. But people who maintain forks are better served by being able to easily override these values in a place that can be forward-ported reliably.

2 months agoGH-144552: Clean up `tail-call.yml ` CI (#144553)
Savannah Ostrowski [Mon, 9 Feb 2026 22:52:45 +0000 (14:52 -0800)] 
GH-144552: Clean up `tail-call.yml ` CI (#144553)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 months agogh-144492: Fix `process_changed_files` outputs for `reusable-{macos, wasi}.yml` ...
Stan Ulbrych [Mon, 9 Feb 2026 17:30:19 +0000 (17:30 +0000)] 
gh-144492: Fix `process_changed_files` outputs for `reusable-{macos, wasi}.yml` (#144518)

Fix `process_changed_files` double-processing reusable-{macos, wasi] ending up with incorrect outputs