Changelog

Python next

Release date: XXXX-XX-XX

Windows

  • gh-146458: Fix incorrect REPL height and width tracking on console window resize on Windows.

Security

  • gh-148395: Fix a dangling input pointer in lzma.LZMADecompressor, bz2.BZ2Decompressor, and internal zlib._ZlibDecompressor when memory allocation fails with MemoryError, which could let a subsequent decompress() call read or write through a stale pointer to the already-released caller buffer.

  • gh-148252: Fixed stack depth calculation in _remote_debugging when decoding certain .pyb inputs on 32-bit builds. Issue originally identified and diagnosed by Tristan Madani (@TristanInSec on GitHub).

  • gh-148178: Hardened _remote_debugging by validating remote debug offset tables before using them to size memory reads or interpret remote layouts.

  • gh-148169: A bypass in webbrowser allowed URLs prefixed with %action to pass the dash-prefix safety check.

  • gh-146333: Fix quadratic backtracking in configparser.RawConfigParser option parsing regexes (OPTCRE and OPTCRE_NV). A crafted configuration line with many whitespace characters could cause excessive CPU usage.

  • gh-146211: Reject CR/LF characters in tunnel request headers for the HTTPConnection.set_tunnel() method.

Library

  • gh-148688: bz2, compression.zstd, lzma, zlib: Fix a double free on memory allocation failure. Patch by Victor Stinner.

  • gh-148651: Fix reference leak in compression.zstd.ZstdDecompressor when an invalid option key is passed.

  • gh-148639: Implement PEP 800, adding the @typing.disjoint_base decorator. Patch by Jelle Zijlstra.

  • gh-148508: An intermittent timing error when running SSL tests on iOS has been resolved.

  • gh-144881: asyncio debugging tools (python -m asyncio ps and pstree) now retry automatically on transient errors that can occur when attaching to a process under active thread delegation. The number of retries can be controlled with the --retries flag. Patch by Bartosz Sławecki.

  • gh-148464: Add missing __ctype_le/be__ attributes for c_float_complex and c_double_complex. Patch by Sergey B Kirpichev.

  • gh-148370: configparser: prevent quadratic behavior when a ParsingError is raised after a parser fails to parse multiple lines. Patch by Bénédikt Tran.

  • gh-121190: importlib.resources.files() now emits a more meaningful error message when module spec is None (as found in some __main__ modules).

  • gh-127012: importlib.abc.Traversable.read_text now allows/solicits an errors parameter.

  • gh-137855: Improve import time of dataclasses module by lazy importing re and copy modules.

  • gh-148254: Use singular “sec” instead of “secs” in timeit verbose output for consistency with other time units.

  • gh-148241: json: Fix serialization: no longer call str(obj) on str subclasses. Patch by Victor Stinner.

  • gh-148225: The profiling.sampling replay command now rejects non-binary profile files with a clear error explaining that replay only accepts files created with --binary.

  • gh-148192: email.generator.Generator._make_boundary could fail to detect a duplicate boundary string if linesep was not n. It now correctly detects boundary strings when linesep is rn as well.

  • gh-148100: Soft deprecate re.match() and re.Pattern.match() in favour of re.prefixmatch() and re.Pattern.prefixmatch(). Patch by Hugo van Kemenade.

  • gh-147957: Guarantees that collections.UserDict.popitem() will pop in the same order as the wrapped dictionary rather than an arbitrary order.

  • gh-146609: Add colour to timeit CLI output. Patch by Hugo van Kemenade.

  • gh-146563: xml.parsers.expat: add an exception note when a custom Expat handler return value cannot be properly interpreted. Patch by Bénédikt Tran.

  • gh-146313: Fix a deadlock in multiprocessing’s resource tracker where the parent process could hang indefinitely in os.waitpid() during interpreter shutdown if a child created via os.fork() still held the resource tracker’s pipe open.

  • gh-146292: Add colour to BaseHTTPRequestHandler logs, as used by the http.server CLI. Patch by Hugo van Kemenade.

  • gh-145846: Fix memory leak in _lsprof when clear() is called during active profiling with nested calls. clearEntries() now walks the entire currentProfilerContext linked list instead of only freeing the top context.

  • gh-145831: Fix email.quoprimime.decode() leaving a stray \r when eol='\r\n' by stripping the full eol string instead of one character.

  • gh-145244: Fixed a use-after-free in json encoder when a default callback mutates the dictionary being serialized.

  • gh-117716: Fix wave writing of odd-sized data chunks by appending the required RIFF pad byte and correcting the RIFF chunk size field accordingly.

  • gh-145200: hashlib: fix a memory leak when allocating or initializing an OpenSSL HMAC context fails.

  • gh-145105: Fix crash in csv reader when iterating with a re-entrant iterator that calls next() on the same reader from within __next__.

  • gh-70647: strptime() now raises ValueError when the format string contains %d without a year directive. Using %e without a year now emits a DeprecationWarning.

  • gh-105936: Attempting to mutate non-field attributes of dataclasses with both frozen and slots being True now raises FrozenInstanceError instead of TypeError. Their non-dataclass subclasses can now freely mutate non-field attributes, and the original non-slotted class can be garbage collected.

  • gh-142831: Fix a crash in the json module where a use-after-free could occur if the object being encoded is modified during serialization.

  • gh-130273: Fix traceback color output with Unicode characters.

  • gh-134551: Add t-strings support to pprint functions

  • gh-123853: Update the table of Windows language code identifiers (LCIDs) used by locale.getdefaultlocale() on Windows to protocol version 16.0 (2024-04-23).

  • gh-70039: Fixed bug where smtplib.SMTP.starttls() could fail if smtplib.SMTP.connect() is called explicitly rather than implicitly.

  • gh-96894: Do not turn echo off for subsequent commands in batch activators (activate.bat and deactivate.bat) of venv.

IDLE

  • gh-94523: Detect file if modified at local disk and prompt to ask refresh. Patch by Shixian Li.

  • gh-139551: Support rendering BaseExceptionGroup in IDLE.

  • gh-89520: Make IDLE extension configuration look at user config files, allowing user-installed extensions to have settings and key bindings defined in ~/.idlerc.

Documentation

Core and Builtins

  • gh-148653: Forbid marshalling recursive code objects, slice and frozendict objects which cannot be correctly unmarshalled.

  • gh-148515: Fix a bug in the JIT optimizer reading operands for uops with multiple caches.

  • gh-148390: Fix an undefined behavior in memoryview when using the native boolean format (?) in cast(). Previously, on some common platforms, calling memoryview(b).cast("?").tolist() incorrectly returned [False] instead of [True] for any even byte b. Patch by Bénédikt Tran.

  • gh-148393: Fix data races between PyDict_Watch() / PyDict_Unwatch() and concurrent dict mutation in the free-threaded build.

  • gh-148398: Fix a bug in the JIT optimizer where class attribute loads were not invalidated after type mutation.

  • gh-148284: Fix high stack consumption in Python’s interpreter loop on Clang 22 by setting function limits for inlining when building with computed gotos.

  • gh-148037: Remove critical section from PyCode_Addr2Line() in free-threading.

  • gh-115802: Improve JIT code generation on Linux AArch64 by reducing the indirect call to external symbols. Patch by Diego Russo.

  • gh-148222: Fix vectorcall support in types.GenericAlias when the underlying type does not support the vectorcall protocol. Fix possible leaks in types.GenericAlias and types.UnionType in case of memory error.

  • gh-148208: Fix recursion depth leak in PyObject_Print()

  • gh-95004: The specializing interpreter now specializes for enum.Enum improving performance and scaling in free-threading. Patch by Kumar Aditya.

  • gh-148014: Accept a function name in -X presite command line option and PYTHON_PRESITE environment variable. Patch by Victor Stinner.

  • gh-146306: Specialize float true division in the tier 2 optimizer with inplace mutation for uniquely-referenced operands.

  • gh-146031: The unstable API _PyInterpreterState_SetEvalFrameFunc has a companion function _PyInterpreterState_SetEvalFrameAllowSpecialization to specify if specialization should be allowed. When this option is set to 1 the specializer will turn Python -> Python calls into specialized opcodes which the replacement interpreter loop can choose to respect and perform inlined dispatch.

  • gh-145278: The encodings is now partially frozen, including the aliases and utf_8 submodules.

    The linecache is now frozen.

  • gh-134584: Optimize and eliminate redundant ref-counting for MAKE_FUNCTION in the JIT.

  • gh-143886: Reorder function annotations so positional-only arguments are returned before other arguments. This fixes how functools.singledispatch() registers functions with positional-only arguments.

  • gh-137814: Fix the __qualname__ attribute of __annotate__ functions on functions.

  • gh-100239: Specialize BINARY_OP for concatenation of lists and tuples, and propagate the result type through _BINARY_OP_EXTEND in the tier 2 optimizer so that follow-up type guards can be eliminated.

C API

Build

  • gh-148535: No longer use the gcc -fprofile-update=atomic flag on i686. The flag has been 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 anymore. Patch by Victor Stinner.

  • gh-148483: Use Py_GCC_ATTRIBUTE(unused) for stop_tracing label.

  • gh-148474: Fixed compilation of Python/pystrhex.c with older clang versions.

  • gh-146445: The Android build tools have been moved to the Platforms folder.

  • gh-146264: Fix static module builds on non-WASI targets by linking HACL dependencies as static libraries when MODULE_BUILDTYPE=static, preventing duplicate _Py_LibHacl_* symbol errors at link time.

  • gh-133312: Add a new ./configure option --enable-static-libpython-for-interpreter which, when used with --enable-shared, continues to build the shared library but does not use it for the interpreter. Instead, libpython is statically linked into the interpreter, as if --enable-shared had not been used. This allows you to do a single build and get a Python interpreter binary that does not use a shared library but also get a shared library for use by other programs.

Python 3.15.0 alpha 8

Release date: 2026-04-07

Security

