Shrey Naithani [Wed, 11 Mar 2026 12:08:48 +0000 (17:38 +0530)]
gh-145587: fix busy loop in multiprocessing.connection.wait on Windows (GH-145597)
Ensure wait() blocks for the specified timeout when object_list is empty, preventing 100% CPU usage. This aligns the Windows behavior with the Unix implementation.
Co-authored-by: AN Long <aisk@users.noreply.github.com>
gh-145633: Remove support for ancient ARM platforms with mixed-endian doubles (#145634)
* Drop DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 macro.
* Use DOUBLE_IS_BIG/LITTLE_ENDIAN_IEEE754 to detect endianness of
float/doubles.
* Drop "unknown_format" code path in PyFloat_Pack/Unpack*().
Co-authored-by: Victor Stinner <vstinner@python.org>
Previously, component-wise relative error bound was tested. However,
such bound can't exist already for complex multiplication as one can be
used to perform subtraction of floating-point numbers, e.g. x and y for
z0=1+1j and z1=x+yj.
```pycon
>>> x, y = 1e-9+1j, 1+1j
>>> a = x*y*y.conjugate()/2;a
(1.0000000272292198e-09+1j)
>>> b = x*(y*y.conjugate()/2);b
(1e-09+1j)
>>> b == x
True
>>> (a.real-b.real)/math.ulp(b.real) 131672427.0
```
Farhan Saif [Tue, 10 Mar 2026 16:23:39 +0000 (11:23 -0500)]
gh-125053: Document that ob_mutex must only be used via critical section API (#144599)
Add a warning in the free-threading extensions howto explaining that
PyObject.ob_mutex is reserved for the critical section API and must not
be locked directly with PyMutex_Lock, as this can cause deadlocks.
Extension authors who need their own lock should add a separate PyMutex
field to their object struct.
Also add an ob_mutex member entry under PyObject in the C API reference
(Doc/c-api/structures.rst) with a cross-reference to the howto.
Co-authored-by: Victor Stinner <vstinner@python.org>
Sam Gross [Mon, 9 Mar 2026 22:41:07 +0000 (18:41 -0400)]
gh-145685: Stop the world when updating MRO of existing types (gh-145707)
We already have a stop-the-world pause elsewhere in this code path
(type_set_bases) and this makes will make it easier to avoid contention
on the TYPE_LOCK when looking up names in the MRO hierarchy.
Also use deferred reference counting for non-immortal MROs.
Sam Gross [Mon, 9 Mar 2026 17:24:34 +0000 (13:24 -0400)]
gh-145615: Fix mimalloc page leak in the free-threaded build (gh-145626)
Fix three issues that caused mimalloc pages to be leaked until the
owning thread exited:
1. In _PyMem_mi_page_maybe_free(), move pages out of the full queue
when relying on QSBR to defer freeing the page. Pages in the full
queue are never searched by mi_page_queue_find_free_ex(), so a page
left there is unusable for allocations.
2. Move _PyMem_mi_page_clear_qsbr() from _mi_page_free_collect() to
_mi_page_thread_free_collect() where it only fires when all blocks
on the page are free (used == 0). The previous placement was too
broad: it cleared QSBR state whenever local_free was non-NULL, but
_mi_page_free_collect() is called from non-allocation paths (e.g.,
page visiting in mi_heap_visit_blocks) where the page is not being
reused.
3. In _PyMem_mi_page_maybe_free(), use the page's heap tld to find the
correct thread state for QSBR list insertion instead of
PyThreadState_GET(). During stop-the-world pauses, the function may
process pages belonging to other threads, so the current thread
state is not necessarily the owner of the page.
Hood Chatham [Mon, 9 Mar 2026 02:25:21 +0000 (03:25 +0100)]
gh-145219: Add Emscripten cross-build and clean configurability (#145581)
Modifies the Emscripten build script to allow for custom cross-build directory
names, and to only clean Emscripten-specific paths (optionally including the
build python).
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Pieter Eendebak [Fri, 6 Mar 2026 20:00:06 +0000 (21:00 +0100)]
gh-145376: Fix crashes in `md5module.c` and `hmacmodule.c` (#145422)
Fix a possible NULL pointer dereference in `md5module.c` and a double-free in `hmacmodule.c`.
Those crashes only occur in error paths taken when the interpreter fails to allocate memory.
Hood Chatham [Fri, 6 Mar 2026 00:42:41 +0000 (01:42 +0100)]
gh-145177: Support multiple Emscripten versions for Emscripten buildbot (#145180)
Adds an `--emsdk-cache` argument to the Emscripten build script and an
emscripten_version.txt file. If the `--emsdk-cache` argument is passed, the build script
will look in `emscripten_version.txt` to get the expected emsdk version is installed in
a folder called e.g., 4.0.12 in the directory indicated by the `--emsdk-cache` argument,
and run the build with that Emscripten tooling activated.
Alex Malyshev [Thu, 5 Mar 2026 19:03:30 +0000 (14:03 -0500)]
gh-145557: Check ctypes is available in test_external_inspection (#145558)
Currently TestGetStackTrace.test_self_trace_after_ctypes_import() will fail if
the _ctypes extension is not built. Make it match test_ctypes by skipping
the test in that case.
Victor Stinner [Thu, 5 Mar 2026 16:44:58 +0000 (17:44 +0100)]
gh-141510: Complete What's New in Python 3.15 for frozendict (#145537)
Mention updated stdlib modules and built-in functions.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Xianpeng Shen [Thu, 5 Mar 2026 12:23:06 +0000 (14:23 +0200)]
gh-140681: Freeze pre-commit hooks and update zizmor links (#140682)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>