]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 months agoRefactor jit.yml (#144577)
Savannah Ostrowski [Sun, 22 Feb 2026 18:43:35 +0000 (10:43 -0800)] 
Refactor jit.yml (#144577)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2 months agoFix warnings on main (GH-145104)
Chris Eibl [Sun, 22 Feb 2026 11:02:15 +0000 (12:02 +0100)] 
Fix warnings on main (GH-145104)

2 months agogh-145092: Fix compiler warning for memchr() and wcschr() returning const pointer...
Rudi Heitbaum [Sun, 22 Feb 2026 08:01:27 +0000 (19:01 +1100)] 
gh-145092: Fix compiler warning for memchr() and wcschr() returning const pointer (GH-145093)

2 months agogh-145076: Check globals type in __lazy_import__() (#145086)
Victor Stinner [Sat, 21 Feb 2026 21:06:59 +0000 (22:06 +0100)] 
gh-145076: Check globals type in __lazy_import__() (#145086)

2 months agogh-141510: Change dict_unhashable_type() error message for frozendict (#145085)
Victor Stinner [Sat, 21 Feb 2026 19:08:28 +0000 (20:08 +0100)] 
gh-141510: Change dict_unhashable_type() error message for frozendict (#145085)

2 months agogh-141510: Test frozendict in test_capi.test_dict (#145084)
Victor Stinner [Sat, 21 Feb 2026 19:07:30 +0000 (20:07 +0100)] 
gh-141510: Test frozendict in test_capi.test_dict (#145084)

Complete PyDict_Clear() documentation.

2 months agogh-141510: Check argument in PyDict_Contains() (#145083)
Victor Stinner [Sat, 21 Feb 2026 17:36:02 +0000 (18:36 +0100)] 
gh-141510: Check argument in PyDict_Contains() (#145083)

PyDict_Contains() and PyDict_ContainsString() now fail with
SystemError if the first argument is not a dict, frozendict, dict
subclass or frozendict subclass.

2 months agogh-66802: Add `unicodedata.block()` function (#145042)
Stan Ulbrych [Sat, 21 Feb 2026 17:27:55 +0000 (17:27 +0000)] 
gh-66802: Add `unicodedata.block()` function (#145042)

Closes #66802

2 months agogh-141510: Check argument in PyDict_MergeFromSeq2() (#145082)
Victor Stinner [Sat, 21 Feb 2026 16:21:43 +0000 (17:21 +0100)] 
gh-141510: Check argument in PyDict_MergeFromSeq2() (#145082)

PyDict_MergeFromSeq2() now fails with SystemError if the first
argument is not a dict or a dict subclass.

PyDict_Update(), PyDict_Merge() and _PyDict_MergeEx() no longer
accept frozendict.

2 months agogh-141510: Support frozendict in pprint (#144908)
Victor Stinner [Sat, 21 Feb 2026 16:08:24 +0000 (17:08 +0100)] 
gh-141510: Support frozendict in pprint (#144908)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2 months agogh-141510: Test frozendict C API (#145081)
Victor Stinner [Sat, 21 Feb 2026 16:00:23 +0000 (17:00 +0100)] 
gh-141510: Test frozendict C API (#145081)

Add tests on functions:

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

2 months agogh-141510: Fix copy.deepcopy() for recursive frozendict (#145027)
Victor Stinner [Sat, 21 Feb 2026 15:30:40 +0000 (16:30 +0100)] 
gh-141510: Fix copy.deepcopy() for recursive frozendict (#145027)

2 months agoUse `lazy` imports in `collections` (gh-145054)
Raymond Hettinger [Sat, 21 Feb 2026 14:14:53 +0000 (08:14 -0600)] 
Use `lazy` imports in `collections` (gh-145054)

2 months agogh-145058: Add input validation to `_PyImport_LazyImportModuleLevelObject` (#145068)
Stan Ulbrych [Sat, 21 Feb 2026 12:52:40 +0000 (12:52 +0000)] 
gh-145058: Add input validation to `_PyImport_LazyImportModuleLevelObject` (#145068)

2 months agogh-144285: Update *What's New* entry after GH-144299 (#145077)
Bartosz Sławecki [Sat, 21 Feb 2026 12:50:55 +0000 (13:50 +0100)] 
gh-144285: Update *What's New* entry after GH-144299 (#145077)

2 months agogh-141510: Fix test_xpickle for Python 3.14 and older (#145069)
Victor Stinner [Sat, 21 Feb 2026 12:05:35 +0000 (13:05 +0100)] 
gh-141510: Fix test_xpickle for Python 3.14 and older (#145069)

Skip tests on frozendict on Python 3.14 and older.

2 months agogh-141226: Deprecate PEP-456 support for embedders (#141287)
Bénédikt Tran [Sat, 21 Feb 2026 11:42:13 +0000 (12:42 +0100)] 
gh-141226: Deprecate PEP-456 support for embedders (#141287)

Deprecate PEP-456 [1] support for providing an external definition
of the string hashing scheme. Removal is scheduled for Python 3.19.

Previously, embedders could define the ``Py_HASH_ALGORITHM`` macro to be
``Py_HASH_EXTERNAL`` [2] to indicate that the hashing scheme was provided
externally but this feature was undocumented, untested and most likely
unused.

[1]: https://peps.python.org/pep-0456/
[2]: https://peps.python.org/pep-0456/#hash-function-selection

2 months agogh-142516: fix reference leaks in `ssl.SSLContext` objects (#143685)
Bénédikt Tran [Sat, 21 Feb 2026 11:31:16 +0000 (12:31 +0100)] 
gh-142516: fix reference leaks in `ssl.SSLContext` objects (#143685)

2 months agogh-141510, PEP 814: Add frozendict support to json (#144903)
Victor Stinner [Sat, 21 Feb 2026 11:22:47 +0000 (12:22 +0100)] 
gh-141510, PEP 814: Add frozendict support to json (#144903)

2 months agogh-143698: correctly check `scheduler` and `setpgroup` values for `os.posix_spawn...
Bénédikt Tran [Sat, 21 Feb 2026 11:20:42 +0000 (12:20 +0100)] 
gh-143698: correctly check `scheduler` and `setpgroup` values for `os.posix_spawn[p]` (#143699)

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.

2 months agogh-141510, PEP 814: Add frozendict support to pickle (#144967)
Victor Stinner [Sat, 21 Feb 2026 10:07:55 +0000 (11:07 +0100)] 
gh-141510, PEP 814: Add frozendict support to pickle (#144967)

Add frozendict.__getnewargs__() method.

2 months agogh-144694: Fix re.Match.group() doc claiming [1..99] range limit (#144696)
Mohsin Mehmood [Sat, 21 Feb 2026 05:36:26 +0000 (10:36 +0500)] 
gh-144694: Fix re.Match.group() doc claiming [1..99] range limit (#144696)

The documentation incorrectly stated that numeric group arguments
must be in the range [1..99]. This limit was removed in Python 3.5
(bpo-22437). Replace with "a positive integer" since the next
sentence already documents the IndexError for out-of-range values.

2 months agogh-145028: Fix blake2 tests in test_hashlib when it is missing due to build config...
Rafael Santos [Sat, 21 Feb 2026 04:57:29 +0000 (22:57 -0600)] 
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.

3 months agogh-144748: Document 3.12 and 3.14 changes to `PyErr_CheckSignals` (GH-144982)
Peter Bierma [Sat, 21 Feb 2026 00:25:45 +0000 (19:25 -0500)] 
gh-144748: Document 3.12 and 3.14 changes to `PyErr_CheckSignals` (GH-144982)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
3 months agogh-144809: Make deque copy atomic in free-threaded build (gh-144966)
Sam Gross [Fri, 20 Feb 2026 19:31:58 +0000 (14:31 -0500)] 
gh-144809: Make deque copy atomic in free-threaded build (gh-144966)

3 months agoFix errors in `CODEOWNERS` (#145049)
Stan Ulbrych [Fri, 20 Feb 2026 19:02:14 +0000 (19:02 +0000)] 
Fix errors in `CODEOWNERS` (#145049)

Fix erros in CODEOWNERS

3 months agogh-144981: Make PyUnstable_Code_SetExtra/GetExtra thread-safe (#144980)
Alper [Fri, 20 Feb 2026 18:52:18 +0000 (10:52 -0800)] 
gh-144981: Make PyUnstable_Code_SetExtra/GetExtra thread-safe (#144980)

* Make PyUnstable_Code_SetExtra/GetExtra thread-safe

3 months agoSimplify summary tables in the itertools docs (gh-145050)
Raymond Hettinger [Fri, 20 Feb 2026 18:44:30 +0000 (12:44 -0600)] 
Simplify summary tables in the itertools docs (gh-145050)

Combine two dispatch tables into once.

3 months agogh-141811: Split up `init.rst` into multiple pages (GH-144844)
Peter Bierma [Fri, 20 Feb 2026 16:37:39 +0000 (11:37 -0500)] 
gh-141811: Split up `init.rst` into multiple pages (GH-144844)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
3 months agoUpdate comments in `_strptime` module (GH-144979)
Anton Ryzhov [Fri, 20 Feb 2026 07:56:56 +0000 (08:56 +0100)] 
Update comments in `_strptime` module (GH-144979)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
3 months agoDocs: remove unneeded author attributions (#145002)
Ned Batchelder [Thu, 19 Feb 2026 23:45:28 +0000 (18:45 -0500)] 
Docs: remove unneeded author attributions (#145002)

These directives are not maintained and misleadingly indicate individual
rather than community ownership.

See https://github.com/python/docs-community/issues/180 for discussion,
and https://github.com/python/devguide/pull/1740 for an update to the
devguide.

Also ensured that everyone is in the Misc/ACKS file.

3 months agoCorrect MAX_N in Lib/zipfile ZipExtFile (GH-144973)
J Berg [Thu, 19 Feb 2026 22:48:01 +0000 (22:48 +0000)] 
Correct MAX_N in Lib/zipfile ZipExtFile (GH-144973)

"<<" has lower precedence than "-".

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)