Core and Builtins

  • gh-148157: Fix an unlikely crash when parsing an invalid type comments for function parameters. Found by OSS Fuzz in #492782951.

  • gh-100239: Propagate result type and uniqueness information through _BINARY_OP_EXTEND in the tier 2 optimizer, enabling elimination of downstream type guards and selection of inplace float operations.

  • gh-148144: Initialize _PyInterpreterFrame.visited when copying interpreter frames so incremental GC does not read an uninitialized byte from generator and frame-object copies.

  • gh-148072: Cache pickle.dumps and pickle.loads per interpreter in the XIData framework, avoiding repeated module lookups on every cross-interpreter data transfer. This speeds up InterpreterPoolExecutor for mutable types (list, dict) by 1.7x–3.3x.

  • gh-148110: Fix sys.set_lazy_imports_filter() so relative lazy imports pass the resolved imported module name to the filter callback. Patch by Pablo Galindo.

  • gh-148083: Constant-fold _CONTAINS_OP_SET for frozenset. Patch by Donghee Na.

  • gh-144319: Fix a bug that could cause applications with specific allocation patterns to leak memory via Huge Pages if compiled with Huge Page support. Patch by Pablo Galindo

  • gh-147985: Make PySet_Contains() attempt a lock-free lookup, similar to set.__contains__(). This avoids acquiring the set object mutex in the normal case.

  • gh-147856: Allow the count argument of bytes.replace() to be a keyword.

  • gh-146615: Fix a crash in __get__() for METH_METHOD descriptors when an invalid (non-type) object is passed as the second argument. Patch by Steven Sun.

  • gh-146306: Optimize compact integer arithmetic in the JIT by mutating uniquely-referenced operands in place, avoiding allocation of a new int object. Speeds up the pyperformance spectral_norm benchmark by ~10%.

  • gh-146587: Fix type slot assignment incase of multiple slots for same name in type object implementation. Patch by Kumar Aditya.

  • gh-126910: Set frame pointers in aarch64-unknown-linux-gnu JIT code, allowing most native profilers and debuggers to unwind through them. Patch by Diego Russo

  • gh-146388: Adds a null check to handle when the JIT optimizer runs out of space when dealing with contradictions in make_bottom.

  • gh-146369: Ensure -X lazy_imports=none` and PYTHON_LAZY_IMPORTS=none` override __lazy_modules__. Patch by Hugo van Kemenade.

  • gh-146308: Fixed multiple error handling issues in the _remote_debugging module including a double-free in code object caching, memory leaks on allocation failure, missing exception checks in binary format varint decoding, reference leaks on error paths in frame chain processing, and inconsistent thread status error reporting across platforms. Patch by Pablo Galindo.

  • gh-146306: Optimize float arithmetic in the JIT by mutating uniquely-referenced operands in place, avoiding allocation of a new float object. Speeds up the pyperformance nbody benchmark by ~19%.

  • gh-146128: Fix a bug which could cause constant values to be partially corrupted in AArch64 JIT code. This issue is theoretical, and hasn’t actually been observed in unmodified Python interpreters.

  • gh-146250: Fixed a memory leak in SyntaxError when re-initializing it.

  • gh-146245: Fixed reference leaks in socket when audit hooks raise exceptions in socket.getaddrinfo() and socket.sendto().

  • gh-146151: memoryview now supports the float complex and double complex C types: formatting characters 'F' and 'D' respectively. Patch by Sergey B Kirpichev.

  • gh-146196: Fix potential Undefined Behavior in PyUnicodeWriter_WriteASCII() by adding a zero-length check. Patch by Shamil Abdulaev.

  • gh-146227: Fix wrong type in _Py_atomic_load_uint16 in the C11 atomics backend (pyatomic_std.h), which used a 32-bit atomic load instead of 16-bit. Found by Mohammed Zuhaib.

  • gh-146205: Fixed a bug where select.epoll.close(), select.kqueue.close(), and select.devpoll.close() silently ignored errors.

  • gh-146199: Comparison of code objects now handles errors correctly.

  • gh-145667: Remove the GET_ITER_YIELD_FROM instruction, modifying SEND to pair with GET_ITER when compiling yield from expressions.

  • gh-146192: Add Base32 support to binascii and improve the performance of the Base32 converters in base64. Patch by James Seo.

  • gh-135871: Improve multithreaded scaling of PyMutex in low-contention scenarios by reloading the lock’s internal state, without slowing down high-contention scenarios.

  • gh-146096: Fixed segmentation fault when called repr for BaseExceptionGroup with empty or 1-size tuple args.

  • gh-146056: Fix repr() for lists and tuples containing NULLs.

  • gh-145059: Fixed sys.lazy_modules to include lazy modules without submodules. Patch by Bartosz Sławecki.

  • gh-146041: Fix free-threading scaling bottleneck in sys.intern() and PyObject_SetAttr() by avoiding the interpreter-wide lock when the string is already interned and immortalized.

  • gh-145990: python --help-env sections are now sorted by environment variable name.

  • gh-145990: python --help-xoptions is now sorted by -X option name.

  • gh-145876: AttributeErrors and KeyErrors raised in keys() or __getitem__() during dictionary unpacking ({**mymapping} or func(**mymapping)) are no longer masked by TypeError.

  • gh-127958: Support tracing from function entrypoints in the JIT. Patch by Ken Jin.

  • gh-145376: Fix GC tracking in structseq.__replace__().

  • gh-145792: Fix out-of-bounds access when invoking faulthandler on a CPython build compiled without support for VLAs.

  • gh-142183: Avoid a pathological case where repeated calls at a specific stack depth could be significantly slower.

  • gh-145779: Improve scaling of classmethod() and staticmethod() calls in the free-threaded build by avoiding the descriptor __get__ call.

  • gh-145783: Fix an unlikely crash in the parser when certain errors were erroneously not propagated. Found by OSS Fuzz in #491369109.

  • gh-145685: Improve scaling of type attribute lookups in the free-threaded build by avoiding contention on the internal type lock.

  • gh-145713: Make bytearray.resize() thread-safe in the free-threaded build by using a critical section and calling the lock-held variant of the resize function.

  • gh-145036: In free-threaded build, fix race condition when calling __sizeof__() on a list

  • gh-134584: Eliminate redundant refcounting for MATCH_CLASS in the JIT.

  • gh-69605: Add math.integer to REPL auto-completion of imports.

  • gh-131798: Optimize _ITER_CHECK_RANGE and _ITER_CHECK_LIST in the JIT

  • gh-143414: Add tracking to the JIT optimizer to determine whether a reference is uniquely owned or shared

  • gh-143636: Fix a crash when calling SimpleNamespace.__replace__() on non-namespace instances. Patch by Bénédikt Tran.

  • gh-126910: Set frame pointers in x86_64-unknown-linux-gnu JIT code, allowing most native profilers and debuggers to unwind through them.

  • gh-140594: Fix an out of bounds read when a single NUL character is read from the standard input. Patch by Shamil Abdulaev.

  • gh-140870: Add support for module attributes in the REPL auto-completion of imports.

Library

Documentation

  • gh-126676: Expand argparse documentation for type=bool with a demonstration of the surprising behavior and pointers to common alternatives.

  • gh-145649: Fix text wrapping and formatting of -X option descriptions in the python(1) man page by using proper roff markup.

Tests

  • gh-144418: The Android testbed’s emulator RAM has been increased from 2 GB to 4 GB.

  • gh-146202: Fix a race condition in regrtest: make sure that the temporary directory is created in the worker process. Previously, temp_cwd() could fail on Windows if the “build” directory was not created. Patch by Victor Stinner.

Build

  • gh-146541: The Android testbed can now be built for 32-bit ARM and x86 targets.

  • gh-146498: The iOS XCframework build script now ensures libpython isn’t included in installed app content, and is more robust in identifying standard library binary content that requires processing.

  • gh-146450: The Android build script was modified to improve parity with other platform build scripts.

  • gh-146446: The clean target for the Apple/iOS XCframework build script is now more selective when targeting a single architecture.

  • gh-146444: The Apple/iOS build script has been moved to the Platforms directory.

  • gh-146210: Fix building the jit stencils on Windows when the interpreter is built with a different clang version. Patch by Chris Eibl.

  • gh-145844: Update to WASI SDK 32.

  • gh-145801: When Python build is optimized with GCC using PGO, use -fprofile-update=atomic option to use atomic operations when updating profile information. This option reduces the risk of gcov Data Files (.gcda) corruption which can cause random GCC crashes. Patch by Victor Stinner.

  • gh-138850: Add --disable-epoll to configure

  • gh-145633: Remove support for ancient ARM platforms (ARMv4L and ARMv5L OABI boards), using mixed-endian representation for doubles. Patch by Sergey B Kirpichev.

  • gh-85277: Fix building without stropts.h or empty stropts.h

Windows

  • gh-140131: Fix REPL cursor position on Windows when module completion suggestion line hits console width.

macOS

Tools/Demos

  • gh-135953: Properly identify the main thread in the Gecko profiler collector by using a status flag from the interpreter state instead of relying on threading.main_thread() in the collector process.

  • gh-145976: Remove Misc/indent.pro, a configuration file for GNU indent(1).

  • gh-145976: Remove Misc/vgrindefs and Misc/Porting.

C API

Python 3.15.0 alpha 7

Release date: 2026-03-10

Windows

Tests

  • gh-144741: Fix test_frame_pointer_unwind when Python is built with --enable-shared. Classify also libpython frames as "python". Patch by Victor Stinner.

  • gh-144739: When Python was compiled with system expat older then 2.7.2 but tests run with newer expat, still skip test.test_pyexpat.MemoryProtectionTest.

Security

Library

Documentation

Core and Builtins

  • gh-145701: Fix SystemError when __classdict__ or __conditional_annotations__ is in a class-scope inlined comprehension. Found by OSS Fuzz in #491105000.

  • gh-145615: Fixed a memory leak in the free-threaded build where mimalloc pages could become permanently unreclaimable until the owning thread exited.

  • gh-116738: Make mmap.mmap.set_name() thread-safe on the free threaded build.

  • gh-145566: In the free threading build, skip the stop-the-world pause when reassigning __class__ on a newly created object.

  • gh-143055: Fix crash in AST unparser when unparsing dict comprehension unpacking. Found by OSS Fuzz in #489790200.

  • gh-145335: Fix a crash in os.pathconf() when called with -1 as the path argument.

  • gh-145376: Fix reference leaks in various unusual error scenarios.

  • gh-145234: Fixed a SystemError in the parser when an encoding cookie (for example, UTF-7) decodes to carriage returns (\r). Newlines are now normalized after decoding in the string tokenizer.

    Patch by Pablo Galindo.

  • gh-145275: Added the -X pathconfig_warnings and PYTHON_PATHCONFIG_WARNINGS options, allowing to disable warnings from The initialization of the sys.path module search path.

  • gh-145273: A warning is now shown during The initialization of the sys.path module search path if it can’t find a valid standard library.

  • gh-145241: Specialized the parser error for when with items are followed by a trailing comma (for example, with item,:), raising a clearer SyntaxError message. Patch by Pablo Galindo and Bartosz Sławecki.

  • gh-130555: Fix use-after-free in dict.clear() when the dictionary values are embedded in an object and a destructor causes re-entrant mutation of the dictionary.

  • gh-145197: Fix JIT trace crash when recording function from cleared generator frame.

  • gh-145187: Fix compiler assertion fail when a type parameter bound contains an invalid expression in a conditional block.

  • gh-145142: Fix a crash in the free-threaded build when the dictionary argument to str.maketrans() is concurrently modified.

  • gh-145118: str.maketrans() now accepts frozendict.

  • gh-144015: Speed up bytes.hex(), bytearray.hex(), binascii.hexlify(), and hashlib .hexdigest() operations with SIMD on x86-64, ARM64, and ARM32 with NEON when built with gcc (version 12 or higher) or clang (version 3 or higher) compilers. Around 1.1-3x faster for common 16-64 byte inputs such as hashlib hex digests, and up to 8x faster for larger data.

  • gh-145118: type() now accepts frozendict as an argument.

  • gh-145064: Fix JIT optimizer assertion failure during CALL_ALLOC_AND_ENTER_INIT side exit.

  • gh-145055: exec() and eval() now accept frozendict for globals. Patch by Victor Stinner.

  • gh-145058: Fix a crash when __lazy_import__() is passed a non-string argument, by raising an TypeError instead.

  • gh-144995: Optimize memoryview comparison: a memoryview is equal to itself, there is no need to compare values. Patch by Victor Stinner.

  • gh-141510: Update specializer to support frozendict. Patch by Donghee Na.

  • gh-141510: Optimize frozendict.fromkeys() to avoid unnecessary thread-safety operations in frozendict cases. Patch by Donghee Na.

  • gh-100239: Speedup BINARY_OP_EXTEND for exact floats and medium-size integers by up to 15%. Patch by Chris Eibl.

  • gh-144914: Use mimalloc for raw memory allocations such as via PyMem_RawMalloc() for better performance on free-threaded builds. Patch by Kumar Aditya.

  • gh-144872: Fix heap buffer overflow in the parser found by OSS-Fuzz.

  • gh-144766: Fix a crash in fork child process when perf support is enabled.

  • gh-144759: Fix undefined behavior in the lexer when start and multi_line_start pointers are NULL in _PyLexer_remember_fstring_buffers() and _PyLexer_restore_fstring_buffers(). The NULL pointer arithmetic (NULL - valid_pointer) is now guarded with explicit NULL checks.

  • gh-141510: Add built-in frozendict type. Patch by Victor Stinner.

  • gh-144681: Fix a JIT assertion failure when a conditional branch jumps to the same target as the fallthrough path.

  • gh-143300: Add PyUnstable_SetImmortal() C-API function to mark objects as immortal.

  • gh-144702: Clarify the error message raised when a class pattern is used to match on a non-class object.

  • gh-144569: Optimize BINARY_SLICE for list, tuple, and unicode by avoiding temporary slice object creation.

  • gh-144438: Align the QSBR thread state array to a 64-byte cache line boundary to avoid false sharing in the free-threaded build.

  • gh-142349: Implement PEP 810. Patch by Pablo Galindo and Dino Viehland.

  • gh-141226: Deprecate PEP 456 support for providing an external definition of the string hashing scheme. Removal is scheduled for Python 3.19. Patch by Bénédikt Tran.

  • gh-138912: Improve MATCH_CLASS performance by up to 52% in certain cases. Patch by Marc Mueller.

  • gh-130327: Fix erroneous clearing of an object’s __dict__ if overwritten at runtime.

  • gh-80667: Literals using the \N{name} escape syntax can now construct CJK ideographs and Hangul syllables using case-insensitive names.

C API

Build

  • gh-144533: Use wasmtime’s --argv0 to auto-discover sysconfig in WASI builds

  • gh-145110: Fix targets “Clean” and “CLeanAll” in case of PGO builds on Windows. Patch by Chris Eibl.

  • gh-144679: When building with Visual Studio 2026 (Version 18), use PlatformToolSet v145 by default. Patch by Chris Eibl.

  • gh-144675: Update to WASI SDK 30.

  • gh-136677: Introduce executable specific linker flags to ./configure.

Python 3.15.0 alpha 6

Release date: 2026-02-11

macOS

  • gh-144648: Allowed _remote_debugging to build on more OS versions by using proc_listpids() rather than proc_listallpids().

  • gh-124111: Update macOS installer to use Tcl/Tk 9.0.3.

  • gh-144551: Update macOS installer to use OpenSSL 3.5.5.

Windows

Tests

  • gh-144415: The Android testbed now distinguishes between stdout/stderr messages which were triggered by a newline, and those triggered by a manual call to flush. This fixes logging of progress indicators and similar content.

  • gh-65784: Add support for parametrized resource wantobjects in regrtests, which allows to run Tkinter tests with the specified value of tkinter.wantobjects, for example -u wantobjects=0.

