]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
6 weeks agoGH-145000: Add a tool to record/check removed HTML IDs (#145001)
Petr Viktorin [Wed, 25 Feb 2026 12:37:59 +0000 (13:37 +0100)] 
GH-145000: Add a tool to record/check removed HTML IDs (#145001)

6 weeks agogh-47655: Add support for user data and detail of Tk events to tkinter (GH-7142)
Matthias Kievernagel [Wed, 25 Feb 2026 08:34:00 +0000 (08:34 +0000)] 
gh-47655: Add support for user data and detail of Tk events to tkinter (GH-7142)

Expose the %d substitution as the tkinter.Event attributes:

* "detail" for Enter, Leave, FocusIn, FocusOut, and ConfigureRequest events
* "user_data" for virtual events

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 weeks agoGH-145006: add ModuleNotFoundError hints when a module for a differen… (#145007)
Filipe Laíns [Wed, 25 Feb 2026 00:53:01 +0000 (00:53 +0000)] 
GH-145006: add ModuleNotFoundError hints when a module for a differen… (#145007)

* GH-145006: add ModuleNotFoundError hints when a module for a different ABI exists

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

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Use SHLIB_SUFFIX in test_find_incompatible_extension_modules when available

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

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

Signed-off-by: Filipe Laíns <lains@riseup.net>
* Show the whole extension module file name in hint

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

Signed-off-by: Filipe Laíns <lains@riseup.net>
6 weeks agogh-136677: Introduce executable specific linker flags to configure (#137296)
rueteh [Tue, 24 Feb 2026 22:52:02 +0000 (09:52 +1100)] 
gh-136677: Introduce executable specific linker flags to configure (#137296)

* introduce executable specific linker flags

Add PY_CORE_EXE_LDFLAGS and EXE_LDFLAGS which stores executable specific
LDFLAGS, replacing PY_CORE_LDFLAGS for building
executable targets.

If PY_CORE_EXE_LDFLAGS / EXE_LDFLAGS is not provided, then it defaults
to the value of PY_CORE_LDFLAGS which is the existing behaviour.

If both flags are supplied, and there is a need
to distinguish between executable and shared specific LDFLAGS,
in particular, PY_CORE_LDFLAGS should contain the shared specific LDFLAGS.

* documentation for new linker flags

* update Misc folder documentation

* Update Makefile.pre.in

Co-authored-by: Victor Stinner <vstinner@python.org>
---------

Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Filipe Laíns <lains@riseup.net>
6 weeks agogh-145187: Fix crash on invalid type parameter bound expression in conditional block...
Stan Ulbrych [Tue, 24 Feb 2026 20:44:57 +0000 (20:44 +0000)] 
gh-145187: Fix crash on invalid type parameter bound expression in conditional block (GH-145188)

Fix parsing crash found by oss-fuzz

6 weeks agogh-88091: Fix unicodedata.decomposition() for Hangul Syllables (GH-144993)
Stan Ulbrych [Tue, 24 Feb 2026 17:42:33 +0000 (17:42 +0000)] 
gh-88091: Fix unicodedata.decomposition() for Hangul Syllables (GH-144993)

6 weeks agogh-143535: Dispatch on the second argument if generic method is instance-bindable...
Bartosz Sławecki [Tue, 24 Feb 2026 16:04:37 +0000 (17:04 +0100)] 
gh-143535: Dispatch on the second argument if generic method is instance-bindable (GH-144615)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
6 weeks agogh-145122: Add _GUARD_NOS_ANY_DICT to prevent STORE_SUBSCR_DICT on frozendict (gh...
Donghee Na [Tue, 24 Feb 2026 15:48:45 +0000 (00:48 +0900)] 
gh-145122: Add _GUARD_NOS_ANY_DICT to prevent STORE_SUBSCR_DICT on frozendict (gh-145039)

6 weeks agoFix `inspect.Parameter` docstring on the `kind` attribute (GH-143541)
Bartosz Sławecki [Tue, 24 Feb 2026 12:17:45 +0000 (13:17 +0100)] 
Fix `inspect.Parameter` docstring on the `kind` attribute (GH-143541)

6 weeks agogh-143304: Fix ctypes.CDLL to honor handle parameter on POSIX systems (GH-143318)
Arjit Singh Grover [Tue, 24 Feb 2026 12:16:58 +0000 (17:46 +0530)] 
gh-143304: Fix ctypes.CDLL to honor handle parameter on POSIX systems (GH-143318)

The handle parameter was being ignored in the POSIX implementation
of CDLL._load_library(), causing it to always call _dlopen() even
when a valid handle was provided. This was a regression introduced
in recent refactoring.

6 weeks agogh-137335: Fix unlikely name conflicts for named pipes in multiprocessing and asyncio...
Serhiy Storchaka [Tue, 24 Feb 2026 11:27:49 +0000 (13:27 +0200)] 
gh-137335: Fix unlikely name conflicts for named pipes in multiprocessing and asyncio on Windows (#137389)

Since os.stat() raises an OSError for existing named pipe "\\.\pipe\...",
os.path.exists() always returns False for it, and tempfile.mktemp() can
return a name that matches an existing named pipe.

So, tempfile.mktemp() cannot be used to generate unique names for named
pipes. Instead, CreateNamedPipe() should be called in a loop with
different names until it completes successfully.

6 weeks agogh-66305: Fix a hang on Windows in the tempfile module (GH-144672)
Serhiy Storchaka [Tue, 24 Feb 2026 11:05:06 +0000 (13:05 +0200)] 
gh-66305: Fix a hang on Windows in the tempfile module (GH-144672)

It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.

6 weeks agogh-101178: Fix possible integer overflow in Ascii85 encoder with wrapcol=1 (GH-144778)
Serhiy Storchaka [Tue, 24 Feb 2026 09:40:24 +0000 (11:40 +0200)] 
gh-101178: Fix possible integer overflow in Ascii85 encoder with wrapcol=1 (GH-144778)

It could happen if the size of the input is more than 4/5 of sys.maxsize
(only feasible on 32-bit platforms).

Also simplify the integer overflow checks in the Base64 encoder, and
harmonize them with the code for Ascii85 and Base85.

6 weeks ago`_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158)
Stan Ulbrych [Tue, 24 Feb 2026 00:53:17 +0000 (00:53 +0000)] 
`_struct.c`: Fix UB from integer overflow in `prepare_s` (GH-145158)

Avoid possible undefined behaviour from signed overflow in `struct` module

As discovered via oss-fuzz.

6 weeks agogh-110937: Document full public importlib.metadata.Distribution API (#143480)
Philipp A. [Mon, 23 Feb 2026 23:51:03 +0000 (00:51 +0100)] 
gh-110937: Document full public importlib.metadata.Distribution API (#143480)

6 weeks agogh-145110: Fix cleaning of PGO builds in Windows build.bat script (GH-145111)
Chris Eibl [Mon, 23 Feb 2026 22:53:56 +0000 (23:53 +0100)] 
gh-145110: Fix cleaning of PGO builds in Windows build.bat script (GH-145111)

6 weeks agoUpdate Python install manager docs (GH-145160)
Steve Dower [Mon, 23 Feb 2026 22:28:23 +0000 (22:28 +0000)] 
Update Python install manager docs (GH-145160)

These updates align with v26.0 that was just released.

6 weeks agogh-145118: Add `frozendict` support to `str.maketrans()` (gh-145129)
Stan Ulbrych [Mon, 23 Feb 2026 22:04:16 +0000 (22:04 +0000)] 
gh-145118: Add `frozendict` support to `str.maketrans()` (gh-145129)

Add support to `str.maketrans`

6 weeks agoIndexing is more straight-forward (and faster) than unpacking (gh-145154)
Raymond Hettinger [Mon, 23 Feb 2026 18:31:35 +0000 (12:31 -0600)] 
Indexing is more straight-forward (and faster) than unpacking (gh-145154)

6 weeks agoAdd Savannah as `jit.yml` CODEOWNER (#145152)
Savannah Ostrowski [Mon, 23 Feb 2026 17:54:14 +0000 (09:54 -0800)] 
Add Savannah as `jit.yml` CODEOWNER (#145152)

Add Savannah for jit.yml CODEOWNER

6 weeks agoUpdate argparse `suggest_on_error` code snippet in docs (#144985)
Savannah Ostrowski [Mon, 23 Feb 2026 17:25:05 +0000 (09:25 -0800)] 
Update argparse `suggest_on_error` code snippet in docs (#144985)

6 weeks agogh-144777: Fix data races in IncrementalNewlineDecoder (gh-144971)
Sam Gross [Mon, 23 Feb 2026 14:32:16 +0000 (09:32 -0500)] 
gh-144777: Fix data races in IncrementalNewlineDecoder (gh-144971)

6 weeks agogh-141004: Document `PyModuleDef_Type` (GH-145043)
Peter Bierma [Mon, 23 Feb 2026 14:18:45 +0000 (09:18 -0500)] 
gh-141004: Document `PyModuleDef_Type` (GH-145043)

6 weeks agogh-145089: Fix frozendict constructor (#145128)
Victor Stinner [Mon, 23 Feb 2026 07:22:29 +0000 (08:22 +0100)] 
gh-145089: Fix frozendict constructor (#145128)

6 weeks agogh-144015: Add portable SIMD optimization for bytes.hex() et. al. (GH-143991)
Gregory P. Smith [Mon, 23 Feb 2026 03:19:03 +0000 (19:19 -0800)] 
gh-144015: Add portable SIMD optimization for bytes.hex() et. al. (GH-143991)

Add SIMD optimization for `bytes.hex()`, `bytearray.hex()`, and `binascii.hexlify()` as well as `hashlib` `.hexdigest()` methods using platform-agnostic GCC/Clang vector extensions that compile to native SIMD instructions on our [PEP-11 Tier 1 Linux and macOS](https://peps.python.org/pep-0011/#tier-1) platforms.

- 1.1-3x faster for common small data (16-64 bytes, covering md5 through sha512 digest sizes)
- Up to 11x faster for large data (1KB+)
- Retains the existing scalar code for short inputs (<16 bytes) or platforms lacking SIMD instructions, no observable performance regressions there.

## Supported platforms:

- x86-64: the compiler generates SSE2 - always available, no flags or CPU feature checks needed
- ARM64: NEON is always available, always available, no flags or CPU feature checks needed
- ARM32: Requires NEON support and that appropriate compiler flags enable that (e.g., `-march=native` on a Raspberry Pi 3+) - while we _could_ use runtime detection to allow neon when compiled without a recent enough `-march=` flag (`cortex-a53` and later IIRC), there are diminishing returns in doing so. Anyone using 32-bit ARM in a situation where performance matters will already be compiling with such flags. (as opposed to 32-bit Raspbian compilation that defaults to aiming primarily for compatibility with rpi1&0 armv6 arch=armhf which lacks neon)
- Windows/MSVC: Not supported. MSVC lacks `__builtin_shufflevector`, so the existing scalar path is used. Leaving it as an opportunity for the future for someone to figure out how to express the intent to that compiler.

This is compile time detection of features that are always available on the target architectures. No need for runtime feature inspection.

6 weeks agogh-145131: difflib.Differ._fancy_replace performance (re-use ratio) (#145133)
dgpb [Mon, 23 Feb 2026 01:59:40 +0000 (03:59 +0200)] 
gh-145131: difflib.Differ._fancy_replace performance (re-use ratio) (#145133)

re-use calculated ratio

6 weeks agogh-145064: Fix JIT assertion failure during CALL_ALLOC_AND_ENTER_INIT side exit...
Hai Zhu [Sun, 22 Feb 2026 18:46:03 +0000 (02:46 +0800)] 
gh-145064:  Fix JIT assertion failure during CALL_ALLOC_AND_ENTER_INIT side exit (GH-145100)

6 weeks 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>
6 weeks 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)

6 weeks 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)

6 weeks 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)

6 weeks 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)

6 weeks 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.

6 weeks 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.

6 weeks 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

7 weeks 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.

7 weeks 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>
7 weeks 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()

7 weeks 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)

7 weeks 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)

7 weeks 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)

7 weeks 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)

7 weeks 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.

7 weeks 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

7 weeks 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)

7 weeks 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)

7 weeks 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.

7 weeks 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.

7 weeks 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.

7 weeks 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.

7 weeks 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>
7 weeks 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)

7 weeks 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

7 weeks 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

7 weeks 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.

7 weeks 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>
7 weeks 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>
7 weeks 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.

7 weeks 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 "-".

7 weeks 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.

7 weeks 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)

7 weeks 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>
7 weeks 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)

7 weeks 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>
7 weeks 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)

7 weeks 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>
7 weeks 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

7 weeks 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>
7 weeks 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>
7 weeks 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>
7 weeks 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)

7 weeks 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)

7 weeks 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)

7 weeks 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)

7 weeks 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

7 weeks 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.

7 weeks 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)

7 weeks 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)

7 weeks 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)

7 weeks 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.

7 weeks 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)

7 weeks 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.

7 weeks 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>
7 weeks 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.

7 weeks 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.

7 weeks 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)

7 weeks 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>
7 weeks 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)

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.