131270 Commits

Author SHA1 Message Date
Sam Gross ad3c5b7958 gh-148820: Fix _PyRawMutex use-after-free on spurious semaphore wakeup (gh-148852)
_PyRawMutex_UnlockSlow CAS-removes the waiter from the list and then
calls _PySemaphore_Wakeup, with no handshake. If _PySemaphore_Wait
returns Py_PARK_INTR, the waiter can destroy its stack-allocated
semaphore before the unlocker's Wakeup runs, causing a fatal error from
ReleaseSemaphore / sem_post.

Loop in _PyRawMutex_LockSlow until _PySemaphore_Wait returns Py_PARK_OK,
which is only signalled when a matching Wakeup has been observed.

Also include GetLastError() and the handle in the Windows fatal messages
in _PySemaphore_Init, _PySemaphore_Wait, and _PySemaphore_Wakeup to make
similar races easier to diagnose in the future.
2026-04-22 14:31:19 -04:00
Isuru Fernando 59b41c8c3b gh-148858: Remove duplicated recipe.yaml files in Tools/pixi-packages (#148859) 2026-04-22 20:50:30 +03:00
Raymond Hettinger b16886528e Additional itertool recipes for running statistics (gh-148879) 2026-04-22 11:52:41 -05:00
KotlinIsland 04fd103713 gh-148207: add additional keywords to typing.TypeVarTuple (#148212) 2026-04-22 06:28:12 -07:00
Mark Shannon f93834ff01 GH-146073: Add example script for dumping JIT traces (GH-148840) 2026-04-22 11:09:05 +01:00
Gabriele N. Tornetta 858e69eab0 gh-142186: Allow all PEP-669 events to be per-code object and disableable (GH-146182)
* Make the `PY_UNWIND` monitoring event available as a code-local
event to allow trapping on function exit events when an exception
bubbles up. This complements the PY_RETURN event by allowing to
catch any function exit event.

* Allow `PY_UNWIND`  to be `DISABLE`d; disabling it disables the event for the whole code object.

* Do the above for `PY_THROW`, `RAISE`, `EXCEPTION_HANDLED`, and `RERAISE` events.
2026-04-22 09:08:23 +01:00
cui 09233bd198 gh-146578: _zstd: Fix printf format for pledged size errors (#146576)
Use %llu instead of %ull for unsigned long long in zstd_contentsize_converter ValueError messages.
2026-04-21 12:49:44 -07:00
Rida Zouga 0b9146e90b [Enum] Improve clarity of comparison sentence (GH-148753)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2026-04-21 10:17:02 -07:00
Stan Ulbrych 33e82be174 gh-148801: Fix unbound C recursion in Element.__deepcopy__() (#148802) 2026-04-21 17:20:18 +01:00
Seth Larson 1274766d3c gh-148808: Add boundary check to asyncio.AbstractEventLoop.sock_recvf… (#148809) 2026-04-21 07:29:07 -07:00
Stan Ulbrych d206d42834 gh-148814: Fix an issue in Emscripten README (#148752)
Correct the description of the default state of test module compilation.
2026-04-21 07:04:50 +08:00
Roman Donchenko f6ed7c0acb gh-108411: Make typing.IO/BinaryIO arguments positional-only (#142906)
`IO` is purported to be the type of the file objects returned by `open`.
However, all methods on those objects take positional-only arguments, while
`IO`'s methods are declared with regular arguments. As such, the file objects
cannot actually be considered to implement `IO`. The same thing applies to
`BinaryIO`.

Fix this by adjusting the definition of these ABCs to match the file objects.

This is technically a breaking change, but it is unlikely to actually break
anything:

* These methods should never be called at runtime, since they are abstract.
  Therefore, this should not cause any runtime errors.

* In typeshed these arguments are already positional-only, so this should
  not cause any errors during typechecking either.
2026-04-20 13:19:43 -07:00
ByteFlow 9a1c70c639 Fix typos in asyncio, ctypes, and importlib documentation (#148747) 2026-04-20 12:22:37 -07:00
Uwe L. Korn 5a3f479601 gh-138451: Support custom LLVM installation path (#138452)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-04-20 16:45:53 +00:00
Stan Ulbrych 3fd61b74de Use soft-deprecated in more places (#148769) 2026-04-20 17:00:35 +01:00
Manoj K M 983c7462d6 Docs: Fix some typos in calendar.rst (GH-148756) 2026-04-20 14:37:12 +00:00
Régis Desgroppes 5c5dae0282 gh-148644: Propagate the PGO job exit code in PCbuild/build.bat (GH-148645) 2026-04-20 15:18:10 +01:00
AraHaan 789120e826 gh-148790: Eliminate redundant call to _PyRuntime_Initialize in Py_InitializeEx (GH-121628) 2026-04-20 10:01:06 -04:00
Filipe Laíns 513db72110 GH-145278: also filter mmap2 in strace_helper.filter_memory (GH-148648)
Signed-off-by: Filipe Laíns <lains@riseup.net>
2026-04-20 15:41:10 +02:00
Donghee Na 22c8590e40 gh-148718: Fix Py_STACKREF_DEBUG build by defining macros (#148719) 2026-04-20 21:55:03 +09:00
Serhiy Storchaka bfe6f9f590 gh-123853: Update locale.windows_locale (GH-123901)
Update the table of Windows language code identifiers (LCIDs) to
protocol version 16.0 (2024-04-23).
2026-04-20 11:47:37 +03:00
Stan Ulbrych a00b24ec68 gh-148788: Update Emscripten example post move to Platforms dir (#148761)
Update Emscripten example post move to Platforms dir.
2026-04-20 10:17:50 +08:00
Matthew Davis e50acef0b2 gh-148763: Fix paramter name in multiprocessing.connection.send_bytes/recv_bytes_into docs (GH-126603)
Doc: Fix buf argument name in multiprocessing connection send_bytes
2026-04-19 17:05:50 -07:00
partev 82767780f8 gh-148779: Update Briefcase link in android.rst documentation (#148777)
Use canonical beeware.org URL for link to Briefcase.
2026-04-20 05:44:08 +08:00
Hugo van Kemenade a8c9aa924b gh-133879: Copyedit "What's new in Python 3.15" (#148686) 2026-04-19 21:42:23 +03:00
Sam Gross ad7d3616c6 gh-121946: Use clang-20 for TSan build (#148570) 2026-04-19 15:13:47 +03:00
Hugo van Kemenade 9e23652230 Prevent GitHub's web conflict editor from converting LF to CRLF (#148739) 2026-04-19 12:21:17 +03:00
Daniel Hollas 4b33308137 gh-148406: Fix annotations of _colorize.FancyCompleter (#148408)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-18 21:51:58 +03:00
John Seong 28b8d5ffcc gh-133403: Add type annotations to generate_levenshtein_examples.py (#143317)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-18 21:50:17 +03:00
Dino Viehland d81599eeb7 gh-148659: Export a few more functions required for external JITs (#148704)
Export a few more functions required for external JITs
2026-04-18 11:32:22 -07:00
Serhiy Storchaka 7ce737ea11 gh-148653: Fix reference leaks in test_marshal introduced in gh-148698 (GH-148725) 2026-04-18 12:11:14 +00:00
Victor Stinner d61fcf834d gh-148688: Fix _BlocksOutputBuffer_Finish() double free (#148689)
If _BlocksOutputBuffer_Finish() fails (memory allocation failure),
PyBytesWriter_Discard() is called on the writer. Then if
_BlocksOutputBuffer_OnError() is called, it calls again
PyBytesWriter_Discard() causing a double free.

Fix _BlocksOutputBuffer_Finish() by setting buffer->writer to NULL,
so _BlocksOutputBuffer_OnError() does nothing instead of calling
PyBytesWriter_Discard() again.
2026-04-18 09:56:56 +00:00
Hugo van Kemenade e9bbf8617d Add a new Sphinx soft-deprecated directive (#148630)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-04-18 11:37:54 +03:00
Serhiy Storchaka 2e37d83641 gh-148653: Fix some marshal errors related to recursive immutable objects (GH-148698)
Forbid marshalling recursive code, slice and frozendict objects which
cannot be correctly unmarshalled.
Reject invalid marshal data produced by marshalling recursive frozendict
objects which was previously incorrectly unmarshalled.
Add multiple tests for recursive data structures.
2026-04-18 11:24:33 +03:00
Jelle Zijlstra 92164dc917 gh-148639: Implement PEP 800 (typing.disjoint_base) (#148640)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-04-17 19:20:41 -07:00
Prakash Sellathurai 634568d030 gh-148222: Fix NULL dereference bugs in genericaliasobject.c (#148226) 2026-04-17 17:21:13 -07:00
Pieter Eendebak db3e990b98 gh-146393: Remove special character in optimizer_bytecodes.c (#148693) 2026-04-17 16:52:16 +00:00
Michael Bommarito 446edda209 gh-148651: Fix refcount leak in _zstd decompressor options (#148657)
The option parsing in Modules/_zstd/decompressor.c had a missing Py_DECREF(value) before the early return -1 when PyLong_AsInt(key) fails. The identical code in Modules/_zstd/compressor.c line 158 has the fix.
2026-04-17 08:42:41 -07:00
Xuwz a86234ea85 gh-148683: Doc: fix misplaced pprint entries in What's New 3.15 (#148685)
Doc: fix misplaced pprint entries in What's New 3.15
2026-04-17 17:13:41 +03:00
Gleb Popov afde75664e gh-148484: Fix memory leak of iterator in array.array constructor (GH-148523) 2026-04-17 14:13:44 +02:00
Sergey B Kirpichev 769cc8338f gh-148464: Add missing `__ctype_le/be__` attributes for complex types in the ctype module (GH-148485)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2026-04-17 14:09:09 +02:00
Dino Viehland 2a07ff980b gh-148659: Export some internal functions for the JIT (PEP-523) (#148634)
Export (as internal functions, not public ones) C API functions necessary to implement a JIT as a separate extension module.
2026-04-17 01:55:03 +02:00
Victor Stinner 2faceeec5c gh-148535: Don't use gcc -fprofile-update=atomic flag on i686 (#148554)
The -fprofile-update=atomic flag was added to fix a random GCC
internal error on PGO build (gh-145801) caused by corruption of
profile data (.gcda files). The problem is that it makes the PGO
build way slower (up to 47x slower) on i686. Since the GCC internal
error was not seen on i686 so far, don't use -fprofile-update=atomic
on i686.
2026-04-16 19:13:25 +02:00
Dino Viehland c0af5c024b gh-146031: Allow keeping specialization enabled when specifying eval frame function (#146032)
Allow keeping specialization enabled when specifying eval frame function
2026-04-16 09:44:26 -07:00
Mark Shannon cecf564073 GH-146128: Fix AArch64 multi-instruction constants and relocations (GH-148598)
Fix AArch64 multi-instruction constants and relocations

* Elimates rendundant orr xN, xN, 0xffff after 16 or 32 bit loads
* Merges adrp (21rx) and ldr (12) relocations into single 33rx relocation, when safe to do so.
2026-04-16 15:33:09 +01:00
Mark Shannon 600f4dbd54 GH-145668: Add FOR_ITER specialization for virtual iterators. Specialize GET_ITER. (GH-147967)
* Add FOR_ITER_VIRTUAL to specialize FOR_ITER for virtual iterators
* Add GET_ITER_SELF to specialize GET_ITER for iterators (including generators)
* Add GET_ITER_VIRTUAL to specialize GET_ITER for iterables as virtual iterators
* Add new (internal) _tp_iteritem function slot to PyTypeObject
* Put limited RESUME at start of genexpr for free-threading. Fix up exception handling in genexpr
2026-04-16 15:22:22 +01:00
Petr Viktorin 0fcf2b72d3 gh-146636: PEP 803: Reference documentation (GH-148013)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-04-16 14:17:44 +02:00
Pieter Eendebak 1f6a09fb36 gh-100239: Specialize more binary operations using BINARY_OP_EXTEND (GH-128956) 2026-04-16 09:22:41 +01:00
Havmaagen 9d38143088 Docs: Fix typos and a comment in enum.rst (#148156) 2026-04-16 11:23:29 +05:30
Joshua Root 5f28e6b818 gh-148474: Fix _Py_hexlify_simd compilation with older clang (#148475) 2026-04-16 11:21:23 +05:30