Security

  • gh-144125: BytesGenerator will now refuse to serialize (write) headers that are unsafely folded or delimited; see verify_generated_headers. (Contributed by Bas Bloemsaat and Petr Viktorin in gh-121650).

  • gh-143935: Fixed a bug in the folding of comments when flattening an email message using a modern email policy. Comments consisting of a very long sequence of non-foldable characters could trigger a forced line wrap that omitted the required leading space on the continuation line, causing the remainder of the comment to be interpreted as a new header field. This enabled header injection with carefully crafted inputs.

  • gh-143925: Reject control characters in data: URL media types.

  • gh-143923: Reject control characters in POP3 commands.

  • gh-143921: Reject control characters in IMAP commands.

  • gh-143919: Reject control characters in http.cookies.Morsel fields and values.

  • gh-143916: Reject C0 control characters within wsgiref.headers.Headers fields, values, and parameters.

Library

IDLE

  • gh-143774: Better explain the operation of Format / Format Paragraph.

Core and Builtins

  • gh-134584: Optimize and eliminate ref-counting in _BINARY_OP_SUBSCR_LIST_SLICE

  • gh-144563: Fix interaction of the Tachyon profiler and ctypes and other modules that load the Python shared library (if present) in an independent map as this was causing the mechanism that loads the binary information to be confused. Patch by Pablo Galindo

  • gh-144601: Fix crash when importing a module whose PyInit function raises an exception from a subinterpreter.

  • gh-144549: Fix building the tail calling interpreter on Visual Studio 2026 with free-threading.

  • gh-144513: Fix potential deadlock when using critical sections during stop-the-world pauses in the free-threaded build.

  • gh-131798: Optimise _GUARD_TOS_SLICE in the JIT.

  • gh-144330: Move classmethod and staticmethod initialization from __init__() to __new__(). Patch by Victor Stinner.

  • gh-144446: Fix data races in the free-threaded build when reading frame object attributes while another thread is executing the frame.

  • gh-120321: Add gi_state, cr_state, and ag_state attributes to generators, coroutines, and async generators that return the current state as a string (e.g., GEN_RUNNING). The inspect module functions getgeneratorstate(), getcoroutinestate(), and getasyncgenstate() now return these attributes directly.

  • gh-141563: Fix thread safety of PyDateTime_IMPORT.

  • gh-144280: Fix a bug in JIT where the predicate symbol had no truthiness

  • gh-140550: In PyModuleDef.m_slots, allow slots that repeat information present in PyModuleDef.

  • gh-139103: Improve scaling of namedtuple() instantiation in the free-threaded build.

  • gh-144307: Prevent a reference leak in module teardown at interpreter finalization.

  • gh-144319: Add huge pages support for the pymalloc allocator. Patch by Pablo Galindo

  • gh-120321: Made gi_yieldfrom thread-safe in the free-threading build by using a lightweight lock on the frame state.

  • gh-144194: Fix error handling in perf jitdump initialization on memory allocation failure.

  • gh-143962: Name suggestion for not normalized name suggests now the normalized name or the closest name to the normalized name. If the suggested name is not ASCII, include also its ASCII representation.

  • gh-144157: bytes.translate() now allows the compiler to unroll its loop more usefully for a 2x speedup in the common no-deletions specified case.

  • gh-144068: Fix JIT tracer memory leak, ensure the JIT tracer state is freed when daemon threads are cleaned up during interpreter shutdown.

  • gh-144012: Check if the result is NULL in BINARY_OP_EXTENT opcode.

  • gh-144007: Eliminate redundant refcounting in the JIT for BINARY_OP.

  • gh-144005: Eliminate redundant refcounting from BINARY_OP_EXTEND.

  • gh-143939: Fix erroneous “cannot reuse already awaited coroutine” error that could occur when a generator was run during the process of clearing a coroutine’s frame.

  • gh-141805: Fix crash in set when objects with the same hash are concurrently added to the set after removing an element with the same hash while the set still contains elements with the same hash.

  • gh-143670: Fixes a crash in ga_repr_items_list function.

  • gh-143650: Fix race condition in importlib where a thread could receive a stale module reference when another thread’s import fails.

  • gh-143569: Generator expressions in 3.15 now conform to the documented behavior when the iterable does not support iteration. This matches the behavior in 3.14 and earlier

  • gh-143192: Improve performance of bitwise operations on multi-digit ints.

  • gh-132657: If we are specializing to LOAD_GLOBAL_MODULE or LOAD_ATTR_MODULE, try to enable deferred reference counting for the value, if the object is owned by a different thread. This applies to the free-threaded build only and should improve scaling of multi-threaded programs. Note that when deferred reference counting is enabled, the object will be deallocated by the GC, rather than by Py_DECREF().

  • gh-143055: Implement PEP 798 (Unpacking in Comprehensions). Patch by Adam Hartz.

  • gh-142037: Improve error messages for printf-style formatting. For errors in the format string, always include the position of the start of the format unit. For errors related to the formatted arguments, always include the number or the name of the argument. Raise more specific errors and include more information (type and number of arguments, most probable causes of error).

  • gh-140557: bytearray buffers now have the same alignment when empty as when allocated. Unaligned buffers can still be created by slicing.

  • gh-140232: Frozenset objects with immutable elements are no longer tracked by the garbage collector.

  • gh-115231: Setup __module__ attribute for built-in static methods. Patch by Sergey B Kirpichev.

C API

Build

  • gh-140421: Disable the perf trampoline on older macOS versions where it cannot be built.

  • gh-144309: Build Python with POSIX 2024, instead of POSIX 2008. Patch by Victor Stinner.

  • gh-144278: Enables defining the _PY_IMPL_NAME and _PY_IMPL_CACHE_TAG preprocessor definitions to override sys.implementation at build time. Definitions need to include quotes when setting to a string literal. Setting the cache tag to NULL has the effect of completely disabling automatic creation and use of .pyc files.

  • gh-143960: Add support for OpenSSL 3.6, drop EOL 3.2. Patch by Hugo van Kemenade.

  • gh-143941: Move WASI-related files to Platforms/WASI. Along the way, leave a deprecated Tools/wasm/wasi/__main__.py behind for backwards-compatibility.

  • gh-143842: Prevent static builds from clashing with curses by making the optimizer COLORS table static.

Python 3.15.0 alpha 5

Release date: 2026-01-14

Windows

  • gh-143082: Fix pdb arrow key history not working when stdin is sys.stdin.

  • gh-128067: Fix a bug in PyREPL on Windows where output without a trailing newline was overwritten by the next prompt.

Tools/Demos

  • gh-142095: Make gdb ‘py-bt’ command use frame from thread local state when available. Patch by Sam Gross and Victor Stinner.

Tests

  • gh-143460: Skip tests relying on infinite recusion if stack size is unlimited.

  • gh-143553: Add support for parametrized resources, such as -u xpickle=2.7.

  • bpo-31391: Forward-port test_xpickle from Python 2 to Python 3 and add the resource back to test’s command line.

Library

  • gh-143706: Fix multiprocessing forkserver so that sys.argv is correctly set before __main__ is preloaded. Previously, sys.argv was empty during main module import in forkserver child processes. This fixes a regression introduced in 3.13.8 and 3.14.1. Root caused by Aaron Wieczorek, test provided by Thomas Watson, thanks!

  • gh-143638: Forbid reentrant calls of the pickle.Pickler and pickle.Unpickler methods for the C implementation. Previously, this could cause crash or data corruption, now concurrent calls of methods of the same object raise RuntimeError.

  • gh-143658: importlib.metadata: Use str.translate() to improve performance of importlib.metadata.Prepared.normalize(). Patch by Hugo van Kemenade and Henry Schreiner.

  • gh-78724: Raise RuntimeError’s when user attempts to call methods on half-initialized Struct objects, For example, created by Struct.__new__(Struct). Patch by Sergey B Kirpichev.

  • gh-143196: Fix crash when the internal encoder object returned by undocumented function json.encoder.c_make_encoder() was called with non-zero second (_current_indent_level) argument.

  • gh-143191: _thread.stack_size() now raises ValueError if the stack size is too small. Patch by Victor Stinner.

  • gh-143547: Fix sys.unraisablehook() when the hook raises an exception and changes sys.unraisablehook(): hold a strong reference to the old hook. Patch by Victor Stinner.

  • gh-139686: Revert 0a97941245f1dda6d838f9aaf0512104e5253929 and 57db12514ac686f0a752ec8fe1c08b6daa0c6219 which made importlib.reload a no-op for lazy modules; caused Buildbot failures.

  • gh-143517: annotationlib.get_annotations() no longer raises a SyntaxError when evaluating a stringified starred annotation that starts with one or more whitespace characters followed by a *. Patch by Bartosz Sławecki.

  • gh-143474: Add os.RWF_ATOMIC constant for Linux 6.11+.

  • gh-143445: Speed up copy.deepcopy() by 1.04x.

  • gh-143378: Fix use-after-free crashes when a BytesIO object is concurrently mutated during write() or writelines().

  • gh-143368: Fix endless retry loop in profiling.sampling blocking mode when threads cannot be seized due to EPERM. Such threads are now skipped instead of causing repeated error messages. Patch by Pablo Galindo.

  • gh-143346: Fix incorrect wrapping of the Base64 data in plistlib._PlistWriter when the indent contains a mix of tabs and spaces.

  • gh-140025: queue: Fix SimpleQueue.__sizeof__() computation.

  • gh-143310: tkinter: fix a crash when a Python list is mutated during the conversion to a Tcl object (e.g., when setting a Tcl variable). Patch by Bénédikt Tran.

  • gh-143309: Fix a crash in os.execve() on non-Windows platforms when given a custom environment mapping which is then mutated during parsing. Patch by Bénédikt Tran.

  • gh-143308: pickle: fix use-after-free crashes when a PickleBuffer is concurrently mutated by a custom buffer callback during pickling. Patch by Bénédikt Tran and Aaron Wieczorek.

  • gh-142939: Performance optimisations for difflib.get_close_matches()

  • gh-124951: The base64 implementation behind the binascii, base64, and related codec has been optimized for modern pipelined CPU architectures and now performs 2-3x faster across all platforms.

  • gh-143237: Fix support of named pipes in the rotating logging handlers.

  • gh-143249: Fix possible buffer leaks in Windows overlapped I/O on error handling.

  • gh-143241: zoneinfo: fix infinite loop in ZoneInfo.from_file when parsing a malformed TZif file. Patch by Fatih Celik.

  • gh-142830: sqlite3: fix use-after-free crashes when the connection’s callbacks are mutated during a callback execution. Patch by Bénédikt Tran.

  • gh-143200: xml.etree.ElementTree: fix use-after-free crashes in __getitem__() and __setitem__() methods of Element when the element is concurrently mutated. Patch by Bénédikt Tran.

  • gh-143214: Add the wrapcol parameter in binascii.b2a_base64() and base64.b64encode().

  • gh-142195: Updated timeout evaluation logic in subprocess to be compatible with deterministic environments like Shadow where time moves exactly as requested.

  • gh-140739: Fix several crashes due to reading invalid memory in the new Tachyon sampling profiler. Patch by Pablo Galindo.

  • gh-142164: Fix the ctypes bitfield overflow error message to report the correct offset and size calculation.

  • gh-143145: Fixed a possible reference leak in ctypes when constructing results with multiple output parameters on error.

  • gh-143103: Add padding support to base64.z85encode() via the pad parameter.

  • gh-130796: Undeprecate the locale.getdefaultlocale() function. Patch by Victor Stinner.

  • gh-74902: Add the iter_graphemes() function in the unicodedata module to iterate over grapheme clusters according to rules defined in Unicode Standard Annex #29, “Unicode Text Segmentation”. Add grapheme_cluster_break(), indic_conjunct_break() and extended_pictographic() functions to get the properties of the character which are related to the above algorithm.

  • gh-143004: Fix a potential use-after-free in collections.Counter.update() when user code mutates the Counter during an update.

  • gh-140648: The asyncio REPL now respects the -I flag (isolated mode). Previously, it would load and execute PYTHONSTARTUP even if the flag was set. Contributed by Bartosz Sławecki.

  • gh-142991: Fixed socket operations such as recvfrom() and sendto() for FreeBSD divert(4) socket.

  • gh-116738: Make the attributes in lzma thread-safe on the free threaded build.

  • gh-142950: Fix regression in argparse where format specifiers in help strings raised ValueError.

  • gh-142881: Fix concurrent and reentrant call of atexit.unregister().

  • gh-142615: Fix possible crashes when initializing asyncio.Task or asyncio.Future multiple times. These classes can now be initialized only once and any subsequent initialization attempt will raise a RuntimeError. Patch by Kumar Aditya.

  • gh-142517: The non-compat32 email policies now correctly handle refolding encoded words that contain bytes that can not be decoded in their specified character set. Previously this resulted in an encoding exception during folding.

  • gh-138122: The Tachyon profiler’s live TUI now integrates with the experimental _colorize theming system. Users can customize colors via _colorize.set_theme() (experimental API, subject to change). A LiveProfilerLight theme is provided for light terminal backgrounds. Patch by Pablo Galindo.

  • gh-142306: Improve errors for Element.remove.

  • gh-63016: Add a flags parameter to mmap.mmap.flush() to control synchronization behavior.

  • gh-139262: Some keystrokes can be swallowed in the new PyREPL on Windows, especially when used together with the ALT key. Fix by Chris Eibl.

  • gh-138897: Improved license/copyright/credits display in the REPL: now uses a pager.

  • gh-135852: Add _winapi.RegisterEventSource(), _winapi.DeregisterEventSource() and _winapi.ReportEvent(). Using these functions in NTEventLogHandler to replace pywin32.

  • gh-109263: Starting a process from spawn context in multiprocessing no longer sets the start method globally.

  • gh-132715: Skip writing objects during marshalling once a failure has occurred.

