]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
3 months agogh-141510: Document ParameterizedMIMEHeader.params change (#145003)
Victor Stinner [Thu, 19 Feb 2026 21:13:16 +0000 (22:13 +0100)] 
gh-141510: Document ParameterizedMIMEHeader.params change (#145003)

Document also the dataclasses.field() metadata change.

3 months agogh-144986: Fix memory leak in atexit.register() (#144987)
Shamil [Thu, 19 Feb 2026 20:42:55 +0000 (23:42 +0300)] 
gh-144986: Fix memory leak in atexit.register() (#144987)

3 months agoAdd myself as a codeowner for the C API documentation (#145017)
Peter Bierma [Thu, 19 Feb 2026 20:18:37 +0000 (15:18 -0500)] 
Add myself as a codeowner for the C API documentation (#145017)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
3 months agogh-100239: Use ``PyFloat_AS_DOUBLE`` and `_PyLong_IsZero`` in the float / compactlong...
Chris Eibl [Thu, 19 Feb 2026 19:45:59 +0000 (20:45 +0100)] 
gh-100239: Use ``PyFloat_AS_DOUBLE`` and `_PyLong_IsZero`` in the float / compactlong specializations (#144826)

3 months agogh-144156: Fix email header folding concatenating encoded words (#144692)
Robsdedude [Thu, 19 Feb 2026 18:29:05 +0000 (19:29 +0100)] 
gh-144156: Fix email header folding concatenating encoded words (#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)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
3 months agoGH-144679: Switch to windows-2025-vs2026 build image in GitHub Actions (GH-145005)
Chris Eibl [Thu, 19 Feb 2026 18:10:00 +0000 (19:10 +0100)] 
GH-144679: Switch to windows-2025-vs2026 build image in GitHub Actions (GH-145005)

3 months ago`compute-changes.py`: Fix & test `process_changed_files()` (#144674)
Stan Ulbrych [Thu, 19 Feb 2026 16:49:34 +0000 (16:49 +0000)] 
`compute-changes.py`: Fix & test `process_changed_files()` (#144674)

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
3 months agoGH-144679: MSVC tailcall CI no longer needs to specify PlatformToolset (GH-145004)
Chris Eibl [Thu, 19 Feb 2026 16:38:26 +0000 (17:38 +0100)] 
GH-144679: MSVC tailcall CI no longer needs to specify PlatformToolset (GH-145004)

MSVC tailcall CI no longer needs to specify PlatformToolset

3 months agoGH-134872: add ModuleNotFoundError suggestions (#142512)
Filipe Laíns [Thu, 19 Feb 2026 16:10:58 +0000 (16:10 +0000)] 
GH-134872: add ModuleNotFoundError suggestions (#142512)

* gh-134872: Add traceback suggestions for ModuleNotFoundError

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Add news

Signed-off-by: Filipe Laíns <lains@riseup.net>
---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
3 months agogh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover (#139900)
Filipe Laíns [Thu, 19 Feb 2026 15:25:50 +0000 (15:25 +0000)] 
gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover (#139900)

* gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Fix doc reference

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Remove specific doc references

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Fix docstrings

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Revert "Remove specific doc references"

This reverts commit 31d1a8f5510e0f7a53016c7120ea2e1bda46e60c.

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Fix news references

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Add docs warning

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Raise ValueError on invalid parent

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Dedupe __path__ in PathFinder.discover

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Use context manager and add error handling to os.scandir

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Raise ValueError on invalid parent

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Dedupe when package exists with multiple suffixes

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Apply suggestions from code review

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* Add tests

Signed-off-by: Filipe Laíns <lains@riseup.net>
---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
3 months agogh-84393: Remove AIX workaround: re-enable posix_fadvise and f_allocate (GH-144784)
Petr Viktorin [Thu, 19 Feb 2026 14:11:21 +0000 (15:11 +0100)] 
gh-84393: Remove AIX workaround: re-enable posix_fadvise and f_allocate (GH-144784)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
3 months agogh-141510: Update ftscalingbench to support frozendict (gh-144999)
Donghee Na [Thu, 19 Feb 2026 14:06:15 +0000 (23:06 +0900)] 
gh-141510: Update ftscalingbench to support frozendict (gh-144999)

3 months agogh-144702: Use standard terminology in class pattern error message (#144703)
David Peter [Thu, 19 Feb 2026 13:31:13 +0000 (14:31 +0100)] 
gh-144702: Use standard terminology in class pattern error message (#144703)

3 months agogh-141510: Update Whats News for frozendict (gh-144961)
Donghee Na [Thu, 19 Feb 2026 12:48:57 +0000 (21:48 +0900)] 
gh-141510: Update Whats News for frozendict (gh-144961)

3 months agoGH-144679: When building with VS 2026 on Windows, use PlatformToolset v145 by default...
Chris Eibl [Thu, 19 Feb 2026 12:38:46 +0000 (13:38 +0100)] 
GH-144679: When building with VS 2026 on Windows, use PlatformToolset v145 by default (GH-144680)

3 months agoGH-144651: Optimize the new uops added when recording values during tracing. (GH...
Mark Shannon [Thu, 19 Feb 2026 11:52:57 +0000 (11:52 +0000)] 
GH-144651: Optimize the new uops added when recording values during tracing. (GH-144948)

* Handle dependencies in the optimizer, not the tracer
* Strengthen some checks to avoid relying on optimizer for correctness

3 months agoRemove unused :platform: in module's docs (GH-144988)
Stan Ulbrych [Thu, 19 Feb 2026 11:45:30 +0000 (11:45 +0000)] 
Remove unused :platform: in module's docs (GH-144988)

It has not been outputted since Sphinx 1.1.

3 months agogh-144888: Don't invalidate executors during function deallocation (#144974)
Ken Jin [Thu, 19 Feb 2026 03:44:50 +0000 (11:44 +0800)] 
gh-144888: Don't invalidate executors during function deallocation (#144974)

3 months agogh-144969: Document that the free threading GC can change ob_tid (#144972)
Sam Gross [Thu, 19 Feb 2026 00:49:09 +0000 (19:49 -0500)] 
gh-144969: Document that the free threading GC can change ob_tid (#144972)

3 months agogh-141510: Replace MappingProxyType with frozendict (#144904)
Victor Stinner [Wed, 18 Feb 2026 20:23:49 +0000 (21:23 +0100)] 
gh-141510: Replace MappingProxyType with frozendict (#144904)

3 months agogh-141510: Fix frozendict.fromkeys() for dict subclasses (#144962)
Victor Stinner [Wed, 18 Feb 2026 17:03:04 +0000 (18:03 +0100)] 
gh-141510: Fix frozendict.fromkeys() for dict subclasses (#144962)

Copy also the dictionary if a dict subclass returns a frozendict.

3 months agogh-141510: Update specializer to support frozendict (gh-144949)
Donghee Na [Wed, 18 Feb 2026 16:10:53 +0000 (01:10 +0900)] 
gh-141510: Update specializer to support frozendict (gh-144949)

3 months agogh-135573: Add tests for pickle opcodes with wrong types (GH-144950)
Serhiy Storchaka [Wed, 18 Feb 2026 16:02:12 +0000 (18:02 +0200)] 
gh-135573: Add tests for pickle opcodes with wrong types (GH-144950)

Ensure that APPENDS and ADDITEMS raise error for wrong collection even
with empty items.

3 months agogh-144763: Don't detach the GIL in tracemalloc (#144779)
Victor Stinner [Wed, 18 Feb 2026 15:57:48 +0000 (16:57 +0100)] 
gh-144763: Don't detach the GIL in tracemalloc (#144779)

tracemalloc no longer detaches the GIL to acquire its internal lock.

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
3 months agogh-141510: Fix frozendict.fromkeys() for subclasses (#144952)
Victor Stinner [Wed, 18 Feb 2026 15:56:09 +0000 (16:56 +0100)] 
gh-141510: Fix frozendict.fromkeys() for subclasses (#144952)

Copy the frozendict if needed.

3 months agogh-141510: Add can_modify_dict() in dictobject.c (#144955)
Victor Stinner [Wed, 18 Feb 2026 14:47:49 +0000 (15:47 +0100)] 
gh-141510: Add can_modify_dict() in dictobject.c (#144955)

can_modify_dict() is stricter than ASSERT_DICT_LOCKED() for
frozendict. It uses PyUnstable_Object_IsUniquelyReferenced() which
matters for free-threaded builds.

Replace anydict_setitem_take2() with setitem_take2_lock_held(). It's
no longer useful to have two functions.

3 months agogh-141510: Add frozendict fast-path to the set type (#144912)
Victor Stinner [Wed, 18 Feb 2026 14:25:47 +0000 (15:25 +0100)] 
gh-141510: Add frozendict fast-path to the set type (#144912)

3 months agoDatetime: Tidy up docs (GH-144720)
Stan Ulbrych [Wed, 18 Feb 2026 13:22:34 +0000 (13:22 +0000)] 
Datetime: Tidy up docs (GH-144720)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
3 months agogh-124748: Fix handling kwargs in `WeakKeyDictionary.update()` (#124783)
Ruslan Gilfanov [Wed, 18 Feb 2026 13:17:08 +0000 (18:17 +0500)] 
gh-124748: Fix handling kwargs in `WeakKeyDictionary.update()` (#124783)

3 months 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>
3 months 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)

3 months 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>
3 months 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, ...

3 months 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.

3 months 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.

3 months 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)

3 months 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>
3 months 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)

3 months 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)

3 months 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)

3 months 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.

3 months 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)

3 months 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)

3 months 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({})".

3 months 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().

3 months 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.

3 months 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)

3 months 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)

3 months 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)

3 months 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>
3 months 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.

3 months 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>
3 months 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.

3 months 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>
3 months 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)

3 months 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>
3 months 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>
3 months 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)

3 months 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)

3 months 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().

3 months 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>
3 months 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.

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

3 months 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)

3 months 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)

3 months 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.

3 months 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)

3 months 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)

3 months 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)

3 months 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)

3 months 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.

3 months 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.

3 months 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)

3 months 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)

3 months 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

3 months 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.

3 months 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)

3 months 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.

3 months 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>
3 months 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)

3 months 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>
3 months 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)

3 months 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.

3 months 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.

3 months 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.

3 months 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)

3 months 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.

3 months 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>
3 months 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)

3 months 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)

3 months 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)

3 months 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>
3 months 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>
3 months 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.

3 months 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.

3 months 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)

3 months 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

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

3 months 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)

3 months 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>