Documentation

Core and Builtins

  • gh-134584: Eliminate redundant refcounting from _CONTAINS_OP, _CONTAINS_OP_SET and _CONTAINS_OP_DICT.

  • gh-143604: Fix a reference counting issue in the JIT tracer where the current executor could be prematurely freed during tracing.

  • gh-143469: Enable LOAD_ATTR_MODULE specialization even if __getattr__() is defined in module.

  • gh-134584: Eliminate redundant refcounting from TO_BOOL_STR.

  • gh-143377: Fix a crash in _interpreters.capture_exception() when the exception is incorrectly formatted. Patch by Bénédikt Tran.

  • gh-139757: Add BINARY_OP_SUBSCR_USTR_INT to specialize reading an ASCII character from any string. Patch by Chris Eibl.

  • gh-141504: Factor out tracing and optimization heuristics into a single object. Patch by Donghee Na.

  • gh-142982: Specialize CALL_FUNCTION_EX for Python and non-Python callables.

  • gh-136924: The interactive help mode in the REPL no longer incorrectly syntax highlights text input as Python code. Contributed by Olga Matoula.

  • gh-139757: Fix unintended bytecode specialization for non-ascii string. Patch by Donghee Na, Ken Jin and Chris Eibl.

  • gh-143361: Add PY_VECTORCALL_ARGUMENTS_OFFSET to _Py_CallBuiltinClass_StackRefSteal to avoid redundant allocations

  • gh-131798: The JIT optimizer now understands more generator instructions.

  • gh-134584: Eliminate redundant refcounting from _LOAD_ATTR_SLOT.

  • gh-143189: Fix crash when inserting a non-str key into a split table dictionary when the key matches an existing key in the split table but has no corresponding value in the dict.

  • gh-143228: Fix use-after-free in perf trampoline when toggling profiling while threads are running or during interpreter finalization with daemon threads active. The fix uses reference counting to ensure trampolines are not freed while any code object could still reference them. Pach by Pablo Galindo

  • gh-142664: Fix a use-after-free crash in memoryview.__hash__ when the __hash__ method of the referenced object mutates that object or the view. Patch by Bénédikt Tran.

  • gh-142557: Fix a use-after-free crash in bytearray.__mod__ when the bytearray is mutated while formatting the %-style arguments. Patch by Bénédikt Tran.

  • gh-143195: Fix use-after-free crashes in bytearray.hex() and memoryview.hex() when the separator’s __len__() mutates the original object. Patch by Bénédikt Tran.

  • gh-143183: Fix a bug in the JIT when dealing with unsupported control-flow or operations.

  • gh-142975: Fix crash after unfreezing all objects tracked by the garbage collector on the free threaded build.

  • gh-143135: Set sys.flags.inspect to 1 when PYTHONINSPECT is 0. Previously, it was set to 0 in this case.

  • gh-143123: Protect the JIT against recursive tracing.

  • gh-143092: Fix a crash in the JIT when dealing with list.append(x) style code.

  • gh-143003: Fix an overflow of the shared empty buffer in bytearray.extend() when __length_hint__() returns 0 for non-empty iterator.

  • gh-143006: Fix a possible assertion error when comparing negative non-integer float and int with the same number of bits in the integer part.

  • gh-116738: Fix thread safety of contextvars.Context.run().

  • gh-142829: Fix a use-after-free crash in contextvars.Context comparison when a custom __eq__ method modifies the context via set().

  • gh-142863: Generate optimized bytecode when calling list or set with generator expression.

  • gh-41779: Allowed defining any __slots__ for a class derived from tuple (including classes created by collections.namedtuple()).

  • gh-69605: Fix edge-cases around already imported modules in the REPL auto-completion of imports.

  • gh-138568: Adjusted the built-in help() function so that empty inputs are ignored in interactive mode.

  • gh-131798: Remove bounds check when indexing into tuples with a constant index.

  • gh-134584: Eliminate redundant refcounting from _CALL_TYPE_1. Patch by Tomas Roun

  • gh-132108: Speed up int.from_bytes() when passed object supports buffer protocol, like bytearray by ~1.2x.

  • gh-128334: Make the slice class subscriptable at runtime to be consistent with typing implementation.

C API

Python 3.15.0 alpha 4

Release date: 2026-01-13

Tests

  • gh-142836: Accommodated Solaris in test_pdb.test_script_target_anonymous_pipe.

Library

  • gh-122431: Corrected the error message in readline.append_history_file() to state that nelements must be non-negative instead of positive.

  • gh-143046: The asyncio REPL no longer prints copyright and version messages in the quiet mode (-q). Patch by Bartosz Sławecki.

  • gh-80744: Fix issue where pdb would read a .pdbrc twice if launched from the home directory

  • gh-138122: Add blocking mode to Tachyon for accurate stack traces in applications with many generators or fast-changing call stacks. Patch by Pablo Galindo.

  • gh-143010: Fixed a bug in mailbox where the precise timing of an external event could result in the library opening an existing file instead of a file it expected to create.

  • gh-112127: Fix possible use-after-free in atexit.unregister() when the callback is unregistered during comparison.

  • gh-138122: Fix incomplete stack traces in the Tachyon profiler’s frame cache when profiling code with deeply nested generators. The frame cache now validates that stack traces reach the base frame before caching, preventing broken flamegraphs. Patch by Pablo Galindo.

  • gh-142834: Change the pdb commands command to use the last available breakpoint instead of failing when the most recently created breakpoint was deleted.

  • gh-142783: Fix zoneinfo use-after-free with descriptor _weak_cache. a descriptor as _weak_cache could cause crashes during object creation. The fix ensures proper reference counting for descriptor-provided objects.

  • gh-76007: Deprecate VERSION from xml.etree.ElementTree and version from xml.sax.expatreader and xml.sax.handler. Patch by Hugo van Kemenade.

  • gh-142784: The asyncio REPL now properly closes the loop upon the end of interactive session. Previously, it could cause surprising warnings. Contributed by Bartosz Sławecki.

  • gh-138122: Add binary output format to profiling.sampling for compact storage of profiling data. The new --binary option captures samples to a file that can be converted to other formats using the replay command. Patch by Pablo Galindo

  • gh-142495: collections.defaultdict now prioritizes __setitem__() when inserting default values from default_factory. This prevents race conditions where a default value would overwrite a value set before default_factory returns.

  • gh-142654: Show the clearer error message when using profiling.sampling on an unknown PID.

  • gh-142560: Fix use-after-free in bytearray search-like methods (find(), count(), index(), rindex(), and rfind()) by marking the storage as exported which causes reallocation attempts to raise BufferError. For contains(), split(), and rsplit() the buffer protocol is used for this.

  • gh-142419: mmap.mmap.set_name() method added to annotate an anonymous memory map if Linux kernel supports PR_SET_VMA_ANON_NAME (Linux 5.17 or newer). Patch by Donghee Na.

  • gh-139971: pydoc: Ensure that the link to the online documentation of a stdlib module is correct.

  • gh-124098: Fix issue where methods in handlers that lacked the protocol name but matched a valid base handler method (e.g., _open() or error()) were incorrectly added to urllib.request.OpenerDirector’s handlers. Contributed by Andrea Mattei.

  • gh-136282: Add support for UNNAMED_SECTION when creating a section via the mapping protocol access

Core and Builtins

  • gh-143057: Avoid locking in PyTraceMalloc_Track() and PyTraceMalloc_Untrack() when tracemalloc is not enabled.

  • gh-139109: Add missing terminator in certain cases when tracing in the new JIT compiler.

  • gh-142961: Fix a segfault in the JIT when constant folding len(tuple).

  • gh-142776: Fix a file descriptor leak in import.c

  • gh-139757: Fix building JIT stencils on free-threaded builds.

  • gh-129068: Make concurrent iteration over the same range iterator thread-safe in the free threading build.

  • gh-142543: Fix a stack overflow on Clang JIT build configurations with full LTO.

  • gh-142448: Fix a bug when using monitoring with the JIT.

  • gh-142766: Clear the frame of a generator when generator.close() is called.

  • gh-134584: Eliminate redundant refcounting from _LOAD_ATTR_INSTANCE_VALUE.

  • gh-134584: Eliminate redundant refcounting from _STORE_ATTR_WITH_HINT.

  • gh-142476: Fix a memory leak in the experimental Tier 2 optimizer when creating executors. Patched by Shamil Abdulaev.

  • gh-100964: Fix reference cycle in exhausted generator frames. Patch by Savannah Ostrowski.

  • gh-139922: Allow building CPython with the tail calling interpreter on Visual Studio 2026 MSVC. This provides a performance gain over the prior interpreter for MSVC. Patch by Ken Jin, Brandt Bucher, and Chris Eibl. With help from the MSVC team including Hulon Jenkins.

Python 3.15.0 alpha 3

Release date: 2025-12-16

Tools/Demos

  • gh-141692: Each slice of an iOS XCframework now contains a lib folder that contains a symlink to the libpython dylib. This allows binary modules to be compiled for iOS using dynamic libreary linking, rather than Framework linking.

Tests

  • gh-140381: Fix flaky test_profiling tests on i686 and s390x architectures by increasing slow_fibonacci call frequency from every 5th iteration to every 2nd iteration.

  • gh-140210: Make test_sysconfig.test_parse_makefile_renamed_vars less fragile by clearing the environment variables before parsing the Makefile.

Security

  • gh-142145: Remove quadratic behavior in xml.minidom node ID cache clearing.

  • gh-42400: Fix buffer overflow in _Py_wrealpath() for paths exceeding MAXPATHLEN bytes by using dynamic memory allocation instead of fixed-size buffer. Patch by Shamil Abdulaev.

  • gh-119451: Fix a potential memory denial of service in the http.client module. When connecting to a malicious server, it could cause an arbitrary amount of memory to be allocated. This could have led to symptoms including a MemoryError, swapping, out of memory (OOM) killed processes or containers, or even system crashes.

  • gh-119342: Fix a potential memory denial of service in the plistlib module. When reading a Plist file received from untrusted source, it could cause an arbitrary amount of memory to be allocated. This could have led to symptoms including a MemoryError, swapping, out of memory (OOM) killed processes or containers, or even system crashes.

Library

  • gh-142754: Add the ownerDocument attribute to xml.dom.minidom elements and attributes created by directly instantiating the Element or Attr class. Note that this way of creating nodes is not supported; creator functions like xml.dom.Document.documentElement() should be used instead.

  • gh-142594: Fix crash in TextIOWrapper.close() when the underlying buffer’s closed property calls detach().

  • gh-76007: Deprecate __version__ from ctypes. Patch by Hugo van Kemenade.

  • gh-76007: Deprecate __version__ from wsgiref.simple_server. Patch by Hugo van Kemenade.

  • gh-142651: unittest.mock: fix a thread safety issue where Mock.call_count may return inaccurate values when the mock is called concurrently from multiple threads.

  • gh-76007: Deprecate __version__ from http.server. Patch by Hugo van Kemenade.

  • gh-138122: Add --subprocesses flag to profiling.sampling CLI to automatically profile subprocesses spawned by the target. When enabled, the profiler monitors for new Python subprocesses and profiles each one separately, writing results to individual output files. This is useful for profiling applications that use multiprocessing, ProcessPoolExecutor, or other subprocess-based parallelism. Patch by Pablo Galindo.

  • gh-142595: Added type check during initialization of the decimal module to prevent a crash in case of broken stdlib. Patch by Sergey B Kirpichev.

  • gh-142556: Fix crash when a task gets re-registered during finalization in asyncio. Patch by Kumar Aditya.

  • gh-138122: Add --mode=exception to the sampling profiler to capture samples only from threads with an active exception, useful for analyzing exception handling overhead. Patch by Pablo Galindo.

  • gh-142539: traceback: Fix location of carets in SyntaxErrors when the source contains wide characters.

  • gh-123241: Avoid reference count operations in garbage collection of ctypes objects.

  • gh-142451: hmac: correctly copy HMAC attributes for objects copied through HMAC.copy(). Patch by Bénédikt Tran.

  • gh-138122: The profiling.sampling flamegraph profiler now supports inverted flamegraph view that aggregates all leaf nodes. In a standard flamegraph, if a hot function is called from multiple locations, it appears multiple times as separate leaf nodes. In the inverted flamegraph, all occurrences of the same leaf function are merged into a single aggregated node at the root, showing the total hotness of that function in one place. The children of each aggregated node represent its callers, making it easier to identify which functions consume the most CPU time and where they are called from.

  • gh-112527: The help text for required options in argparse no longer extended with “ (default: None)”.

  • gh-142438: Fixed a possible leaked GIL in _PySSL_keylog_callback.

  • gh-138122: Add bytecode-level instruction profiling to the sampling profiler via the new --opcodes flag. When enabled, the profiler captures which bytecode opcode is executing at each sample, including Python 3.11+ adaptive specializations, and visualizes this data in the heatmap, flamegraph, gecko, and live output formats. Patch by Pablo Galindo

  • gh-142389: Add backtick markup support in argparse description and epilog text to highlight inline code when color output is enabled.

  • gh-142346: Fix usage formatting for mutually exclusive groups in argparse when they are preceded by positional arguments or followed or intermixed with other optional arguments.

  • gh-142374: Fix cumulative percentage calculation for recursive functions in the new sampling profiler. When profiling recursive functions, cumulative statistics (cumul%, cumtime) could exceed 100% because each recursive frame in a stack was counted separately. For example, a function recursing 500 times in every sample would show 50000% cumulative presence. The fix deduplicates locations within each sample so cumulative stats correctly represent “percentage of samples where this function was on the stack”. Patch by Pablo Galindo.

  • gh-142315: Pdb can now run scripts from anonymous pipes used in process substitution. Patch by Bartosz Sławecki.

  • gh-64532: Subparser help now includes required optional arguments from the parent parser in the usage, making it clearer what arguments are needed to run a subcommand. Patch by Savannah Ostrowski.

  • gh-142207: Fix: profiling.sampling may cause assertion !(has_gil && gil_requested)

  • gh-142332: Fix usage formatting for positional arguments in mutually exclusive groups in argparse. in argparse.

  • gh-142282: Fix winreg.QueryValueEx() to not accidentally read garbage buffer under race condition.

  • gh-142318: Fix typing 'q' at the help of the interactive tachyon profiler exiting the profiler.

  • gh-75949: Fix argparse to preserve | separators in mutually exclusive groups when the usage line wraps due to length.

  • gh-142267: Improve argparse performance by caching the formatter used for argument validation.

  • gh-139862: Remove color parameter from argparse.HelpFormatter constructor. Color is controlled by ArgumentParser.

  • gh-68552: MisplacedEnvelopeHeaderDefect and Missing header name defects are now correctly passed to the handle_defect method of policy in FeedParser.

  • gh-142206: The resource tracker in the multiprocessing module can now understand messages from older versions of itself. This avoids issues with upgrading Python while it is running. (Note that such ‘in-place’ upgrades are not tested.)

  • gh-142214: Fix two regressions in dataclasses in Python 3.14.1 related to annotations.

    • An exception is no longer raised if slots=True is used and the __init__ method does not have an __annotate__ attribute (likely because init=False was used).

    • An exception is no longer raised if annotations are requested on the __init__ method and one of the fields is not present in the class annotations. This can occur in certain dynamic scenarios.

    Patch by Jelle Zijlstra.

  • gh-142203: Remove the debug_override parameter from importlib.util.cache_from_source() which has been deprecated since Python 3.5.

  • gh-138122: The _remote_debugging module now implements frame caching in the RemoteUnwinder class to reduce memory reads when profiling remote processes. When cache_frames=True, unchanged portions of the call stack are reused from previous samples, significantly improving profiling performance for deep call stacks.

  • gh-116738: Fix cmath data race when initializing trigonometric tables with subinterpreters.

  • gh-141982: Allow pdb to set breakpoints on async functions with function names.

  • gh-74389: When the stdin being used by a subprocess.Popen instance is closed, this is now ignored in subprocess.Popen.communicate() instead of leaving the class in an inconsistent state.

  • gh-87512: Fix subprocess.Popen.communicate() timeout handling on Windows when writing large input. Previously, the timeout was ignored during stdin writing, causing the method to block indefinitely if the child process did not consume input quickly. The stdin write is now performed in a background thread, allowing the timeout to be properly enforced.

  • gh-141939: Add color to all interpolated values in argparse help, like %(default)s or %(choices)s. Patch by Alex Prengère.

  • gh-141473: When subprocess.Popen.communicate() was called with input and a timeout and is called for a second time after a TimeoutExpired exception before the process has died, it should no longer hang.

  • gh-141999: Correctly allow KeyboardInterrupt to stop the process when using profiling.sampling.

  • gh-142006: Fix a bug in the email.policy.default folding algorithm which incorrectly resulted in a doubled newline when a line ending at exactly max_line_length was followed by an unfoldable token.

  • gh-141968: Remove data copy from re compilation of regexes with large charsets by using bytearray.take_bytes().

  • gh-141968: Remove data copy from encodings.idna encode() and encode() by using bytearray.take_bytes().

  • gh-141968: Remove data copy from codecs punycode encoding by using bytearray.take_bytes().

  • gh-141968: Remove data copy from wave.Wave_read.readframes() and wave.Wave_write.writeframes() by using bytearray.take_bytes().

  • gh-141968: Remove a data copy from base64.b32decode() and base64.b32encode() by using bytearray.take_bytes().

  • gh-59000: Fix pdb breakpoint resolution for class methods when the module defining the class is not imported.

  • gh-116738: Fix thread safety issue with re scanner objects in free-threaded builds.

  • gh-138122: The profiling.sampling flamegraph profiler now displays thread status statistics showing the percentage of time threads spend holding the GIL, running without the GIL, waiting for the GIL, and performing garbage collection. These statistics help identify GIL contention and thread behavior patterns. When filtering by thread, the display shows per-thread metrics.

  • gh-141781: Fixed an issue where pdb.line_prefix assignment was ignored if assigned after the module was imported.

  • gh-141863: Update Streams to use bytearray.take_bytes() for a over 10% performance improvement on pyperformance asyncio_tcp benchmark.

  • gh-141817: Add socket.IPV6_HDRINCL constant.

  • gh-105836: Fix asyncio.run_coroutine_threadsafe() leaving underlying cancelled asyncio task running.

  • gh-141570: Support file-like object raising OSError from fileno() in color detection (_colorize.can_colorize()). This can occur when sys.stdout is redirected.

  • gh-141679: Add colour to defaults in argparse help. Patch by Hugo van Kemenade.

  • gh-141686: Break reference cycles created by each call to json.dump() or json.JSONEncoder.iterencode().

  • gh-141659: Fix bad file descriptor errors from _posixsubprocess on AIX.

  • gh-141645: Add a new --live mode to the tachyon profiler in profiling.sampling module. This mode consist of a live TUI that displays real-time profiling statistics as the target application runs, similar to top. Patch by Pablo Galindo

  • gh-141615: Check stdin instead of stdout for use_rawinput in pdb.

  • gh-69113: Fix doctest to correctly report line numbers for doctests in __test__ dictionary when formatted as triple-quoted strings by finding unique lines in the string and matching them in the source file.

  • gh-141600: Fix musl version detection on Void Linux.

  • gh-48752: Add readline.get_pre_input_hook() function to retrieve the current pre-input hook. This allows applications to save and restore the hook without overwriting user settings. Patch by Sanyam Khurana.

  • gh-141565: Add async-aware profiling to the Tachyon sampling profiler. The profiler now reconstructs and displays async task hierarchies in flamegraphs, making the output more actionable for users. Patch by Savannah Ostrowski and Pablo Galindo Salgado.

  • gh-60107: Remove a copy from io.RawIOBase.read(). If the underlying I/O class keeps a reference to the mutable memory, raise a BufferError.

  • gh-116738: Make csv module thread-safe on the free threaded build.

  • gh-140911: collections: Ensure that the methods UserString.rindex() and UserString.index() accept collections.UserString instances as the sub argument.

  • gh-140875: Fix handling of unclosed character references (named and numerical) followed by the end of file in html.parser.HTMLParser with convert_charrefs=False.

  • gh-140677: Add heatmap visualization mode to the Tachyon sampling profiler. The new --heatmap output format provides a line-by-line view showing execution intensity with color-coded samples, inline statistics, and interactive call graph navigation between callers and callees.

  • gh-139946: Distinguish stdout and stderr when colorizing output in argparse module.

  • gh-76007: pydoc: Fix DeprecationWarning being raised when generating doc for stdlib modules.

  • gh-138697: Fix inferring dest from a single-dash long option in argparse. If a short option and a single-dash long option are passed to add_argument(), dest is now inferred from the single-dash long option.

  • gh-138525: Add support for single-dash long options and alternate prefix characters in argparse.BooleanOptionalAction.

  • gh-79986: Add parsing for References and In-Reply-To headers to the email library that parses the header content as lists of message id tokens. This prevents them from being folded incorrectly.

  • gh-135559: Flag: a dir() on a Flag enumeration now shows non-canonical members. (i.e. aliases).

  • gh-134453: Fixed subprocess.Popen.communicate() input= handling of memoryview instances that were non-byte shaped on POSIX platforms. Those are now properly cast to a byte shaped view instead of truncating the input. Windows platforms did not have this bug.

  • gh-127930: Add __all__ to tkinter.simpledialog.

  • gh-115952: Fix a potential memory denial of service in the pickle module. When reading a pickled data received from untrusted source, it could cause an arbitrary amount of memory to be allocated, even if the code that is allowed to execute is restricted by overriding the find_class() method. This could have led to symptoms including a MemoryError, swapping, out of memory (OOM) killed processes or containers, or even system crashes.

  • bpo-40350: Fix support for namespace packages in modulefinder.

Documentation

Core and Builtins

  • gh-134584: Eliminate redundant refcounting from _STORE_ATTR_INSTANCE_VALUE.

  • gh-142718: JIT: Fix segfault caused by not flushing the stack to memory at side exits.

  • gh-142737: Tracebacks will be displayed in fallback mode even if io.open() is lost. Previously, this would crash the interpreter. Patch by Bartosz Sławecki.

  • gh-116738: Make the attributes in bz2 thread-safe on the free threaded build.

  • gh-134584: Eliminate redundant refcounting from _CALL_LIST_APPEND.

  • gh-142554: Fix a crash in divmod() when _pylong.int_divmod() does not return a tuple of length two exactly. Patch by Bénédikt Tran.

  • gh-142531: Fix a free-threaded GC performance regression. If there are many untracked tuples, the GC will run too often, resulting in poor performance. The fix is to include untracked tuples in the “long lived” object count. The number of frozen objects is also now included since the free-threaded GC must scan those too.

  • gh-142402: Fix reference counting when adjacent literal parts are merged while constructing string.templatelib.Template, preventing the displaced string object from leaking.

  • gh-116738: Make the attributes in zlib thread-safe on the free threaded build.

  • gh-142343: Fix SIGILL crash on m68k due to incorrect assembly constraint.

  • gh-142236: Improve the “Perhaps you forgot a comma?” syntax error for multi-line string concatenations to point to the last string instead of the first, making it easier to locate where the comma is missing. Patch by Pablo Galindo.

  • gh-142236: Fix incorrect keyword suggestions for syntax errors in traceback. The keyword typo suggestion mechanism would incorrectly suggest replacements when the extracted source code was incomplete rather than containing an actual typo. Patch by Pablo Galindo.

  • gh-142305: Decrease the size of the generated stencils and the runtime JIT code. Patch by Diego Russo.

  • gh-135379: Implement a limited form of register allocation known as “top of stack caching” in the JIT. It works by keeping 0-3 of the top items in the stack in registers. The code generator generates multiple versions of those uops that do not escape and are relatively small. During JIT compilation, the copy that produces the least memory traffic is selected, spilling or reloading values when needed.

  • gh-142276: Fix missing type watcher when promoting attribute loads to constants in the JIT. Patch by Ken Jin. Reproducer by Yuancheng Jiang.

  • gh-142218: Fix crash when inserting into a split table dictionary with a non str key that matches an existing key.

  • gh-141976: Check against abstract stack overflow in the JIT optimizer.

  • gh-97850: Remove all *.load_module() usage and definitions from the import system and importlib. The method has been deprecated in favor of importlib.abc.Loader.exec_module() since Python 3.4.

  • gh-142048: Fix quadratically increasing garbage collection delays in free-threaded build.

  • gh-65961: Stop setting __cached__ on modules.

  • gh-141770: Annotate anonymous mmap usage only when supported by the Linux kernel and if -X dev is used or Python is built in debug mode. Patch by Donghee Na.

  • gh-142029: Raise ModuleNotFoundError instead of crashing when a nonexistent module is used as a name in _imp.create_builtin().

  • gh-142029: Raise ValueError instead of crashing when empty string is used as a name in _imp.create_builtin().

  • gh-141976: Protect against specialization failures in the tracing JIT compiler for performance reasons.

  • gh-141861: Fix invalid memory read in the ENTER_EXECUTOR instruction.

  • gh-141930: When importing a module, use Python’s regular file object to ensure that writes to .pyc files are complete or an appropriate error is raised.

  • gh-138122: Add incomplete sample detection to prevent corrupted profiling data. Each thread state now contains an embedded base frame (sentinel at the bottom of the frame stack) with owner type FRAME_OWNED_BY_INTERPRETER. The profiler validates that stack unwinding terminates at this sentinel frame. Samples that fail to reach the base frame (due to race conditions, memory corruption, or other errors) are now rejected rather than being included as spurious data.

  • gh-120158: Fix inconsistent state when enabling or disabling monitoring events too many times.

  • gh-140638: Expose a "candidates" stat in gc.get_stats() and gc.callbacks.

  • gh-141780: Fix Py_mod_gil with API added in PEP 793: PyModule_FromSlotsAndSpec() and PyModExport hooks

  • gh-141732: Ensure the __repr__() for ExceptionGroup and BaseExceptionGroup does not change when the exception sequence that was original passed in to its constructor is subsequently mutated.

  • gh-140638: Expose a "duration" stat in gc.get_stats() and gc.callbacks.

  • gh-139653: Only raise a RecursionError or trigger a fatal error if the stack pointer is both below the limit pointer and above the stack base. If outside of these bounds assume that it is OK. This prevents false positives when user-space threads swap stacks.

  • gh-41779: Allowed defining the __dict__ and __weakref__ __slots__ for any class.

  • gh-139103: Improve multithreaded scaling of dataclasses on the free-threaded build.

  • gh-141589: Change backoff counter to use prime numbers instead of powers of 2. Use only 3 bits for counter and 13 bits for value. This allows to support values up to 8191. Patch by Mikhail Efimov.

  • gh-137007: Fix a bug during JIT compilation failure which caused garbage collection debug assertions to fail.

  • gh-132657: For the free-threaded build, avoid locking the set object for the __contains__ method.

  • gh-134584: Eliminate redundant refcounting from _CALL_STR_1.

  • gh-134584: Eliminate redundant refcounting from _CALL_BUILTIN_O.

  • gh-134584: Eliminate redundant refcounting from _CALL_TUPLE_1. Patch by Noam Cohen

C API

Build

  • gh-131372: Add LDVERSION and EXE to the base_interpreter value of build-details.json.

  • gh-142454: When calculating the digest of the JIT stencils input, sort the hashed files by filenames before adding their content to the hasher. This ensures deterministic hash input and hence deterministic hash, independent on filesystem order.

  • gh-131372: build-details.py will only be installed as part of the main install (make install). make altinstall will no longer include it.

  • gh-142234: Allow --enable-wasm-dynamic-linking for WASI. While CPython doesn’t directly support it so external/downstream users do not have to patch in support for the flag.

  • gh-142050: Fixed a bug where JIT stencils produced on Windows contained debug data. Patch by Chris Eibl.

  • gh-141808: Do not generate the jit stencils twice in case of PGO builds on Windows.

  • gh-141926: RUNSHARED is no longer cleared when cross-compiling. Previously, RUNSHARED was cleared when cross-compiling, which breaks PGO when using --enabled-shared on systems where the cross-compiled CPython is otherwise executable (e.g., via transparent emulation).

  • gh-141808: When running make clean-retain-profile, keep the generated JIT stencils. That way, the stencils are not generated twice when Profile-guided optimization (PGO) is used. It also allows distributors to supply their own pre-built JIT stencils.

  • gh-141784: Fix _remote_debugging_module.c compilation on 32-bit Linux. Include Python.h before system headers to make sure that _remote_debugging_module.c uses the same types (ABI) than Python. Patch by Victor Stinner.

  • gh-141172: Update to WASI SDK 29.

  • gh-139707: Add configure option --with-missing-stdlib-config=FILE allows which distributors to pass a JSON configuration file containing custom error messages for missing standard library modules.

  • gh-108819: Honor --with-platlibdir in the pure-Python standard library installation path, if PLATLIBDIR doesn’t match the value used in LIBDIR.

Python 3.15.0 alpha 2

Release date: 2025-11-18

Windows

  • gh-140849: Update bundled liblzma to version 5.8.1.

Tools/Demos

  • gh-141442: The iOS testbed now correctly handles test arguments that contain spaces.

  • gh-140702: The iOS testbed app will now expose the GITHUB_ACTIONS environment variable to iOS apps being tested.

  • gh-139198: Remove Tools/scripts/checkpip.py script.

  • gh-139188: Remove Tools/tz/zdump.py script.

Tests

  • gh-140482: Preserve and restore the state of stty echo as part of the test environment.

  • gh-140082: Update python -m test to set FORCE_COLOR=1 when being run with color enabled so that unittest which is run by it with redirected output will output in color.

  • gh-136442: Use exitcode 1 instead of 5 if unittest.TestCase.setUpClass() raises an exception

Security

Library

Core and Builtins

  • gh-141579: Fix sys.activate_stack_trampoline() to properly support the perf_jit backend. Patch by Pablo Galindo.

  • gh-114203: Skip locking if object is already locked by two-mutex critical section.

  • gh-141528: Suggest using concurrent.interpreters.Interpreter.close() instead of the private _interpreters.destroy function when warning about remaining subinterpreters. Patch by Sergey Miryanov.

  • gh-141367: Specialize CALL_LIST_APPEND instruction only for lists, not for list subclasses, to avoid unnecessary deopt. Patch by Mikhail Efimov.

  • gh-141312: Fix the assertion failure in the __setstate__ method of the range iterator when a non-integer argument is passed. Patch by Sergey Miryanov.

  • gh-140643: Add support for <GC> and <native> frames to profiling.sampling output to denote active garbage collection and calls to native code.

Library

  • gh-140942: Add .cjs to mimetypes to give CommonJS modules a MIME type of application/node.

Core and Builtins

Library

  • gh-140260: Fix struct data race in endian table initialization with subinterpreters. Patch by Shamil Abdulaev.

Core and Builtins

  • gh-140530: Fix a reference leak when raise exc from cause fails. Patch by Bénédikt Tran.

Library

Core and Builtins

  • gh-140373: Correctly emit PY_UNWIND event when generator object is closed. Patch by Mikhail Efimov.

  • gh-140729: Fix pickling error in the sampling profiler when using concurrent.futures.ProcessPoolExecutor script can not be properly pickled and executed in worker processes.

  • gh-131527: Dynamic borrow checking for stackrefs is added to Py_STACKREF_DEBUG mode. Patch by Mikhail Efimov.

  • gh-140576: Fixed crash in tokenize.generate_tokens() in case of specific incorrect input. Patch by Mikhail Efimov.

  • gh-140544: Speed up accessing interpreter state by caching it in a thread local variable. Patch by Kumar Aditya.

  • gh-140551: Fixed crash in dict if dict.clear() is called at the lookup stage. Patch by Mikhail Efimov and Inada Naoki.

  • gh-140517: Fixed a reference leak when iterating over the result of map() with strict=True when the input iterables have different lengths. Patch by Mikhail Efimov.

  • gh-133467: Fix race when updating type.__bases__ that could allow a read of type.__base__ to observe an inconsistent value on the free threaded build.

  • gh-140471: Fix potential buffer overflow in ast.AST node initialization when encountering malformed _fields containing non-str.

Library

  • gh-140443: The logarithm functions (such as math.log10() and math.log()) may now produce slightly different results for extremely large integers that cannot be converted to floats without overflow. These results are generally more accurate, with reduced worst-case error and a tighter overall error distribution.

Core and Builtins

Library

Core and Builtins

  • gh-140406: Fix memory leak when an object’s __hash__() method returns an object that isn’t an int.

  • gh-140358: Restore elapsed time and unreachable object count in GC debug output. These were inadvertently removed during a refactor of gc.c. The debug log now again reports elapsed collection time and the number of unreachable objects. Contributed by Pål Grønås Drange.

  • gh-136895: Update JIT compilation to use LLVM 20 at build time.

  • gh-139109: A new tracing frontend for the JIT compiler has been implemented. Patch by Ken Jin. Design for CPython by Ken Jin, Mark Shannon and Brandt Bucher.

  • gh-140306: Fix memory leaks in cross-interpreter channel operations and shared namespace handling.

  • gh-116738: Make _suggestions module thread-safe on the free threaded build.

  • gh-140301: Fix memory leak of PyConfig in subinterpreters.

  • gh-140257: Fix data race between interpreter_clear() and take_gil() on eval_breaker during finalization with daemon threads.

  • gh-139951: Fixes a regression in GC performance for a growing heap composed mostly of small tuples.

    • Counts number of actually tracked objects, instead of trackable objects. This ensures that untracking tuples has the desired effect of reducing GC overhead.

    • Does not track most untrackable tuples during creation. This prevents large numbers of small tuples causing excessive GCs.

  • gh-140253: Wrong placement of a double-star pattern inside a mapping pattern now throws a specialized syntax error. Contributed by Bartosz Sławecki in gh-140253.

  • gh-140104: Fix a bug with exception handling in the JIT. Patch by Ken Jin. Bug reported by Daniel Diniz.

  • gh-140149: Speed up parsing bytes literals concatenation by using PyBytesWriter API and a single memory allocation (about 3x faster).

  • gh-140061: Fixing the checking of whether an object is uniquely referenced to ensure free-threaded compatibility. Patch by Sergey Miryanov.

  • gh-140080: Fix hang during finalization when attempting to call atexit handlers under no memory.

  • gh-139871: Update bytearray to use a bytes under the hood as its buffer and add bytearray.take_bytes() to take it out.

  • gh-140067: Fix memory leak in sub-interpreter creation.

  • gh-139914: Restore support for HP PA-RISC, which has an upwards-growing stack.

  • gh-139817: Attribute __qualname__ is added to typing.TypeAliasType. Patch by Mikhail Efimov.

  • gh-135801: Many functions related to compiling or parsing Python code, such as compile(), ast.parse(), symtable.symtable(), and importlib.abc.InspectLoader.source_to_code() now allow to specify the module name. It is needed to unambiguous filter syntax warnings by module name.

  • gh-139640: ast.parse() no longer emits syntax warnings for return/break/continue in finally (see PEP 765) – they are only emitted during compilation.

  • gh-139640: Fix swallowing some syntax warnings in different modules if they accidentally have the same message and are emitted from the same line. Fix duplicated warnings in the finally block.

  • gh-139475: Changes in stackref debugging mode when Py_STACKREF_DEBUG is set. We use the same pattern of refcounting for stackrefs as in production build.

  • gh-139269: Fix undefined behavior when using unaligned store in JIT’s patch_* functions.

  • gh-138944: Fix SyntaxError message when invalid syntax appears on the same line as a valid import ... as ... or from ... import ... as ... statement. Patch by Brian Schubert.

  • gh-138857: Improve SyntaxError message for case keyword placed outside match body.

  • gh-131253: Support the --enable-pystats build option for the free-threaded build.

  • gh-136327: Errors when calling functions with invalid values after * and ** now do not include the function name. Patch by Ilia Solin.

  • gh-134786: If Py_TPFLAGS_MANAGED_DICT and Py_TPFLAGS_MANAGED_WEAKREF are used, then Py_TPFLAGS_HAVE_GC must be used as well.

C API

Build

  • gh-140454: When building the JIT, match the jit_stencils filename expectations in Makefile with the generator script. This avoid needless JIT recompilation during make install.

  • gh-140768: Warn when the WASI SDK version doesn’t match what’s supported.

  • gh-140513: Generate a clear compilation error when _Py_TAIL_CALL_INTERP is enabled but either preserve_none or musttail is not supported.

  • gh-140475: Support WASI SDK 25.

  • gh-140239: Check statx availability only on Linux (including Android).

  • gh-140189: iOS builds were added to CI.

  • gh-137618: PYTHON_FOR_REGEN now requires Python 3.10 to Python 3.15. Patch by Adam Turner.

Python 3.15.0 alpha 1

Release date: 2025-10-14

macOS

  • gh-115119: Update macOS installer to use libmpdecimal 4.0.1.

  • gh-124111: Update macOS installer to use Tcl/Tk 9.0.2.

  • gh-132339: Update macOS installer version of OpenSSL to 3.5.4.

  • gh-137450: macOS installer shell path management improvements: separate the installer Shell profile updater postinstall script from the Update Shell Profile.command to enable more robust error handling.

  • gh-137134: Update macOS installer to ship with SQLite version 3.50.4.

Windows

  • gh-139810: Installing with py install 3[.x]-dev will now select final versions as well as prereleases.

  • gh-139573: Updated bundled version of OpenSSL to 3.0.18.

  • gh-138896: Fix error installing C runtime on non-updated Windows machines

  • gh-138314: Add winreg.DeleteTree().

  • gh-137136: Suppress build warnings when build on Windows with --experimental-jit-interpreter.

  • gh-137134: Update Windows installer to ship with SQLite 3.50.4.

  • gh-135099: Fix a crash that could occur on Windows when a background thread waits on a PyMutex while the main thread is shutting down the interpreter.

  • gh-130727: Fix a race in internal calls into WMI that can result in an “invalid handle” exception under high load. Patch by Chris Eibl.

  • gh-76023: Make os.path.realpath() ignore Windows error 1005 when in non-strict mode.

  • gh-133779: Reverts the change to generate different pyconfig.h files based on compiler settings, as it was frequently causing extension builds to break. In particular, the Py_GIL_DISABLED preprocessor variable must now always be defined explicitly when compiling for the experimental free-threaded runtime. The sysconfig.get_config_var() function can be used to determine whether the current runtime was compiled with that flag or not.

  • gh-133626: Ensures packages are not accidentally bundled into the traditional installer.

  • gh-133580: Fix sys.getwindowsversion() failing without setting an exception when called on some WinAPI partitions.

  • gh-133572: Avoid LsaNtStatus to WinError conversion on unsupported WinAPI partitions.

  • gh-133568: Fix compile error when using a WinAPI partition that doesn’t support the RPC runtime library.

  • gh-133562: Disable handling of security descriptors by os.mkdir() with mode 0o700 on WinAPI partitions that do not support it. This only affects custom builds for specialized targets.

  • gh-133537: Avoid using console I/O in WinAPI partitions that don’t support it

  • gh-131942: Use the Python-specific Py_DEBUG macro rather than _DEBUG in Windows-related C code. Patch by Xuehai Pan.

Tools/Demos

  • gh-139330: SBOM generation tool didn’t cross-check the version and checksum values against the Modules/expat/refresh.sh script, leading to the values becoming out-of-date during routine updates.

  • gh-132006: XCframeworks now include privacy manifests to satisfy Apple App Store submission requirements.

  • gh-138171: A script for building an iOS XCframework was added. As part of this change, the top level iOS folder has been moved to be a subdirectory of the Apple folder.

  • gh-137873: The iOS test runner has been simplified, resolving some issues that have been observed using the runner in GitHub Actions and Azure Pipelines test environments.

  • gh-137484: Have Tools/wasm/wasi put the build Python into a directory named after the build triple instead of “build”.

  • gh-137025: The wasm_build.py script has been removed. Tools/wasm/emscripten and Tools/wasm/wasi should be used instead, as described in the Dev Guide.

  • gh-137248: Add a --logdir option to Tools/wasm/wasi for specifying where to write log files.

  • gh-137243: Have Tools/wasm/wasi detect a WASI SDK install in /opt when it was directly extracted from a release tarball.

  • gh-136251: Fixes and usability improvements for Tools/wasm/emscripten/web_example

  • gh-135968: Stubs for strip are now provided as part of an iOS install.

  • gh-135379: The cases generator no longer accepts type annotations on stack items. Conversions to non-default types are now done explicitly in bytecodes.c and optimizer_bytecodes.c. This will simplify code generation for top-of-stack caching and other future features.

  • gh-134215: REPL import autocomplete only suggests private modules when explicitly specified.

Tests

  • gh-139208: Fix regrtest --fast-ci --verbose: don’t ignore the --verbose option anymore. Patch by Victor Stinner.

  • gh-138313: Restore skipped test and add janky workaround to prevent select buildbots from failing with a ResourceWarning.

  • gh-135966: The iOS testbed now handles the app_packages folder as a site directory.

  • gh-135494: Fix regrtest to support excluding tests from --pgo tests. Patch by Victor Stinner.

  • gh-132815: Fix test__opcode: add JUMP_BACKWARD to specialization stats.

  • gh-135489: Show verbose output for failing tests during PGO profiling step with –enable-optimizations.

  • gh-135401: Add a new GitHub CI job to test the ssl module with AWS-LC as the backing cryptography and TLS library.

  • gh-135120: Add test.support.subTests().

  • gh-134567: Expose log formatter to users in TestCase.assertLogs. unittest.TestCase.assertLogs() will now optionally accept a formatter that will be used to format the strings in output if provided.

  • gh-133744: Fix multiprocessing interrupt test. Add an event to synchronize the parent process with the child process: wait until the child process starts sleeping. Patch by Victor Stinner.

  • gh-133682: Fixed test case test.test_annotationlib.TestStringFormat.test_displays which ensures proper handling of complex data structures (lists, sets, dictionaries, and tuples) in string annotations.

  • gh-133639: Fix TestPyReplAutoindent.test_auto_indent_default() doesn’t run input_code.

Security

  • gh-139700: Check consistency of the zip64 end of central directory record. Support records with “zip64 extensible data” if there are no bytes prepended to the ZIP file.

  • gh-139400: xml.parsers.expat: Make sure that parent Expat parsers are only garbage-collected once they are no longer referenced by subparsers created by ExternalEntityParserCreate(). Patch by Sebastian Pipping.

  • gh-139283: sqlite3: correctly handle maximum number of rows to fetch in Cursor.fetchmany and reject negative values for Cursor.arraysize. Patch by Bénédikt Tran.

  • gh-136053: marshal: fix a possible crash when deserializing slice objects.

  • gh-135661: Fix parsing start and end tags in html.parser.HTMLParser according to the HTML5 standard.

    • Whitespaces no longer accepted between </ and the tag name. E.g. </ script> does not end the script section.

    • Vertical tabulation (\v) and non-ASCII whitespaces no longer recognized as whitespaces. The only whitespaces are \t\n\r\f and space.

    • Null character (U+0000) no longer ends the tag name.

    • Attributes and slashes after the tag name in end tags are now ignored, instead of terminating after the first > in quoted attribute value. E.g. </script/foo=">"/>.

    • Multiple slashes and whitespaces between the last attribute and closing > are now ignored in both start and end tags. E.g. <a foo=bar/ //>.

    • Multiple = between attribute name and value are no longer collapsed. E.g. <a foo==bar> produces attribute “foo” with value “=bar”.

  • gh-135661: Fix CDATA section parsing in html.parser.HTMLParser according to the HTML5 standard: ] ]> and ]] > no longer end the CDATA section. Add private method _set_support_cdata() which can be used to specify how to parse <[CDATA[ — as a CDATA section in foreign content (SVG or MathML) or as a bogus comment in the HTML namespace.

  • gh-102555: Fix comment parsing in html.parser.HTMLParser according to the HTML5 standard. --!> now ends the comment. -- > no longer ends the comment. Support abnormally ended empty comments <--> and <--->.

  • gh-135462: Fix quadratic complexity in processing specially crafted input in html.parser.HTMLParser. End-of-file errors are now handled according to the HTML5 specs – comments and declarations are automatically closed, tags are ignored.

  • gh-118350: Fix support of escapable raw text mode (elements “textarea” and “title”) in html.parser.HTMLParser.

  • gh-135034: Fixes multiple issues that allowed tarfile extraction filters (filter="data" and filter="tar") to be bypassed using crafted symlinks and hard links.

    Addresses CVE 2024-12718, CVE 2025-4138, CVE 2025-4330, and CVE 2025-4517.

  • gh-133767: Fix use-after-free in the “unicode-escape” decoder with a non-“strict” error handler.

  • gh-133623: Indicate through ssl.HAS_PSK_TLS13 whether the ssl module supports “External PSKs” in TLSv1.3, as described in RFC 9258. Patch by Will Childs-Klein.

  • gh-128840: Short-circuit the processing of long IPv6 addresses early in ipaddress to prevent excessive memory consumption and a minor denial-of-service.

Library

IDLE

  • gh-96491: Deduplicate version number in IDLE shell title bar after saving to a file.

  • gh-139742: Colorize t-string prefixes for template strings in IDLE, as done for f-string prefixes.

Documentation

  • gh-136155: We are now checking for fatal errors in EPUB builds in CI.

  • gh-135171: Document that the iterator for the leftmost for clause in the generator expression is created immediately.

  • bpo-45210: Document that error indicator may be set in tp_dealloc, and how to avoid clobbering it.

Core and Builtins

  • gh-140000: Fix potential memory leak when a reference cycle exists between an instance of typing.TypeAliasType, typing.TypeVar, typing.ParamSpec, or typing.TypeVarTuple and its __name__ attribute. Patch by Mikhail Efimov.

  • gh-140009: Improve performance of list extension by dictionary items.

  • gh-139988: Fix a memory leak when failing to create a Union type. Patch by Bénédikt Tran.

  • gh-139748: Fix reference leaks in error branches of functions accepting path strings or bytes such as compile() and os.system(). Patch by Bénédikt Tran.

  • gh-139516: Fix lambda colon erroneously start format spec in f-string in tokenizer.

  • gh-63161: Support non-UTF-8 shebang and comments in Python source files if non-UTF-8 encoding is specified. Detect decoding error in comments for default (UTF-8) encoding. Show the line and position of decoding error for default encoding in a traceback. Show the line containing the coding cookie when it conflicts with the BOM in a traceback.

  • gh-139116: Prevent a deadlock when multiple threads start, stop and use tracemalloc simultaneously.

  • gh-139275: Fix compilation problems in _remote_debugging_module.c when the system doesn’t have process_vm_readv. Patch by Pablo Galindo

  • gh-133059: Increased the number of cached small positive integers from 256 to 1024.

  • gh-74857: PEP 538: Coerce the POSIX locale to a UTF-8 based locale. Patch by Victor Stinner.

Library

Core and Builtins

Library

Core and Builtins

  • gh-138372: Fix SyntaxWarning emitted for erroneous subscript expressions involving template string literals. Patch by Brian Schubert.

  • gh-138302: BINARY_OP now specializes to BINARY_OP_ADD_INT, BINARY_OP_SUBTRACT_INT or BINARY_OP_MULTIPLY_INT if operands are compact ints.

  • gh-138318: The default REPL now avoids highlighting built-in names (for instance set or format()) when they are used as attribute names (for instance in value.set or text.format).

  • gh-138349: Fix crash in certain cases where a module contains both a module-level annotation and a comprehension.

  • gh-69605: Fix some standard library submodules missing from the REPL auto-completion of imports.

  • gh-61206: zipimport now supports zstandard compressed zip file entries.

Library

Core and Builtins

  • gh-137838: Fix JIT trace buffer overrun by increasing possible exit stubs. Patch by Donghee Na.

  • gh-71679: Use the same quoting algorithm for the repr of bytearrays as for bytes objects and strings – use double quotes for quoting if the bytearray contains single quotes and does not contain double quotes.

  • gh-137384: Fix a crash when using the warnings module in a finalizer at shutdown. Patch by Kumar Aditya.

Library

  • gh-138004: On Solaris/Illumos platforms, thread names are now encoded as ASCII to avoid errors on systems (e.g. OpenIndiana) that don’t support non-ASCII names.

  • gh-137976: Removed localtime from the list of reported system timezones.

Core and Builtins

  • gh-137992: Ensure that PyRefTracer_SetTracer() sync with all existing threads when called to avoid races in the free threaded build. Patch by Pablo Galindo

  • gh-137967: Show error suggestions on nested attribute access. Patch by Pablo Galindo

  • gh-137959: Replace the shim code added to every piece of jitted code with a single trampoline function.

  • gh-137883: Fix runaway recursion when calling a function with keyword arguments.

  • gh-137079: Fix keyword typo recognition when parsing files. Patch by Pablo Galindo.

  • gh-137728: Fix the JIT’s handling of many local variables. This previously caused a segfault.

  • gh-137716: Fix double period in AttributeError message for invalid mock assertions

  • gh-137433: Fix a potential deadlock in the free threading build when daemon threads enable or disable profiling or tracing while the main thread is shutting down the interpreter.

  • gh-137576: Fix for incorrect source code being shown in tracebacks from the Basic REPL when PYTHONSTARTUP is given. Patch by Adam Hartz.

  • gh-37817: Allow assignment to __bases__ of direct subclasses of builtin classes.

  • gh-132732: Optimize _COMPARE_OP, _CONTAINS_OP, _UNARY_NEGATIVE, _UNARY_NOT, and _UNARY_INVERT in JIT builds with constant-loading uops (_POP_TWO_LOAD_CONST_INLINE_BORROW and _POP_TOP_LOAD_CONST_INLINE_BORROW), and then remove both to reduce instruction count.

  • gh-137400: Fix a crash in the free threading build when disabling profiling or tracing across all threads with PyEval_SetProfileAllThreads() or PyEval_SetTraceAllThreads() or their Python equivalents threading.settrace_all_threads() and threading.setprofile_all_threads().

  • gh-133143: Add sys.abi_info object to make ABI information more easily accessible.

  • gh-137400: Fix a crash in the free threading build when disabling profiling or tracing across all threads with PyEval_SetProfileAllThreads() or PyEval_SetTraceAllThreads() or their Python equivalents threading.settrace_all_threads() and threading.setprofile_all_threads().

  • gh-120037: Disable user site packages directory when a ._pth file is used, even if it contains import site.

  • gh-58124: Fix name of the Python encoding in Unicode errors of the code page codec: use “cp65000” and “cp65001” instead of “CP_UTF7” and “CP_UTF8” which are not valid Python code names. Patch by Victor Stinner.

  • gh-136966: The object.__dict__ and __weakref__ descriptors now use a single descriptor instance per interpreter, shared across all types that need them. This speeds up class creation, and helps avoid reference cycles.

  • gh-137314: Fixed a regression where raw f-strings incorrectly interpreted escape sequences in format specifications. Raw f-strings now properly preserve literal backslashes in format specs, matching the behavior from Python 3.11. For example, rf"{obj:\xFF}" now correctly produces '\\xFF' instead of 'ÿ'. Patch by Pablo Galindo.

  • gh-137308: A standalone docstring in a node body is optimized as a pass statement to ensure that the node’s body is never empty. There was a ValueError in compile() otherwise.

  • gh-137288: Fix bug where some bytecode instructions of a boolean expression are not associated with the correct exception handler.

  • gh-137291: The perf profiler can now be used if a previous frame evaluation API has been provided.

  • gh-134291: Remove some newer macOS API usage from the JIT compiler in order to restore compatibility with older OSX 10.15 deployment targets.

  • gh-88886: The codecs lookup function now again performs only minimal normalization of the encoding name before passing it to the search functions: all ASCII letters are converted to lower case, spaces are replaced with hyphens. This restores the pre-Python 3.9 behavior.

  • gh-131338: Disable computed stack limit checks on non-glibc linux platforms to fix crashes on deep recursion.

  • gh-136870: Fix data races while de-instrumenting bytecode of code objects running concurrently in threads.

  • gh-132732: Optimize constant comparison for _COMPARE_OP_INT, _COMPARE_OP_FLOAT and _COMPARE_OP_STR in JIT builds

  • gh-127598: Improve ModuleNotFoundError by adding flavour text to the exception when the -S option is passed. Patch by Andrea Mattei.

  • gh-136801: Fix PyREPL syntax highlighting on match cases after multi-line case. Contributed by Olga Matoula.

  • gh-74185: The __repr__() of ImportError and ModuleNotFoundError now shows “name” and “path” as name=<name> and path=<path> if they were given as keyword arguments at construction time. Patch by Serhiy Storchaka, Oleg Iarygin, and Yoav Nir

Library

Core and Builtins

Library

Core and Builtins

  • gh-136541: Fix some issues with the perf trampolines on x86-64 and aarch64. The trampolines were not being generated correctly for some cases, which could lead to the perf integration not working correctly. Patch by Pablo Galindo.

Library

Core and Builtins

  • gh-136517: Fixed a typo that prevented printing of uncollectable objects when the gc.DEBUG_UNCOLLECTABLE mode was set.

  • gh-136525: Fix issue where per-thread bytecode was not instrumented for newly created threads.

  • gh-132657: Improve performance of frozenset by removing locks in the free-threading build.

  • gh-136459: Add support for perf trampoline on macOS, to allow profilers wit JIT map support to read Python calls. While profiling, PYTHONPERFSUPPORT=1 can be appended to enable the trampoline.

  • gh-132661: Interpolation.expression now has a default, the empty string.

  • gh-132661: Reflect recent PEP 750 change.

    Disallow concatenation of string.templatelib.Template and str. Also, disallow implicit concatenation of t-string literals with string or f-string literals.

  • gh-91636: While performing garbage collection, clear weakrefs to unreachable objects that are created during running of finalizers. If those weakrefs were are not cleared, they could reveal unreachable objects.

  • gh-136355: Deprecate -b and -bb command line options and schedule them to become no-op in Python 3.17.

  • gh-109700: Fix memory error handling in PyDict_SetDefault().

  • gh-135552: Fix a bug caused by the garbage collector clearing weakrefs too early. The weakrefs in the tp_subclasses dictionary are needed in order to correctly invalidate type caches (for example, by calling PyType_Modified()). Clearing weakrefs before calling finalizers causes the caches to not be correctly invalidated. That can cause crashes since the caches can refer to invalid objects. Defer the clearing of weakrefs without callbacks until after finalizers are executed.

  • gh-136203: Improve TypeError error message, when richcomparing two types.MappingProxyType objects.

  • gh-136003: Fix threading.Thread objects becoming incorrectly daemon when created from an atexit callback or a pending call (Py_AddPendingCall()).

  • gh-78465: Fix error message for cls.__new__(cls, ...) where cls is not instantiable builtin or extension type (with tp_new set to NULL).

  • gh-135904: Perform more aggressive control-flow optimizations on the machine code templates emitted by the experimental JIT compiler.

  • gh-129958: Differentiate between t-strings and f-strings in syntax error for newlines in format specifiers of single-quoted interpolated strings.

  • gh-135871: Non-blocking mutex lock attempts now return immediately when the lock is busy instead of briefly spinning in the free threading build.

  • gh-134584: Specialize POP_TOP in the JIT compiler by specializing for reference lifetime and type. This will also enable easier top of stack caching in the JIT compiler.

  • gh-135106: Restrict the trashcan mechanism to GC’ed objects and untrack them while in the trashcan to prevent the GC and trashcan mechanisms conflicting.

  • gh-135379: Changes specialization of BINARY_OP for ints to only specialize for “compact” ints. This streamlines the fast path at the cost of fewer specializations when very large integers are used.

  • gh-135607: Fix potential weakref races in an object’s destructor on the free threaded build.

  • gh-135608: Fix a crash in the JIT involving attributes of modules.

  • gh-82088: Improve performance of PyLongObject conversion functions PyLong_AsLongAndOverflow(), PyLong_AsSsize_t(), PyLong_AsUnsignedLong(), PyLong_AsSize_t(), PyLong_AsUnsignedLongMask(), PyLong_AsUnsignedLongLongMask(), PyLong_AsLongLongAndOverflow() for integers larger than 2**30 up to 30%.

  • gh-135551: Sorting randomly ordered lists will often run a bit faster, thanks to a new scheme for picking minimum run lengths from Stefan Pochmann, which arranges for the merge tree to be as evenly balanced as is possible.

  • gh-135543: Emit sys.remote_exec audit event when sys.remote_exec() is called and migrate remote_debugger_script to cpython.remote_debugger_script.

  • gh-135496: Fix typo in the f-string conversion type error (“exclamanation” -> “exclamation”).

  • gh-135474: Specialize integer operations only on compact integers. This is a CPython internal change.

  • gh-135371: Fixed asyncio debugging tools to properly display internal coroutine call stacks alongside external task dependencies. The python -m asyncio ps and python -m asyncio pstree commands now show complete execution context. Patch by Pablo Galindo.

  • gh-135422: Fix regression in SyntaxError messages after gh-134036.

Library

  • gh-116738: Make functions in grp thread-safe on the free threaded build.

  • gh-127319: Set the allow_reuse_port class variable to False on the XMLRPC, logging, and HTTP servers. This matches the behavior in prior Python releases, which is to not allow port reuse.

Core and Builtins

  • gh-130077: Properly raise custom syntax errors when incorrect syntax containing names that are prefixes of soft keywords is encountered. Patch by Pablo Galindo.

  • gh-131798: Optimize _CALL_LEN in the JIT when the length is known. Patch by Tomas Roun

  • gh-131798: Optimize _UNARY_NEGATIVE in JIT-compiled code.

  • gh-135148: Fixed a bug where f-string debug expressions (using =) would incorrectly strip out parts of strings containing escaped quotes and # characters. Patch by Pablo Galindo.

  • gh-131798: Optimize _UNARY_INVERT in JIT-compiled code.

  • gh-131798: Optimize away _CALL_TYPE_1 in the JIT when the return type is known. Patch by Tomas Roun

  • gh-133136: Limit excess memory usage in the free threading build when a large dictionary or list is resized and accessed by multiple threads.

  • gh-131798: Optimize _CHECK_METHOD_VERSION into _CHECK_FUNCTION_VERSION_INLINE in JIT-compiled code.

Library

Core and Builtins

  • gh-134280: Disable constant folding for ~ with a boolean argument. This moves the deprecation warning from compile time to runtime.

  • gh-134876: Add support to PEP 768 remote debugging for Linux kernels which don’t have CONFIG_CROSS_MEMORY_ATTACH configured.

  • gh-134889: Fix handling of a few opcodes that leave operands on the stack when optimizing LOAD_FAST.

Library

Core and Builtins

  • gh-117852: Fix argument checking of athrow().

  • gh-132617: Fix dict.update() modification check that could incorrectly raise a “dict mutated during update” error when a different dictionary was modified that happens to share the same underlying keys object.

  • gh-131798: Allow the JIT to remove unnecessary _ITER_CHECK_TUPLE ops.

  • gh-134679: Fix crash in the free threading build’s QSBR code that could occur when changing an object’s __dict__ attribute.

  • gh-133912: Fix the C API function PyObject_GenericSetDict to handle extension classes with inline values.

  • gh-131798: Make the JIT optimizer understand that slicing a string/list/tuple returns the same type.

  • gh-134584: Add a reference count elimination pass to the JIT compiler. Patch by Ken Jin.

  • gh-131798: Optimize _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW.

Library

Core and Builtins

  • gh-127960: PyREPL interactive shell no longer starts with __package__ and __file__ global names set to _pyrepl package internals. Contributed by Yuichiro Tachibana.

  • gh-130397: Remove special-casing for C stack depth limits for WASI. Due to WebAssembly’s built-in stack protection this does not pose a security concern.

  • gh-131798: JIT: replace _LOAD_SMALL_INT with _LOAD_CONST_INLINE_BORROW

  • gh-131798: Improve the JIT’s ability to optimize away cached class attribute and method loads.

  • gh-128066: Fixes an edge case where PyREPL improperly threw an error when Python is invoked on a read only filesystem while trying to write history file entries.

  • gh-131798: Improve the JIT’s ability to narrow unknown classes to constant values.

  • gh-134268: Add _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW and use it to further optimize CALL_ISINSTANCE.

  • gh-131798: Split CALL_LIST_APPEND into several uops. Patch by Diego Russo.

  • gh-69605: When auto-completing an import in the REPL, finding no candidates now issues no suggestion, rather than suggestions from the current namespace.

  • gh-134170: Add colorization to sys.unraisablehook() by default.

  • gh-91153: Fix a crash when a bytearray is concurrently mutated during item assignment.

  • gh-134158: Fix coloring of double braces in f-strings and t-strings in the REPL.

  • gh-134119: Fix crash when calling next() on an exhausted template string iterator. Patch by Jelle Zijlstra.

  • gh-134100: Fix a use-after-free bug that occurs when an imported module isn’t in sys.modules after its initial import. Patch by Nico-Posada.

  • gh-134036: Improve SyntaxError message when using invalid raise statements.

  • gh-133999: Fix SyntaxError regression in except parsing after gh-123440.

  • gh-133886: Fix sys.remote_exec() for non-ASCII paths in non-UTF-8 locales and non-UTF-8 paths in UTF-8 locales.

  • gh-133400: Fixed Ctrl+D (^D) behavior in _pyrepl module to match old pre-3.13 REPL behavior.

  • gh-133703: Fix hashtable in dict can be bigger than intended in some situations.

  • gh-133778: Fix bug where assigning to the __annotations__ attributes of classes defined under from __future__ import annotations had no effect.

  • gh-133711: Implement PEP 686: Enable Python UTF-8 Mode by default. Patch by Adam Turner.

  • gh-132762: fromkeys() no longer loops forever when adding a small set of keys to a large base dict. Patch by Angela Liss.

  • gh-133541: Inconsistent indentation in user input crashed the new REPL when syntax highlighting was active. This is now fixed.

  • gh-133516: Raise ValueError when constants True, False or None are used as an identifier after NFKC normalization.

  • gh-131798: Allow the JIT to remove int guards after _GET_LEN by setting the return type to int.

  • gh-131798: Split CALL_ISINSTANCE into several uops, allowing the JIT to remove some of them.

  • gh-132554: Change iteration to use “virtual iterators” for sequences. Instead of creating an iterator, a tagged integer representing the next index is pushed to the stack above the iterable. For non-sequence iterators, NULL is pushed.

  • gh-130821: Enhance wrong type error messages and make them more consistent. Patch by Semyon Moroz.

  • gh-131798: Narrow the return type and constant-evaluate CALL_ISINSTANCE for a subset of known values in the JIT. Patch by Tomas Roun

  • gh-132542: Update Thread.native_id after fork(2) to ensure accuracy. Patch by Noam Cohen.

Library

  • gh-132732: Automatically constant evaluate bytecode operations marked as pure in the JIT optimizer.

Core and Builtins

  • gh-127971: Fix off-by-one read beyond the end of a string in string search.

  • gh-132042: Improve class creation times by up to 12% by pre-computing type slots just once. Patch by Sergey Miryanov.

  • gh-133379: Correct usage of arguments in error messages.

  • gh-127266: In the free-threaded build, avoid data races caused by updating type slots or type flags after the type was initially created. For those (typically rare) cases, use the stop-the-world mechanism. Remove the use of atomics when reading or writing type flags. The use of atomics is not sufficient to avoid races (since flags are sometimes read without a lock and without atomics) and are no longer required.

  • gh-130425: Add "Did you mean: 'attr'?" suggestion when using del obj.attr if attr does not exist.

  • gh-128640: Fix a crash when using threads inside of a subinterpreter.

Library

  • gh-116738: Make the module json safe to use under the free-threading build.

Core and Builtins

  • gh-119494: Exception text when trying to delete attributes of types was clarified.

C API