Changelog

Python next

Release date: XXXX-XX-XX

macOS

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

  • gh-152023: Update macOS installer builds to SQLite 3.53.3. Enable median() and percentile() functions.

  • gh-151163: Updated macOS installer to include SQLite version 3.53.2.

  • gh-150644: When system logging is enabled (with config.use_system_logger, messages are now tagged as public. This allows the macOS 26 system logger to view messages without special configuration.

Windows

  • gh-68048: Creating a mmap.mmap object on Windows no longer resets the position of the underlying file to zero, as on other platforms.

  • gh-69573: msvcrt.putch() and msvcrt.putwch() now check the return value of the underlying _putch() and _putwch() C functions and raise OSError on failure, for example when the process has no console attached, instead of silently ignoring the error.

  • gh-124111: Updated Windows builds to use Tcl/Tk 9.0.4.

  • gh-152433: Modernize fileutils removing GetFileInformationByHandle API calls and allow build for Universal Windows Platform.

  • gh-152433: ssl: improve UWP build compatibility.

  • gh-152433: _winapi: implement GetVersion() UWP alternative.

  • gh-152433: Restores the mmap module when CPython is built from source for specific Windows API sets.

  • gh-152433: Use the Windows API GetFileSizeEx() for memory mapped files, rather than the older GetFileSize().

  • gh-152433: Implement os.cpu_count() for Universal Windows Platform.

  • gh-151163: Updated Windows builds to include SQLite version 3.53.2.

  • gh-151159: Updated bundled version of OpenSSL to 3.5.7.

  • gh-150836: Make installed tkinter work with Tcl/Tk 9 builds that embed the Tk script library in the Tk DLL on Windows.

  • gh-149786: Fixes virtual environment launchers on Windows free-threaded builds.

  • gh-138489: Windows distributions now include a build-details.json file (see PEP 739). The legacy installer does not install it, but all other distributions from python.org and all preset configurations in the PC\layout script will include one.

  • gh-140146: Prevent tkinter from hanging on Windows if stdin is redirected to a pipe in an interactive session. This is helpful for testing interactive usage of tkinter from a script, for example as part of the cpython test suite.

  • gh-86768: os.lseek() and seek() of file objects now raise OSError for pipes on Windows, and seekable() now returns False for them. Previously seeking a pipe silently appeared to succeed. As a consequence, opening a pipe in a read-write binary mode ('r+b' or 'w+b') now raises io.UnsupportedOperation unless buffering is disabled.

  • bpo-40851: subprocess.Popen with shell=True on Windows now honors wShowWindow of the startupinfo argument, so the console window of the started program can be shown. Previously it was always hidden.

Tools/Demos

  • gh-64660: Argument Clinic return converters no longer need to hardcode the name of the variable returned by the parsing function. It is now available as data.parser_retval.

  • gh-155266: Fix Argument Clinic for a function whose only parameter is in an optional group. It generated METH_O, which made the argument mandatory and did not pass the flag of the group.

  • gh-155218: Fix Argument Clinic generating the flags of the optional groups in different order on 32-bit and 64-bit platforms.

  • gh-155212: The --converters option of Argument Clinic now accepts file names and can be used with --make. It prints the converters and return converters which the specified files define, instead of the built-in ones.

  • gh-155207: Argument Clinic now supports the --dry-run and --diff options. They list the files which would be changed, or write a unified diff of the changes to the standard output, without modifying any file.

  • gh-64502: Argument Clinic now supports several optional groups on the same nesting level, like in [y, x,] [n,] attr. Such groups can be omitted independently of each other.

  • gh-64502: Fix Argument Clinic support of parameters with a default value used together with optional groups. Such parameters were always required in the generated parsing code.

  • gh-154580: Fix python-gdb.py raising UnicodeEncodeError when pretty-printing a non-ASCII str in a locale whose host charset cannot encode it, such as any non-ASCII string in the C locale.

  • gh-154059: Fix the time units in Tachyon flame graph tooltips by accounting for the sampling interval when converting samples to milliseconds.

  • gh-152384: The CPython Pixi packages are now all accessible at the same Tools/pixi-packages subdirectory, rather than at Tools/pixi-packages/{variant} as before. Variants are now selected not via subdirectory but via flags; see https://pixi.prefix.dev/latest/concepts/package_specifications/#extras-and-flags for usage instructions. The tsan-freethreading variant has been renamed to tsan_freethreading, while the default, asan, and freethreading variants retain their previous names.

  • gh-150258: Update the tooltip on the Tachyon flame graph to show both absolute and relative percentages.

  • gh-111501: PS1 is no longer exported by venv activate script

Tests

  • gh-109817: Add the --single-process-per-case option to libregrtest to run every test case in a separate process. Test cases from the same test module are run sequentially. This helps to detect order dependencies and environment leaks between test cases.

  • gh-155411: Fix test.support.subTests() for asynchronous test methods. They were wrapped in a synchronous function, which discarded the coroutine without awaiting it, so the test silently did not run at all.

  • gh-155109: Add test.support.run_with_limited_c_stack() and use it in tests that exhaust the C stack with a fixed number of recursive calls, so that their outcome no longer depends on the C stack size.

  • gh-76595: Add C API tests for PyCapsule_Import().

  • gh-154211: Add test.support.skip_if_huge_c_stack() and use it to skip tests that exhaust the C stack if the stack limit is very large (e.g. on DragonFly BSD or with ulimit -s unlimited).

  • gh-154167: The test runner (regrtest) now restores the default SIGINT handler if it was inherited as ignored, so the test suite no longer hangs when run as a shell background job.

  • gh-154144: Fix building the _testcapi module on NetBSD.

  • gh-152548: Add the test.support.isolation.runInSubprocess() decorator to run a test method or TestCase subclass in a fresh interpreter subprocess, isolated from the rest of the test run.

  • gh-151626: Fix several tests in test.test_inspect, test.test_import, test.test_importlib, test.test_py_compile and test.test_compileall that failed when the test suite was run with PYTHONPYCACHEPREFIX set. These tests now neutralize the pycache prefix where they assume the default __pycache__ bytecode layout.

  • gh-151096: Fix test_embed failing when CPython is configured with a split exec prefix (--exec-prefix differing from --prefix).

  • gh-151130: Add more tests for PyWeakref_* C API.

  • gh-150966: Avoid prematurely terminating failing live sampling profiler test targets, which made stderr assertions flaky on ASAN buildbots.

  • gh-150387: Fix hang in test.test_profiling.test_sampling_profiler.test_live_collector_ui.TestLiveModeErrors.test_run_failed_script_live on slow buildbots. The test now always queues a final q keystroke so the live TUI loop exits even when the profiler collects enough samples to enter the post-finished input loop.

  • gh-150114: On Linux, regrtest now logs the total memory usage of all Python processes. Read the private memory in /proc/pid/smaps. Patch by Victor Stinner.

  • gh-149776: Fix test_socket on Linux kernel 7.1 and newer: skip UDP Lite tests if it’s not supported. Patch by Victor Stinner.

  • gh-148853: Fix tests failing on FreeBSD in test.support’s in_systemd_nspawn_sync_suppressed() due to unreadable /run directory.

Security

  • gh-155558: Update bundled libexpat to version 2.8.3 for the fix to CVE 2026-72522.

  • gh-153030: Fixed quadratic complexity in incremental parsing of long unterminated constructs (such as tags or comments) in html.parser.HTMLParser, which could be exploited for a denial of service.

  • gh-152674: The xml.etree.ElementTree.Element methods findall(), iterfind() and find() avoid quadratic behavior when using XPath index predicates ([1], [last()], [last()-N]) on XML documents with many same-tag siblings.

  • gh-152216: Update bundled libexpat to version 2.8.2.

  • gh-151987: The tarfile.TarFile.extract() method now applies the given filter when it extracts a link target from the archive as a fallback.

  • gh-151981: In tarfile, seeking a stream now stops when end of the stream is reached.

  • gh-151544: Modules/Setup.local is no longer used as a landmark to discover whether Python is running in a source tree, as it could potentially affect actual installs. The pybuilddir.txt file is now the sole indicator of running in a source tree.

  • gh-151558: Fixed an vulnerability in the tarfile data and tar extraction filters where crafted archives could create a symlink pointing outside the destination directory. This was a bypass of CVE 2025-4330.

  • gh-151159: Update macOS installer to use OpenSSL 3.5.7.

  • gh-151159: Update Android and iOS installers to use OpenSSL 3.5.7.

  • gh-150599: Fix a possible stack buffer overflow in bz2 when a bz2.BZ2Decompressor is reused after a decompression error. The decompressor now becomes unusable after libbz2 reports an error.

  • gh-150743: http.client now limits the number of chunked-response trailer lines it will read to max_response_headers (100 by default), and the number of interim (1xx) responses it will skip to 100. A malicious or broken server could previously stream trailer lines or 100 Continue responses forever, hanging the client even when a socket timeout was in use. Reported by @YLChen-007 via GHSA-w4q2-g22w-6fr4.

  • gh-149835: shutil.move() now resolves symlinks via os.path.realpath() when checking whether the destination is inside the source directory, preventing a symlink-based bypass of that guard.

  • gh-149698: Update bundled libexpat to version 2.8.1 for the fix for CVE 2026-45186.

  • gh-87451: The ftplib module’s undocumented ftpcp function no longer trusts the IPv4 address value returned from the source server in response to the PASV command by default, completing the fix for CVE-2021-4189. As with ftplib.FTP, the former behavior can be re-enabled by setting the trust_server_pasv_ipv4_address attribute on the source ftplib.FTP instance to True. Thanks to Qi Deng at Aurascape AI for the report.

  • gh-149474: Fix the binary writer in profiling.sampling not firing the audit (PEP 578) when creating the output file. The writer and the reader now accept any path-like object. Patch by Maurycy Pawłowski-Wieroński.

  • gh-149486: tarfile.data_filter() now validates link targets using the same normalised value that is written to disk, strips trailing separators from the member name when resolving a symlink’s directory, and rejects link members that would replace the destination directory itself. This closes several path-traversal bypasses of the data extraction filter.

  • gh-149079: Fix a potential denial of service in unicodedata.normalize(). The canonical ordering step of Unicode normalization used a quadratic-time insertion sort for reordering combining characters, which could be exploited with crafted input containing many combining characters in non-canonical order. Replaced with a linear-time counting sort for long runs.

  • gh-149018: Improved protection against XML hash-flooding attacks in xml.parsers.expat and xml.etree.ElementTree when Python is compiled with libExpat 2.8.0 or later.

  • gh-143927: Normalize all line endings (CR, CRLF, and LF) to LF+TAB when writing multi-line configparser values.

Library

  • gh-155888: Fix asyncio.WriteTransport.writelines() hanging the transport when the last data chunk is empty.

  • gh-155869: Fix reorganize() in dbm.dumb failing to persist updated value offsets, which could cause data loss after reopening the database.

  • gh-155717: multiprocessing’s default start method on systems with non-writeable tempfile filesystem is now “spawn” instead of "forkserver". Patch by Bénédikt Tran.

  • gh-155702: Fix sqlite3.Blob slice assignment with a step. It patched the bytes object read from the blob, which for a single byte is an immortal singleton, so that the value of that byte was changed in the whole process.

  • gh-90756: xml.etree.ElementTree.ElementTree.write() now treats the utf-8-sig encoding as utf-8 in the XML declaration.

  • gh-80762: Fix dir() on unittest.mock.Mock objects created with a tuple spec: it raised TypeError. Such spec is now also documented.

  • gh-61366: http.cookiejar.MozillaCookieJar.save() now writes 0 in the expiration time field for session cookies, as curl and Wget do. Previously this field was left empty, and such lines were ignored by curl and Wget.

  • gh-153400: On Linux, os.copy_file_range() and os.memfd_create() now fall back to the raw syscall when the libc Python is built against does not provide the wrapper function, so they stay available on interpreters built against a libc older than glibc 2.27.

  • gh-153400: os and signal: Use glibc functions instead of syscall(): pidfd_open(), pidfd_getfd() and pidfd_send_signal() (glibc 2.36), gettid() and getdents64() (glibc 2.30), and getrandom() (glibc 2.25). Patch by Victor Stinner.

  • gh-155519: Avoid a data-race in free-threaded builds when reading and writing context variables from different threads.

  • gh-155336: Fix error handling in socket.gethostbyaddr() and socket.gethostbyname_ex() when hostname resolution fails.

  • gh-118318: Remove the write_c14n() method of xml.etree.ElementTree.ElementTree and the support of method="c14n" in write() and tostring(). They never worked and always raised ValueError. Use xml.etree.ElementTree.canonicalize() instead.

  • gh-111331: Closing a io.BytesIO object which has exported buffers no longer fails with BufferError. The exported buffers keep the data alive and stay usable. As a result, destroying or garbage collecting such object no longer emits an unraisable exception.

  • gh-155319: warnings.warn_explicit() now displays the source line taken from the loader of the module whose globals are passed as module_globals. It also no longer raises IndexError if lineno is out of the range of the module source.

  • gh-155236: Add the dedent parameter in inspect.cleandoc() and inspect.getdoc(). pydoc no longer dedents documentation strings, so the indentation of the parameter descriptions generated by Argument Clinic is preserved.

  • gh-155009: Fix argparse.ArgumentParser to preserve the program name from sys.argv[0] when a named module is executed as the main program without replacing sys.argv[0].

  • gh-155063: Bump the version of pip bundled in ensurepip to version 26.2.1

  • gh-153711: On macOS, add run-time checks around the syscalls pipe2 (2) and dup3 (2), in addition to the existing build-time checks. This means that Python built on macOS 27 (where these calls are available) can run on macOS 26 (where they aren’t).

  • gh-155143: Fix asyncio.shield() leaking the calling task via the await-graph and callbacks when called on a future that never resolves.

  • gh-75008: csv.Sniffer.sniff() now detects the lineterminator parameter by a majority vote among the line endings of the sample.

  • gh-155051: decimal.localcontext() now raises TypeError if a keyword argument is None, as the pure Python implementation already did. Previously the C implementation silently ignored it.

  • gh-155044: optparse.Values objects now support copy.replace().

  • gh-155043: argparse.Namespace objects now support copy.replace().

  • gh-155041: decimal.Context objects now support copy.replace().

  • gh-155040: tarfile.TarInfo objects now support copy.replace().

  • gh-155063: Bump the version of pip bundled in ensurepip to version 26.2

  • gh-155033: CSV dialects (instances of csv.Dialect subclasses and dialect objects returned by csv.get_dialect()) now support copy.replace().

  • gh-154936: Fix the pure Python json decoder to report the correct position for invalid literal control characters in JSON strings.

  • gh-154904: Speed up shutil import by probing the _bz2, _lzma and _zstd extension modules instead of importing the bz2, lzma and compression.zstd wrappers, which are now only imported when an archive is actually created or extracted.

  • gh-154892: Fix a bug in the C accelerator for zoneinfo where datetime.datetime subclasses returning -1 for hour, minute, or second could incorrectly raise a SystemError.

  • gh-154871: Fixed a crash in asyncio.Task.get_context() when called on an uninitialized task.

  • gh-154848: The pickle C accelerator now enforces frame boundaries when unpickling, as the pure Python implementation already did. An argument that straddles a frame boundary, or a frame that begins before the previous one has ended, now raises pickle.UnpicklingError instead of being silently read across the boundary. This prevents the loaded data from diverging from the pickletools disassembly of the same pickle.

  • gh-154885: os.get_terminal_size() now checks isatty before calling ioctl, which reduces log noise on Android.

  • gh-154874: Fix curses.termattrs() returning a negative value on a terminal that supports curses.A_ITALIC, which left its result unusable as an attribute mask.

  • gh-151728: Clear the internal typing caches from an exit handler. Previously, an extension module that leaked a reference to typing would also keep every subscripted type alive past interpreter shutdown, including types owned by unrelated extension modules.

  • gh-154791: Fix asyncio.Future (C implementation) losing the initial exception traceback frames when Future.result() is called more than once. Previously, the C implementation cleared the stored traceback after the first call, causing subsequent raises to omit the original raise site. The pure-Python implementation was unaffected.

  • gh-94984: Add the mode parameter to asyncio.loop.create_unix_server() and asyncio.start_unix_server() to set the permissions of the Unix socket file created for path, applied before the server starts accepting connections.

  • gh-154744: Improve detection of skipinitialspace in csv.Sniffer.sniff().

  • gh-154726: Fix shutil.copyfile() to copy a symbolic link to a special file when follow_symlinks=False instead of raising SpecialFileError.

  • gh-154738: Fix ExternalEntityParserCreate() not propagating the reparse-deferral setting to the subparser, which left GetReparseDeferralEnabled() returning an uninitialized value. Patch by tonghuaroot.

  • gh-93251: Fix UnicodeDecodeError in socket functions (such as getaddrinfo() and gethostbyaddr()) when the localized error message of the C library is not UTF-8: decode it from the locale encoding.

  • gh-148468: Fix a regression in argparse where colorized argument help containing format specifiers did not accept string-like proxy objects.

  • gh-154638: Improve import time of argparse by lazily importing several dependencies.

  • gh-142035: Fix incorrect wrapping of argparse help text when color is enabled.

  • gh-135736: Fix :asyncio.TaskGroup to not wrap a GeneratorExit into a BaseExceptionGroup if it was raised by the body of the task group and none of the tasks in the group raised exceptions.

  • gh-154568: Fix array unpickling of little-endian float16.

  • gh-154566: Fix array.array.byteswap() corrupting data for 'Zd' (complex double) arrays with more than one element: the 16-byte item loop advanced the buffer pointer by only 8 bytes per iteration, causing items after the first to be scrambled.

  • gh-154551: Fix ctypes.util.find_library() returning None in non-UTF-8 locales.

  • gh-154523: Fixed data-race when calling io.TextIOBase.detach() in free-threaded build.

  • gh-154199: Make ctypes.util.find_msvcrt() always return None for compatibility reasons.

  • gh-135736: Fix asyncio.TaskGroup silently discarding errors from sibling tasks whenever the async with block exits with a SystemExit or KeyboardInterrupt. These errors are now reported via loop.call_exception_handler() instead of being lost.

  • gh-79366: Fixed a race condition in logging: if a handler was removed while a record was being emitted, the following handlers of the same logger could be skipped.

  • gh-82535: logging.handlers.SysLogHandler no longer fails if the address cannot be resolved when the handler is created. The address is resolved again when a record is emitted.

  • gh-70990: logging.handlers.SysLogHandler now accepts a bytes address of a Unix domain socket, including an address in the abstract namespace. Previously only str was recognized, and a bytes address raised ValueError.

  • gh-154189: Fixed a potential use-after-free when calling functools.partial(). Now, when invoking a partial() object, the stored function, positional arguments, and keyword arguments are preserved for the duration of the call in case of reentrancy.

  • gh-73458: Fix logging.config.listen(): it left the caller waiting for the ready event forever if the server could not be started, for example if the port was invalid or already in use. It now also binds to an IPv6 address if the host has no IPv4 address, for example if localhost is only aliased to ::1.

  • gh-154460: Fix time.strftime() and datetime.datetime.strftime() returning a wrong ISO 8601 week number (%V) on OpenBSD.

  • gh-154467: Fixed pdb remote attaching (python -m pdb -p PID) sending an empty prompt to the client instead of (Pdb) when the target process has an interactive terminal.

  • gh-153970: Calling str() on a subprocess.CalledProcessError no longer raises TypeError when its returncode is not an integer, such as None.

  • gh-154435: Fix os.posix_fadvise() and os.posix_fallocate() on DragonFly BSD: they raised OSError with a meaningless error code, because these functions return -1 and set errno there.

  • gh-154399: Fix venv activation in a non-interactive csh: activate.csh no longer fails when the prompt variable is not set.

  • gh-154389: Fix uuid.uuid1() on OpenBSD: it returned a version 4 UUID, because uuid_create() generates random UUIDs on this platform.

  • gh-154324: Fix os.sendfile() on illumos: it no longer reports a successful transfer when the underlying system call failed without writing any data.

  • gh-154307: Fix tempfile.TemporaryDirectory.cleanup() on DragonFly BSD, where removing a file with the UF_NOUNLINK flag failed with EISDIR instead of EPERM.

  • gh-154291: Fix socket.has_dualstack_ipv6() to return False on platforms such as DragonFly BSD where setting IPV6_V6ONLY to 0 silently has no effect.

  • gh-154283: On DragonFly BSD, threading.get_native_id() now returns a value that is unique across processes, matching the other platforms.

  • gh-154258: Fix a crash in mmap.mmap.resize() on NetBSD when growing a shared anonymous mapping. resize() now raises ValueError in this case, as it already did on Linux.

  • gh-131565: ctypes.util.dllist() now works on NetBSD. It is implemented in the _ctypes extension module so that dl_iterate_phdr() reports all loaded shared libraries: on NetBSD it only reports the link-map group of the calling object, which excluded them when called through ctypes.

  • gh-154225: Fix os.openpty() on Solaris and illumos: it no longer leaves the pseudo-terminal as the controlling terminal of the calling process.

  • gh-154227: Fix os.posix_openpt() on OpenBSD, where it rejected the O_CLOEXEC flag.

  • gh-139373: Fix asyncio.subprocess.Process.communicate() losing already-read output when it is cancelled; the output is now retained and returned by a subsequent communicate() call. Patch by Kumar Aditya.

  • gh-145030: Fix asyncio write pipe transports for named FIFOs on macOS and Solaris. Unread data sitting in the FIFO made the transport misinterpret a poll event as the reader disconnecting, wrongly closing the transport.

  • gh-154176: Fix a crash in locale.strxfrm() on DragonFly BSD, whose wcsxfrm() does not support the zero size.

  • gh-154836: Fix subprocess.Popen.wait() raising TypeError (macOS and other BSDs) or OverflowError (Linux) for very large timeout values such as float('inf'), a 3.15 regression in the new event-driven wait. Also fix select.kqueue.control() masking OverflowError for out-of-range timeouts as TypeError.

  • gh-154146: Fix accuracy of math.acospi() for arguments close to 1 on platforms that do not provide acospi() in libm.

  • gh-154086: Store per-thread sample counts in Tachyon flamegraphs so filtering a thread updates frame widths and totals.

  • gh-154053: Fix compilation of the ssl module against LibreSSL, which does not provide SSL_CTX_set1_sigalgs_list() and SSL_CTX_set1_client_sigalgs_list(). The set_server_sigalgs() and set_client_sigalgs() methods of ssl.SSLContext now raise NotImplementedError on LibreSSL.

  • gh-154002: The pure-Python pickle unpickler no longer replaces a TypeError raised by an old-style instance constructor with a new one carrying the traceback object in its args. The original error now propagates, as it already did in the C implementation.

  • gh-154001: Fix random.binomialvariate() raising ZeroDivisionError when random.random() returns zero.

  • gh-153967: argparse.ArgumentParser.print_usage() and argparse.ArgumentParser.print_help() won’t silently fail when an invalid file object is specified. Patch by Timothy Poon.

  • gh-153906: Modernize the HTML output of pydoc: use semantic HTML5 markup and a new style sheet based on the python-docs-theme used by docs.python.org, with dark mode support. Class members inherited from other classes are now collapsed by default.

  • gh-153908: Fix data race when calling repr() on itertools.count under the free-threaded build.

  • gh-153896: Deduplicate unhashable args in typing.Literal.

  • gh-153903: Add ctypes.util.wrap_dll_function() for creating _CFuncPtr objects from a function signature.

  • gh-153864: On a wide curses build, curses.window.insch() now inserts a non-ASCII byte as the character it encodes in the window’s encoding, consistently with addch(), instead of its code point.

  • gh-153862: On a wide curses build, curses.window.inch() now returns the locale-encoded byte of a non-ASCII character, matching instr(), instead of the low byte of its code point.

  • gh-153856: Add os.RWF_NOSIGNAL constant for Linux 6.18+.

  • gh-153844: symtable.symtable() now accepts an AST object, like the builtin compile().

  • gh-146011: Fix a heap-use-after-free in the C implementation of decimal when calling repr() after deleting the Context.

  • gh-104533: Add ctypes.util.struct() and ctypes.util.CFieldInfo for generating structure types using annotations.

  • gh-153761: Fix cancelling asyncio.loop.sock_accept() dropping a pending connection.

  • gh-153695: Hashing a sqlite3.Row that contains an unhashable value now raises TypeError instead of SystemError. Patch by tonghuaroot.

  • gh-127049: Fix a race condition in asyncio on Unix where asyncio.subprocess.Process.send_signal(), terminate() or kill() could signal an unrelated process that was recycled onto the PID of the already-reaped child when ThreadedChildWatcher is used. Patch by Kumar Aditya.

  • gh-83273: csv.Sniffer.sniff() now deduces the dialect by trial parsing with the actual CSV parser instead of heuristics based on matching isolated fragments and on character frequencies. It can now detect the escapechar parameter, accepts non-ASCII delimiters in the delimiters argument, no longer misdetects the delimiter when the sample contains delimiter characters inside quoted fields, handles samples truncated at an arbitrary point, and no longer takes quadratic time on quoted samples. A sample consisting of a single column of quoted fields now raises csv.Error instead of guessing a delimiter from the content of the fields.

  • gh-153658: Fix sqlite3.Connection.iterdump() raising sqlite3.OperationalError when a table name contains a single quote. Patch by tonghuaroot.

  • gh-98078: Fix asyncio SSL transports not sending the fatal TLS alert to the peer when the TLS handshake fails or when receiving corrupted data, and not sending the close_notify alert to the peer when the TLS shutdown fails. The peer can now tell why the connection was dropped (for example, certificate verification failure or no TLS version in common) instead of seeing the connection abruptly closed.

  • gh-85943: Fix struct functions raising BytesWarning under the -bb command line option when a str format is used after an equal bytes format (or vice versa). The internal format cache no longer mixes str and bytes keys.

  • gh-153603: Fix a crash in the ISO-2022 decoders when decoding a byte after an unknown charset designation is set via the decoder’s setstate method. Patch by tonghuaroot.

  • gh-153502: imaplib.IMAP4.copy(), move(), fetch(), store(), search(), sort(), thread() and expunge() now accept a keyword-only uid argument that selects the corresponding UID command, as a more convenient alternative to uid().

  • gh-153494: imaplib.IMAP4.search(), sort() and thread() (and the corresponding uid commands) now encode str search criteria to the declared charset, so international search text can be passed as ordinary str. When charset is None (as it must be under UTF8=ACCEPT), the criteria are sent using the connection encoding instead. A criterion passed as bytes is sent unchanged, for use with a charset that Python has no codec for.

  • gh-153513: Values of several Tcl object types returned by tkinter are now converted to the corresponding Python type instead of being wrapped in a _tkinter.Tcl_Obj: index, window, nsName and parsedVarName objects to str, and pixel screen distances with no unit suffix to int or float.

  • gh-153404: urllib.robotparser.RobotFileParser now silently ignores a Crawl-delay or Request-rate value written with non-decimal digits (such as U+00B2 SUPERSCRIPT TWO) instead of raising ValueError and aborting the parse of the whole robots.txt file.

  • gh-151292: Store the sample count in profiling.sampling binary format, as a 64-bit integer, widening from previously used 32-bit integer. This breaks the existing recordings. Long or thread-heavy profiling sessions will no longer fail because of OverflowError. Patch by Maurycy Pawłowski-Wieroński.

  • gh-153417: Error messages from imaplib.IMAP4.select() and imaplib.IMAP4.uid() no longer raise BytesWarning under -bb when the mailbox or command argument is bytes.

  • gh-153422: winfo_exists(), winfo_ismapped() and winfo_viewable() methods of tkinter widgets and edit_modified() of tkinter.Text now return a bool instead of an integer or, depending on wantobjects, a string.

  • gh-49555: imaplib now encodes non-ASCII mailbox names as modified UTF-7 (RFC 3501, section 5.1.3) in the default mode, so international mailbox names can be passed as ordinary str; under UTF8=ACCEPT they are sent as UTF-8 instead. A name that is not valid modified UTF-7, such as one with a bare &, is now encoded correctly instead of being sent as is. A str that is already valid modified UTF-7, or a bytes object, is sent unchanged.

  • gh-153395: curses.ascii predicates and the ctrl() and unctrl() functions now accept a curses.complexchar. ctrl() now returns a non-ASCII argument unchanged instead of masking it to a control character.

  • gh-153290: Fix a data race on the free-threaded build when io.BytesIO.__setstate__() installs the instance dictionary while another thread concurrently calls a method on the same object.

  • gh-153406: email.utils.parsedate_to_datetime() now raises ValueError instead of OverflowError when the parsed year or timezone offset is out of range, matching its documented behavior.

  • gh-153333: The readprofile method of tkinter.Tk now reads the user’s profile scripts using the encoding declared in the file, instead of the locale encoding.

  • gh-153296: Fix a data race and use-after-free when iterating over an io.StringIO object while it is being concurrently mutated. The __next__ method now properly acquires the object’s lock.

  • gh-153083: Defer GC tracking of an array.array to the end of its construction. Patch by Donghee Na.

  • gh-153292: Fix data race in repr of threading.RLock in free-threading build.

  • gh-153291: Fix a data race in readline.get_completer() and readline.get_pre_input_hook() on the free-threaded build: the getters read the stored hook without the critical section that the corresponding setters hold.

  • gh-153293: Fix the live sampling profiler TUI keeping stale aggregated opcode statistics after a stats reset.

  • gh-143990: A tkinter.font.Font created from a named font, including by copy(), now copies its configured options rather than the options resolved by Tcl’s font actual, preserving a size specified in pixels (a negative size).

  • gh-148286: Fix undefined behavior in compression.zstd.ZstdDecompressor.unused_data when a complete frame was decompressed in a single call.

  • gh-153210: Fix crash on array import under a memory pressure.

  • gh-153521: Add support for structured arguments in imaplib command methods. A message_set and lists of flags or other atoms can now be passed as sequences instead of preformatted strings, and the search(), fetch(), sort(), thread() and uid() methods accept a params keyword argument that substitutes and quotes ? placeholders.

  • gh-153256: Added the tk_print() method to tkinter.Canvas and tkinter.Text which prints the contents of the widget using the native print dialog. It requires Tk 8.7/9.0 or newer.

  • gh-153259: Added the tkinter.systray module which provides the SysTrayIcon class as an interface to the system tray icon and the notify() function which sends a desktop notification. They require Tk 8.7/9.0 or newer.

  • gh-72880: Added the tkinter.fontchooser module which provides the FontChooser class as an interface to the native font selection dialog.

  • gh-153200: Fix math.isqrt() returning an incorrect result for arguments not less than 2**64 that are instances of an int subclass with an overridden comparison operator.

  • gh-153158: Remove the erroneous width argument of calendar.HTMLCalendar.formatmonthpage(), which could drop the year from the heading.

  • gh-66788: Add the utf-7-imap codec, implementing the modified UTF-7 encoding used for international IMAP4 mailbox names (RFC 3501, section 5.1.3).

  • gh-89869: Add imaplib.IMAP4.login_plain(), which authenticates using the PLAIN SASL mechanism (RFC 4616). Unlike login(), it supports non-ASCII user names and passwords.

  • gh-98092: Add imaplib.IMAP4.id(), a wrapper for the IMAP ID command (RFC 2971).

  • gh-153133: Fix a socket leak in asyncio.loop.create_connection() when the transport cannot be created.

  • gh-153068: Fix cProfile.Profile.enable() to no longer overwrite errors from sys.monitoring.

  • gh-153062: Fix a crash when concurrently iterating an itertools.tee() iterator on the free-threaded build.

  • gh-153056: Fix string.Template raising a spurious ValueError when the pattern attribute is a compiled regular expression object, which the documentation allows. On the free-threaded build this also occurred as a data race on the first concurrent use.

  • gh-59396: tkinter.scrolledtext.ScrolledText gained a use_ttk parameter to use the themed tkinter.ttk frame and scroll bar instead of the classic tkinter widgets.

  • gh-143921: Narrow the control character check in imaplib commands: only NUL, CR and LF are now rejected. Other control characters are valid in quoted strings and can occur in mailbox names returned by the server, so they are now accepted and sent quoted.

  • gh-153037: Fix ZstdFile raising AttributeError instead of io.UnsupportedOperation when iterating over a file that is not open for reading.

  • gh-135661: Fix html.parser.HTMLParser: an abruptly closed empty comment (<!--> or <!--->) no longer extends up to a later --> in the same feed() call.

  • gh-153009: Fix compilation of curses on platforms that define the stdscr macro. Patch by Bénédikt Tran.

  • gh-152851: Prevent a crash when allocation fails while copying a BLAKE-2s/2b object. Patch by Bénédikt Tran.

  • gh-54930: Error responses of http.server.BaseHTTPRequestHandler to malformed request lines now include a status line and headers instead of being sent in the bare HTTP/0.9 style. Only a valid HTTP/0.9 request (a two-word GET request line) now receives an HTTP/0.9 style response.

  • gh-152997: On platforms providing the C library’s iconv(3) function, the codecs module now exposes every encoding known to iconv for which Python has no built-in codec. Such an encoding can be used by its name (for example "cp1133") or, to force the iconv-based engine even when a built-in codec exists, with an "iconv:" prefix (for example "iconv:latin1").

  • gh-119592: Fix concurrent.futures.ProcessPoolExecutor stranding submitted work forever when a worker process exited upon reaching its max_tasks_per_child limit after shutdown() was called with wait=False: a replacement worker is now spawned and the remaining work executed as documented. If the executor has instead been garbage collected without shutdown() (gh-152967), or a replacement worker cannot be started, the remaining futures now fail with BrokenProcessPool instead of never resolving. A worker exit racing shutdown(wait=False) can also no longer crash the executor management thread.

  • gh-150579: concurrent.futures now uses lazy imports for its executor submodules instead of a module __getattr__ hook.

  • gh-152951: collections.deque prevent rare crash when calling extend under high memory pressure conditions.

  • gh-152912: sys.addaudithook() now correctly suppresses only RuntimeError instead of all Exception subclasses when an existing audit hook raises during hook registration. Patch by Yeongu Kim.

  • gh-150880: Normalize non-extended Windows paths before appending the wildcard used by os.listdir() and os.scandir(), making paths with trailing spaces behave consistently with other filesystem APIs.

  • gh-152068: Fixes a bug when a line was split (particularly on macOS Terminal.app) in the middle of a colorized keyword, causing the ANSI Color Reset sequence (ESC0m) to not be properly printed, causing the output to be colored when it shouldn’t

  • gh-152849: Out-of-range float and integer timestamps now raise OverflowError with the same message. Patch by tonghuaroot.

  • gh-152847: Reject a POSIX TZ transition rule with non-digit characters in the day-of-year field in the pure-Python zoneinfo parser. Patch by tonghuaroot.

  • gh-152905: On glibc, locale.nl_langinfo() now decodes the LC_TIME items (such as the month and day names) using the wide locale data, so the result no longer depends on the LC_CTYPE encoding.

  • gh-152586: tempfile._TemporaryFileWrapper has been renamed to the public tempfile.TemporaryFileWrapper. The old private name is kept as a deprecated alias and will be removed in Python 3.21.

  • gh-77508: Add imaplib.IMAP4.move(), a wrapper for the IMAP MOVE command (RFC 6851), analogous to copy().

  • gh-49680: Add the translate_line_endings parameter to imaplib.IMAP4.append(). By default line endings in the message are translated to CRLF, as before; passing False sends the message literal exactly as given, preserving bare CR or LF octets.

  • gh-152718: Fix unbounded memory allocation in the profiling.sampling binary profile reader when a file declares more string or frame entries than it contains.

  • gh-108280: Connecting imaplib to a server that does not send a valid IMAP4 greeting (for example a POP3 server answering on the IMAP port) now raises an error reporting the server’s response instead of imaplib.IMAP4.error: None.

  • gh-151126: Fix a crash caused by failing to set MemoryError on allocation failure when passing ctypes.Structure or ctypes.Union instances by value to ctypes foreign functions.

  • gh-63121: imaplib now refreshes the cached capability list after a successful login() or authenticate(), using the CAPABILITY response sent by the server or, if none was sent, by querying it, so that capabilities that become available only after authentication (such as ENABLE on Gmail) are recognized. Capabilities advertised in the server greeting are now also used, avoiding a redundant CAPABILITY command.

  • gh-88574: imaplib no longer fails when a server sends a spurious blank line after the counted data of a literal, including after a literal that terminates a response (such as a mailbox name returned by LIST). Such blank lines are now skipped without swallowing the following line.

  • gh-152502: Detect the curses mouse interface (getmouse(), has_mouse(), the BUTTON* constants, and others) and the window is_* state-query methods with configure capability probes or library macros instead of gating them on ncurses-specific macros. They are now also available with other curses implementations that provide them, such as NetBSD curses and PDCurses (the latter underpins windows-curses).

  • gh-151842: Fix a crash in _interpreters.capture_exception() when MemoryError happens. Patch by Amrutha Modela.

  • gh-40038: imaplib now again quotes command arguments when necessary, for example mailbox names containing a space. Such quoting was inadvertently disabled when the module was ported to Python 3, and the arguments are now quoted according to the RFC 3501 grammar. For backward compatibility, an argument already enclosed in double quotes is left unchanged, so code that quotes arguments itself keeps working.

  • gh-50966: Fix unbounded recursion in turtle when a mouse event handler that moves the turtle is reentered while the screen is being redrawn, for example with screen.ondrag(turtle.goto). This could previously crash the interpreter.

  • gh-152638: Deprecate tkinter.filedialog.askopenfiles(). Opening several files at once is error-prone and the returned list cannot be used in a with statement; iterate over the names returned by tkinter.filedialog.askopenfilenames() and open them one by one instead.

  • gh-152587: In tkinter, the name parameter of the wait_variable(), setvar() and getvar() methods and the value parameter of setvar() are now required. Their former default values ('PY_VAR' and '1') were not meaningful.

  • gh-152569: Fix asyncio.wait() leaking waiting tasks via the await-graph when racing a future that never resolves. The waiting task is now discarded from every future’s awaited_by set once wait() returns, even for pending futures.

  • gh-110357: Importing hashlib no longer logs an error to stderr when a normally guaranteed hash algorithm is unavailable in the current runtime (for example under an OpenSSL FIPS configuration or a build using --without-builtin-hashlib-hashes). Code that actually uses the missing algorithm still gets a clear ValueError.

  • gh-152503: Fix curses.window.in_wch(), curses.window.in_wchstr() and curses.window.getbkgrnd() returning garbage text when curses is built against a curses library that does not NUL-terminate the cchar_t text array (such as NetBSD curses).

  • gh-152356: Fix a hang in profiling.sampling run --blocking on Windows when the target process exits. The profiler now finalizes binary profiles instead of continuing to sample the exited process.

  • gh-152470: The wide-character curses functions and methods curses.window.get_wch(), curses.window.get_wstr(), curses.unget_wch(), curses.erasewchar(), curses.killwchar() and curses.wunctrl() now also work when Python is not built against a wide-character-aware curses library, on an 8-bit locale, where each character is a single byte in the relevant encoding. curses.ungetch() now also accepts a one-character string, like curses.unget_wch(); on a wide-character build it can be any character (previously a multibyte character raised OverflowError).

  • gh-78335: Update the docstrings of tkinter and tkinter.ttk widget classes to list all supported widget options, including options added in Tk 9.0 and 9.1. tkinter.Menubutton and tkinter.Message previously had no option list at all.

  • gh-152431: Fix asyncio.StreamWriter.start_tls() to keep the linked StreamReader transport in sync with the upgraded transport.

  • gh-103878: The tkinter.filedialog functions that return a filename (askopenfilename(), asksaveasfilename() and askdirectory()) now consistently return an empty string when the dialog is cancelled, instead of an empty tuple or b'' on some platforms. askopenfilenames() likewise always returns an empty tuple, and askopenfiles() an empty list.

  • gh-151126: Fix two crashes in tkinter and socket modules initialization under a memory pressure. Sets missing MemoryError.

  • gh-133031: curses.textpad.Textbox now supports entering and reading back the full Unicode range, including combining characters, when curses is built with wide-character support.

  • gh-133031: curses.textpad.Textbox now enters and reads back the non-ASCII characters of an 8-bit locale encoding, instead of mangling them with a 7-bit mask.

  • gh-43699: The drag cursor in tkinter.dnd is now changed only once the pointer starts moving rather than on the initial button press, so that a plain click no longer flashes it.

  • gh-50409: Deprecate the tagOrId parameter of tkinter.PanedWindow.paneconfigure() (and its paneconfig() alias) in favor of child, for consistency with the other pane methods; it will be removed in Python 3.18.

  • gh-71880: curses.textpad.Textbox now lets the lower-right cell of the window be edited. Writing it with addch() would move the cursor past the end of the window, raising an error and scrolling a scrollable window, so it is now written with insch(), which keeps the cursor in place.

  • gh-152334: Add the curses.define_key(), curses.key_defined() and curses.keyok() key-management functions.

  • gh-152332: Add the curses.term_attrs() function, the counterpart of curses.termattrs() for the WA_* attributes.

  • gh-87904: The curses types and exceptions now report their public module in __module__, repr() and help() – for example curses.window instead of _curses.window and curses.panel.error instead of _curses_panel.error.

  • gh-152325: Add the curses.has_mouse() function and the curses.window.mouse_trafo() method.

  • gh-121249: Deprecate using 'F' and 'D' type codes in the struct module.

  • gh-152275: The curses module now raises OverflowError instead of silently truncating an out-of-range value: curses.color_pair() rejects a color pair number that does not fit in the chtype color field, and the attr argument of the character-cell and attribute methods (addch(), addstr(), attron(), attrset() and others) is checked against the chtype range.

  • gh-83274: Deallocating a tkinter application from a thread other than the one it was created in no longer crashes the interpreter. The underlying Tcl interpreter is leaked instead, and a RuntimeWarning is reported.

  • gh-81954: Deleting a writable, open zipfile.ZipFile now emits a ResourceWarning. Use as a context manager or call close() explicitly.

  • gh-152305: Fix the pure-Python datetime.time.strftime() implementation raising AttributeError for the year directives. Patch by tonghuaroot.

  • gh-88758: tkinter.Misc.focus_get(), focus_displayof(), focus_lastfor() and winfo_containing() now return None instead of raising KeyError when the widget was not created by tkinter (for example a torn-off menu).

  • gh-152260: Add the curses functions scr_dump(), scr_restore(), scr_init() and scr_set(), which dump the whole screen to a file and restore it.

  • gh-38464: tkinter.Misc.nametowidget() now resolves the auto-generated names of cloned menus (a menu used as a menubar or a cascade) back to the original widget.

  • gh-152263: Add the soft-label-key functions to the curses module: slk_init(), slk_set(), slk_label(), slk_refresh(), slk_noutrefresh(), slk_clear(), slk_restore(), slk_touch(), slk_attron(), slk_attroff(), slk_attrset(), slk_attr(), slk_attr_on(), slk_attr_off(), slk_attr_set() and slk_color().

  • gh-116946: The internal _tkinter tkapp and tktimertoken types now implement the garbage collector protocol, so reference cycles involving a Tcl interpreter or a timer handler can be collected.

  • gh-152258: Add the curses window method dupwin(), which returns a new window that is an independent duplicate of an existing one.

  • gh-152248: Make the C and pure-Python zoneinfo parsers validate POSIX TZ abbreviations consistently, rejecting unquoted abbreviations with non-letter characters and empty quoted abbreviations. Patch by tonghuaroot.

  • gh-80937: Fix a memory leak in tkinter when a Tcl command created with createcommand was not explicitly removed before the interpreter was deleted. The command no longer keeps the interpreter alive through a reference cycle.

  • gh-111330: Update pure-Python io.BytesIO to close cleanly when the data has an export such as a memoryview.

  • gh-152246: Fix the pure-Python zoneinfo parser accepting an invalid POSIX TZ transition rule with a non-period separator. Patch by tonghuaroot.

  • gh-152233: Add the curses.complexstr type, an immutable string of styled character cells (the counterpart of curses.complexchar), and the curses window method in_wchstr() that returns one. The string-cell methods addstr(), addnstr(), insstr() and insnstr() now also accept a complexstr. Like curses.complexchar, it works whether or not Python was built against a wide-character-aware curses library.

  • gh-152233: Add the curses.complexchar type, representing a styled character cell (text, attributes and color pair), and the curses window methods in_wch() and getbkgrnd() that return one. The character-cell methods (addch(), bkgd(), border(), hline() and others) now also accept a complexchar. This works whether or not Python was built against a wide-character-aware curses library; on a narrow build a cell holds a single character representable as one byte in the window’s encoding.

  • gh-152099: asyncio’s loop.sendfile(..., fallback=False) now consistently raises asyncio.SendfileNotAvailableError for fallback-only transports, such as SSL/TLS transports, when native sendfile cannot be used. Previously, this case raised RuntimeError.

  • gh-151496: Fixed profiling.sampling --gecko with --async-aware by flattening async task stacks before generating Gecko samples. --binary now rejects --async-aware until the binary format supports async task data.

  • gh-152219: Add the curses window methods attr_get(), attr_set(), attr_on(), attr_off() and color_set(), which use a separate color pair argument instead of packing it into the attribute value, and the corresponding WA_* attribute constants.

  • gh-139816: Fix a hang in tkinter on interactive Python built without readline. An exception raised in a callback no longer causes the event loop to stop and wait for the user to press Enter; pending callbacks now keep running until input is actually available on stdin.

  • gh-139145: Fix a busy loop in tkinter on interactive Python. When a Tcl command running its own event loop (such as vwait or wait_variable()) was active and input arrived on stdin, the event loop kept spinning at 100% CPU. The stdin file handler is now removed as soon as input is available. Based on a patch by Michiel de Hoon.

  • gh-152212: Fix the pure-Python zoneinfo parser accepting a POSIX TZ string with a std abbreviation but no offset. This is invalid per POSIX and now raises ValueError, matching the C accelerator. Patch by tonghuaroot.

  • gh-152156: Fix a possible crash in concurrent.interpreters.create() under limited memory conditions.

  • gh-152157: The C implementations of fromisoformat() and fromisoformat() now reject a decimal separator that is not followed by any fractional digit before a timezone designator.

  • gh-151763: Fix crash in _interpqueues.create() whe MemoryError happens on queue creation.

  • gh-151669: On Windows, when populating tar archives from filesystem content, to conform to the tar format standard, backslashes in symlink targets are be replaced by slashes.

  • gh-105895: Add match and case to the list of supported topics by help().

  • gh-151378: Fix a bug in the binary collector in Tachyon that caused unbounded memory growth while profiling a thread that stayed asleep. Patch by Maurycy Pawłowski-Wieroński.

  • gh-152074: Increase the buffer size to 256 KiB in asyncio.loop.sendfile() method fallback.

  • gh-152100: Support set operations and nested sets in regular expression character classes, as described in Unicode Technical Standard #18: set difference ([A--B]), intersection ([A&&B]) and union ([A||B]).

  • gh-152079: Fix datetime.datetime.fromisoformat() in the C implementation dropping the sub-second part of a UTC offset whose whole-second part is zero, matching the pure-Python implementation.

  • gh-152052: The json C accelerator now correctly reports an unterminated string for a \uXXXX escape at the end of the input.

  • gh-152060: Fix datetime.datetime.fromisoformat() raising AssertionError instead of ValueError for some malformed strings in the pure-Python implementation, matching the C implementation.

  • gh-152056: Optimize matching of a character set that contains a single character category, such as [\d] or [^\s]: it is now compiled to a single CATEGORY opcode, the same as the corresponding \d or \S escape, instead of being wrapped in an IN block. This speeds up matching and reduces the size of the compiled byte code. Patch by Pieter Eendebak.

  • gh-152033: Optimize matching of character class escapes (\d, \D, \s, \S, \w and \W) that occur outside a character set: they are now compiled to a single CATEGORY opcode instead of being wrapped in an IN block. This speeds up patterns such as \d+ and reduces the size of the compiled byte code.

  • gh-143990: tkinter.font.Font can now wrap a font description without creating a new named font, by passing it as font with exists=True and no name. This avoids a loss of precision in actual(), measure() and metrics(). Keyword options now override the corresponding settings of the given font instead of being ignored.

  • gh-127802: The deprecated tkinter.Variable methods trace_variable(), trace(), trace_vdelete() and trace_vinfo() are now scheduled for removal in Python 3.17.

  • gh-126219: Fixed a crash in tkinter.Tk when className contains a non-BMP character and tkinter is built against Tcl/Tk 8.x. Such a name is now rejected with a ValueError.

  • gh-101284: tkinter.OptionMenu now accepts arbitrary tkinter.Menubutton options as keyword arguments and uses them to override its default appearance.

  • gh-143070: Automatically generated tkinter widget names now start with "+" instead of "!", so that they can be used as tags in the tkinter.Canvas and tkinter.Text widgets.

  • gh-151955: Allow more types to be used in the bound argument to typing.ParamSpec and typing.TypeVarTuple.

  • gh-151920: Add the ttk.Style.theme_styles method, wrapping the Tk ttk::style theme styles subcommand, which returns the list of styles defined in a theme.

  • gh-95555: Regular expressions now support Unicode property escapes \p{...} and \P{...} for properties that the engine can resolve without the unicodedata database: many General_Category values, a number of binary properties, the POSIX compatibility classes, and properties derivable from the code point.

  • gh-151910: Added tkinter.ttk.Treeview methods wrapping the enhanced ttk::treeview widget commands added in Tk 9.1 (and the detached query added in Tk 9.0): item navigation and queries, opening, hiding, sorting and searching of items, and cell focus, selection and tagging. The expand() and collapse() methods (without recursion) also work on Tk older than 9.1.

  • gh-151890: Add the format parameter to the tkinter.PhotoImage.put() method, the metadata parameter to the put(), read(), write() and data() methods, and the withalpha parameter to the get() method. The metadata and withalpha parameters require Tcl/Tk 9.0 or newer.

  • gh-151888: Add the tkinter.PhotoImage.redither() method, wrapping the photo image redither Tk command.

  • gh-151886: Add the tkinter.Misc.tk_appname(), tkinter.Misc.tk_useinputmethods() and tkinter.Misc.tk_caret() methods, wrapping the tk appname, tk useinputmethods and tk caret Tk commands.

  • gh-151881: Add the tkinter.Menu.postcascade() method and the tkinter.Misc.tk_scaling() and tkinter.Misc.tk_inactive() methods, wrapping the postcascade, tk scaling and tk inactive Tk commands.

  • gh-151878: Add the validate() method to the tkinter.Entry and tkinter.Spinbox widgets, forcing an evaluation of the validation command.

  • gh-151876: Add the tkinter.Canvas methods rchars() and rotate(), wrapping the rchars and rotate Tk canvas commands.

  • gh-151874: Add the tkinter methods Misc.winfo_isdark(), Wm.wm_iconbadge() and Wm.wm_stackorder(), wrapping the winfo isdark, wm iconbadge and wm stackorder Tk commands.

  • gh-59396: The tkinter.filedialog.FileDialog dialog and its tkinter.filedialog.LoadFileDialog and tkinter.filedialog.SaveFileDialog subclasses, which follow the layout of the classic Motif file selection dialog, were modernized to match its look and feel more closely. They are now built from the themed tkinter.ttk widgets instead of the classic tkinter widgets, and gained a use_ttk parameter that selects between the classic Tk widgets and the themed ttk widgets. The buttons and field labels gained Alt key accelerators, the default ring follows the keyboard focus, and the Escape key cancels the dialog. The directory and file lists gained a horizontal scrollbar and type-ahead selection. The dialog is now centered over its parent, and the overwrite confirmation of SaveFileDialog uses a themed message box.

  • gh-86165: Fix imaplib.Time2Internaldate() to use the local timezone offset for time.struct_time values with tm_gmtoff set to None, as returned by datetime.datetime.timetuple(). Contributed by Xiao Yuan.

  • gh-151822: Colorize exit, quit, copyright, help, and clear as commands in the REPL when typed alone on a line. Patch by Bartosz Sławecki.

  • gh-59396: The tkinter.simpledialog dialogs were modernized to match the look and feel of the native Tk dialogs. tkinter.simpledialog.SimpleDialog and the askinteger(), askfloat() and askstring() dialogs are now built from the themed tkinter.ttk widgets instead of the classic tkinter widgets; the tkinter.simpledialog.Dialog base class still defaults to the classic widgets for compatibility. Both Dialog and SimpleDialog gained a use_ttk parameter that selects between the classic Tk widgets and the themed ttk widgets. SimpleDialog also gained bitmap and detail parameters, draws the standard icons with themed images in the ttk version, and accepts mappings of button options as buttons entries, where an underline option adds an Alt key accelerator. The font and wrap length of the message and the detail message are taken from the Tk option database and can be overridden by the application. The dialogs also follow the keyboard conventions of the Tk message box: the default ring follows the keyboard focus, the Return key activates the focused button, and the Dialog OK and Cancel buttons gained Alt key accelerators. Several bugs were also fixed.

  • gh-151814: Fix unbounded memory growth in io.TextIOWrapper when repeatedly writing an empty string.

  • gh-75666: Fix a reference leak in tkinter: the Tcl commands created for event callbacks are now deleted when a binding is replaced or unbound.

  • gh-151770: Fix datetime.datetime.fromisoformat() raising AssertionError instead of ValueError for an out-of-range month combined with a 24:00 time.

  • gh-151776: Add curses functions and window methods that report state which could previously only be set: the window methods is_cleared(), is_idcok(), is_idlok(), is_immedok(), is_keypad(), is_leaveok(), is_nodelay(), is_notimeout(), is_pad(), is_scrollok(), is_subwin(), is_syncok(), getdelay(), getparent() and getscrreg(), and the functions curses.is_cbreak(), curses.is_echo(), curses.is_nl() and curses.is_raw(). They are only available when built against an ncurses with NCURSES_EXT_FUNCS.

  • gh-151774: Add the curses functions curses.alloc_pair(), curses.find_pair(), curses.free_pair() and curses.reset_color_pairs() for dynamic color-pair management. They are only available when Python is built against a wide-character version of the underlying curses library with extended-color support.

  • gh-151757: The curses character-cell window methods now accept a full character cell – a spacing character optionally followed by combining characters – in addition to a single integer or byte character. Add the wide-character read methods curses.window.get_wstr() and curses.window.in_wstr(), and the functions curses.erasewchar(), curses.killwchar() and curses.wunctrl(). On a narrow (non-ncursesw) build the character cell holds a single character without combining marks, representable as one byte in the window’s encoding, and curses.window.in_wstr() returns its decoded text.

  • gh-151744: Add curses.nofilter(), which undoes the effect of curses.filter().

  • gh-90092: Add support for multiple terminals to the curses module: the new functions curses.newterm(), curses.set_term() and curses.new_prescr(), the corresponding screen object, and the curses.window.use() method.

  • gh-151675: Add the sync() and pendingsync() methods of tkinter.Text, wrapping the Tk sync and pendingsync subcommands.

  • gh-151674: Add the edit_canundo() and edit_canredo() methods of tkinter.Text, wrapping the Tk edit canundo and edit canredo subcommands.

  • gh-151627: Fix a crash in collections.OrderedDict iterators in free-threaded builds when the dictionary is concurrently cleared or updated.

  • gh-151695: Fix a use-after-free in the curses module. The encoding of the initial screen, used by curses.unctrl() and curses.ungetch() to encode non-ASCII characters, is now kept as a private copy instead of a borrowed pointer to a window object that may be deallocated.

  • gh-151596: Add missing size positional argument to the pure-Python implementation of io.TextIOBase.readline().

  • gh-151640: Fix a data race in io.BytesIO in free-threaded builds when whole-buffer reads or peeks, or getvalue(), share the internal buffer with concurrent writes.

  • gh-151615: Fix asyncio servers repeatedly logging and rescheduling on a single event loop iteration when accept() fails with a resource errors.

  • gh-151613: Fix another way the Tachyon profiler frame cache could produce impossible mixed stack traces when _PyInterpreterFrame addresses are reused, by validating cached frame anchors with a sequence counter.

  • gh-148660: Fix a crash in collections.OrderedDict.copy() when a key’s __eq__ or a subclass method mutates the dict during the copy. Now raises RuntimeError instead, as iteration does.

  • gh-151497: Opening a tarfile archive no longer attempts to pre-allocate a huge buffer when a crafted or truncated member claims an oversized extended header (a GNU long name/link or a pax header). The extended header is now read in bounded chunks, so its size field can no longer trigger memory exhaustion.

  • gh-151485: Fix command quoting in subprocess.CalledProcessError. Contributed by Benjy Wiener.

  • gh-151436: Fix skewed stack traces in the Tachyon profiler when caching is enabled and when generators and coroutines are profiled, by updating tstate->last_profiled_frame at every frame-removal site. The issue resulted in total erasure of some callers. Patch by Maurycy Pawłowski-Wieroński.

  • gh-151426: Fix impossible stack traces (callers and callees cross called, orphans and incorrect lines) in the Tachyon profiler when caching frames, by snapshotting the stack chunks before walking the frame chain on a cache miss. Patch by Maurycy Pawłowski-Wieroński.

  • gh-151403: Fixed a crash in subprocess.Popen (and _posixsubprocess.fork_exec) when an argv item’s __fspath__() concurrently mutates the args sequence being converted.

  • gh-151390: Colorize match in the REPL when followed by a unary + or - operator. Patch by Bartosz Sławecki.

  • gh-151128: Cross-language keyword suggestions are now shown for SyntaxError messages. For example, switch x: suggests match, delete x suggests del, function f(): suggests def. Contributed by Zang Langyan.

  • gh-151126: Fix crash on unset MemoryError on allocation failure in ctypes.get_errno().

  • gh-151416: Fix a crash in os.spawnv() and os.spawnve() when an argv item’s __fspath__() method mutates the argv list during argument conversion. os.spawnv() argument conversion errors other than TypeError, such as the ValueError for an embedded null, are no longer replaced with a generic TypeError.

  • gh-151337: Avoid possible memory leak in tkinter.c on Windows.

  • gh-150285: pydoc now uses all available space (80 columns) for formatting reprs of module and class data, but ensure that they do not overflow.

  • gh-151126: Fix a crash when MemoryError in os._path_splitroot() was not set properly.

  • gh-149671: Restore compatibility with setuptools -nspkg.pth files in the site module. Inject sitedir variable in the frame which executes pth code. Patch by Victor Stinner.

  • gh-119710: Fix asyncio subprocess wait() hanging when the process has exited but one of its pipes is kept open by an inherited child process (so the pipe never reaches EOF). wait() now returns as soon as the process exits, regardless of the pipes’ state.

  • gh-150994: Make type annotations in the private _colorize module resolvable.

  • gh-151295: Fixed a crash (use-after-free) in bytes.join() and bytearray.join() that could occur if an item’s __buffer__() concurrently mutates the sequence being joined. The mutation is now reported as a RuntimeError instead.

  • gh-109940: Fix Windows venv activation in cmd.exe to respect VIRTUAL_ENV_DISABLE_PROMPT.

  • gh-117807: Fix mimetypes initialization from MIME map files containing invalid UTF-8 bytes.

  • gh-151179: Fix a pidfd leak in _PidfdChildWatcher on Linux: the watcher no longer leaks the process file descriptor when waitpid() fails with an error other than ChildProcessError.

  • gh-80384: weakref.ref() and weakref.proxy() now raise TypeError if the callback argument is not callable or None.

  • gh-150771: Fix email messages created with shift_jis or euc-jp charsets. set_content() now stores the payload using the output charset (iso-2022-jp) so printing the message no longer raises UnicodeEncodeError.

  • gh-150285: pydoc now wraps long single-line summary in text output.

  • gh-151039: Fix a crash when static datetime types outlive the _datetime module.

  • gh-151042: Fixed venv exporting mixed path styles to PATH on Windows inside fish (via Cygwin, MinGW or MSYS2)

  • gh-151021: Fix mmap.mmap.find() and rfind() to return -1 when searching for an empty subsequence with a start position past the end of the mapping.

  • gh-151022: Fix _remote_debugging stack traces for code objects with large line tables.

  • gh-150994: Make the type annotations in the private _colorize module resolvable.

  • gh-62825: Encodings “KS_C_5601-1987”, “KS X 1001”, etc are now aliases of “CP949” instead of “EUC-KR”.

  • gh-150913: Fix sqlite3.Blob slice assignment to raise TypeError and IndexError for type and size mismatches respectively, even when the target slice is empty.

  • gh-140006: The venv activate.fish script now calls fish builtins through builtin so a user function that shadows ./source, echo, printf, set_color, or functions can no longer hijack the virtual environment prompt or break exit-status reporting.

  • gh-143008: Fix race conditions when re-initializing a io.TextIOWrapper object.

  • gh-150889: Speed up unicodedata.normalize() for the NFC and NFKC forms of non-ASCII text up to a factor 2.

  • gh-150898: Unconditionally assume ssl.SSLContext.keylog_filename exists.

  • gh-150886: Remove the private, undocumented function importlib._bootstrap._object_name(). It had no caller after load_module() and its deprecation warnings were removed from importlib.

  • gh-150583: Correctly set the default compression level in compression.zstd when passing a digested dictionary during compression.

  • gh-150866: Fix asyncio.loop.shutdown_asyncgens() to report any BaseException raised during asynchronous generator cleanup.

  • gh-150662: Fix the --gecko collector in profiling.sampling that kept every sample in memory. It now writes sample and marker data to temporary files and reads them back, ultimately building the output file at the end. Patch by Pablo Galindo and Maurycy Pawłowski-Wieroński.

  • gh-150820: Speed up json.dumps() for small documents. Patch by Bernát Gábor.

  • gh-150818: Speed up logging.getLogger() with a lock-free fast path that returns an already-registered logger without acquiring the logging lock. Patch by Bernát Gábor.

  • gh-150817: Speed up the |, & and ^ operations on enum.Flag members. Patch by Bernát Gábor.

  • gh-150750: Fix a race condition in collections.deque.index() with free-threading.

  • gh-150717: Avoid an unnecessary per-call memory allocation when matching re patterns that have no capturing groups. Patch by Bernát Gábor.

  • gh-150685: Update bundled pip to 26.1.2

  • gh-150641: Fix bug where typing.evaluate_forward_ref() with the STRING format could leak internal names used by the annotation machinery.

  • gh-150942: Speed up re.findall(), re.sub() and re.subn() by appending result items to the output list without an extra reference-count round-trip (using the internal reference-stealing list append helper).

  • gh-150942: Speed up json.loads() decoding of arrays and objects by storing parsed values into the result list/dict without an extra reference-count round-trip (using the internal reference-stealing append/insert helpers).

  • gh-150478: Add show_jit option to dis.dis to show JIT entry points in the bytecode. This is useful for visualizing where JIT traces are entered from the interpreter.

  • gh-148932: Fix profiling.sampling on Windows virtual environments to resolve the actual Python PID from a virtual environment shim.

  • gh-150534: Added trigonometric functions that work in units of half turns, rather than radians. The new functions math.acospi(), math.asinpi(), math.atanpi(), and math.atan2pi() return half-turn angles. The new functions math.cospi(), math.sinpi(), and math.tanpi() take half-turn angle arguments. These functions are recommended by IEEE 754-2019 and standardized in C23.

  • gh-150228: The new site.StartupState class lets callers batch-process PEP 829 startup configuration files across multiple site directories before any startup code runs, with public addsitedir(), addusersitepackages(), addsitepackages(), and process() methods. The signature of site.addsitedir() is unchanged from Python 3.14. The defer_processing_start_files argument and the process_startup_files() function added earlier in the 3.15 cycle have been removed; use site.StartupState instead.

  • gh-150479: email.utils.formataddr() now raises ValueError when the name or address contains a carriage return or line feed, matching email.headerregistry.Address. This check can be disabled by passing strict=False.

  • gh-150449: sqlite3.Blob now supports negative-step slices for reading and writing (e.g. blob[9:0:-2]). Previously, such slices would raise SystemError or ValueError.

  • gh-150406: Fix a possible crash occurring during socket module initialization when the system is out of memory on platforms without a reentrant gethostbyname.

  • gh-150372: readline: Fix a potential crash during tab completion caused by an out-of-memory error during module initialization.

  • gh-132372: Speed up logging.config.fileConfig() and logging.config.dictConfig() when handling many existing loggers.

  • gh-150157: Fix a crash in free-threaded builds that occurs when pickling by name objects without a __module__ attribute while sys.modules is concurrently being modified.

  • gh-150175: Fix race condition in unittest.mock.ThreadingMock where concurrent calls could lose increments to call_count and other attributes due to a missing lock in _increment_mock_call.

  • gh-84353: Preserve non-UTF-8 encoded filenames when appending to a zipfile.ZipFile. Previously, non-ASCII names stored in a legacy encoding (without the UTF-8 flag bit set) could be corrupted when the central directory was rewritten: they were decoded as cp437 and then re-stored as UTF-8.

  • gh-150077: Fix tarfile.TarFile.zstopen to close the underlying zstd file object when opening the tar archive is interrupted by a BaseException subclass such as KeyboardInterrupt.

  • gh-149980: Fix tarfile so that GNU long-name directory entries have all trailing slashes stripped from their names, matching the behavior for short-name entries. Previously, only a single trailing slash was removed.

  • gh-127949: Remove the deprecated asyncio event loop policy system. Patch by Kumar Aditya.

  • gh-149816: Fix race condition in ssl.SSLContext.sni_callback

  • gh-149189: Revert the changes to pprint defaults. Patch by Hugo van Kemenade.

  • gh-79413: Update dataclasses.make_dataclass() to add a qualname parameter. The qualname parameter will be used to set the __qualname__ of the created dataclass.

  • gh-149816: Fix a potential use after free condition in pickle.dumps() in free-threaded mode when serializing lists.

  • gh-149995: Update various docstrings in typing.

  • gh-88726: The email package now uses standard MIME charset names “gb2312” and “big5” instead of non-standard names “eucgb2312_cn” and “big5_tw”.

  • gh-53144: The email package now supports all aliases of Python codecs and uses MIME/IANA names for all IANA registered charsets.

  • gh-149571: Fix the C implementation of xml.etree.ElementTree.Element.itertext(): it no longer emits text for comments and processing instructions.

  • gh-146406: Add cross-language hints for .clear() on tuple, frozenset, and frozendict, suggesting the mutable counterpart. Follow-up to gh-146406.

  • gh-149921: Fix reference leaks in error paths of the _interpchannels and _interpqueues extension modules.

  • gh-149891: Add support for more encoding aliases officially registered in IANA.

  • gh-142349: Add lazy to the list of support topic by help().

  • gh-149819: Fix regression in site.addsitedir() where .pth files were no longer processed in Python subprocesses. This happened because site.main() seeded known_paths with entries inherited from the parent process, causing addsitedir to skip .pth processing.

  • gh-62259: Add support for multiple multi-byte encodings in the XML parser: “cp932”, “cp949”, “cp950”, “Big5”,”EUC-JP”, “GB2312”, “GBK”, “johab”, and “Shift_JIS”. Add partial support (only BMP characters) for multi-byte encodings “Big5-HKSCS”, “EUC_JIS-2004”, “EUC_JISX0213”, “Shift_JIS-2004”, “Shift_JISX0213”, “utf-8-sig” and non-standard aliases like “UTF8” (without hyphen). The parser now raises ValueError for known unsupported multi-byte encodings such us “ISO-2022-JP” or “raw-unicode-escape” instead of failing later, when encounter non-ASCII data.

  • gh-149816: Fix a race condition in _random.Random.__init__ method in free-threading mode.

  • gh-149801: Add IANA registered names and aliases with leading zeros before number (like IBM00858, CP00858, IBM01140, CP01140) for corresponding codecs.

  • gh-149473: Calling os.environ.clear() now emits os._clearenv auditing event. Patch by Victor Stinner.

  • gh-149720: Remove support for undotted ext in mimetypes.MimeTypes.add_type().

  • gh-149718: Coalesce consecutive identical stack frames in Tachyon, so aggregating collectors (pstats, collapsed, flamegraph, gecko) receive one collect. Improves sample rate 3x, error rate and missed rate drop by 70%. Patch by Maurycy Pawłowski-Wieroński.

  • gh-149701: Fix bad return code from Lib/venv/bin/activate if hashing is disabled

  • gh-149504: Fix site.addsitedir() to allow re-entrant calls from within startup files. Previously, a .pth file containing an import line that called site.addsitedir() (or a .start entry point doing the same) could crash with RuntimeError: dictionary changed size during iteration during site initialization, breaking tools such as uv run --with.

  • gh-149584: Fix excessive overhead in the Tachyon profiler when inspecting a remote process by avoiding repeated remote page-cache scans, batching predicted remote reads, and reusing cached profiler result objects. Patch by Pablo Galindo and Maurycy Pawłowski-Wieroński.

  • gh-149609: Raise DeprecationWarning on using abc.abstractclassmethod, abc.abstractstaticmethod, and abc.abstractproperty, schedule its removal for Python 3.21.

  • gh-149634: Remove deprecated and unused tarfile.TarInfo.tarfile attribute.

  • gh-139489: Add xml.is_valid_text() to xml.__all__.

  • gh-149614: Fix a regression that broke the ability to deepcopy argparse.ArgumentParser instances.

  • gh-149600: Remove deprecated asyncio.iscoroutinefunction() function.

  • gh-149598: Remove support of deprecated strm argument for logging handlers.

  • gh-149595: Remove the sys._enablelegacywindowsfsencoding() function which has been deprecated since Python 3.13.

  • gh-149567: Remove the shutil.ExecError exception which has been deprecated since Python 3.14.

  • gh-112821: In the REPL, autocompletion might run arbitrary code in the getter of a descriptor. If that getter raised an exception, autocompletion would fail to present any options for the entire object. Autocompletion now works as expected for these objects.

  • gh-149436: Improve performance of inspect.getattr_static().

  • gh-149534: Fix merging of collections.defaultdict and frozendict.

  • gh-149537: Remove kw parameters from python version of functools.reduce() function.

  • gh-80480: Remove deprecated 'u' type code (wchar_t) for the array module. Use 'w' format code instead (Py_UCS4, always 4 bytes).

  • gh-149530: Removed symtable.Class.get_methods() which has been deprecated since 3.14.

  • gh-149528: Remove annotationlib.ForwardRef._evaludate deprecated method.

  • gh-149388: Make asyncio.windows_utils.PipeHandle closing idempotent.

  • gh-149499: Removed the sysconfig.expand_makefile_vars() function which has been deprecated since Python 3.14. Use the vars argument of sysconfig.get_paths() instead.

  • gh-149489: Fix ElementTree serialization to HTML. The content of comments, processing instructions and elements “xmp”, “iframe”, “noembed”, “noframes”, and “plaintext” is no longer escaped. The “plaintext” element no longer have the closing tag. Add support of empty attributes (with value None).

  • gh-149319: The asyncio REPL now ignores PYTHONSTARTUP and PYTHON_BASIC_REPL when -E or -I is used. Patch by Jonathan Dung.

  • gh-149464: Add os.pidfd_getfd() for duplicating a file descriptor from another process via a pidfd. Available on Linux 5.6+. Patch by Maurycy Pawłowski-Wieroński.

  • gh-149056: Fix json.load() not forwarding the array_hook argument to json.loads(). Patch by Thomas Kowalski.

  • gh-149046: io: Fix io.StringIO serialization: no longer call str(obj) on str subclasses. Patch by Thomas Kowalski.

  • gh-118158: Ensure py_compile CLI error messages end with a newline. Contributed by Xiao Yuan.

  • gh-148954: Fix XML injection vulnerability in xmlrpc.client.dumps() where the methodname was not being escaped before interpolation into the XML body.

  • gh-148441: xml.parsers.expat: prevent a crash in CharacterDataHandler() when the character data size exceeds the parser’s buffer size.

  • gh-119670: Add keyword-only parameter force to shlex.quote() to force quoting a string, even if it is already safe for a shell without being quoted.

  • gh-92455: Fix mimetypes to prefer case-sensitive matches for suffix mappings and MIME type suffixes before falling back to case-insensitive matches. Contributed by Xiao Yuan.

  • gh-148736: Fix a latent AttributeError in asyncio call-graph capture when walking an async generator’s ag_await chain: the walker referenced cr_frame instead of ag_frame.

  • gh-148665: socket.shutdown function is now enabled for Emscripten builds. However, if the runtime does not implement the shutdown syscall, it will show “Function not implemented” error.

  • gh-147950: Bind yank-arg to M-_ in the REPL.

  • gh-146452: Fix segfault in pickle when pickling a dictionary concurrently mutated by another thread in the free-threaded build.

  • gh-47005: Fix urllib.request.AbstractHTTPHandler.do_open() to give regular headers set via add_header() priority over unredirected headers, consistent with get_header() and header_items().

  • gh-145107: Simplify asyncio.staggered_race by using eager_start=False.

  • gh-140729: Fix a pickling error in the cProfile module when profiling a script that uses multiprocessing.Process with the spawn and forkserver start methods.

  • gh-143988: Fixed crashes in socket.socket.sendmsg() and socket.socket.recvmsg_into() that could occur if buffer sequences are concurrently mutated.

  • gh-143008: Fix crash in io.TextIOWrapper when reentrant io.TextIOBase.detach() is called reentrantly from the underlying buffer.

  • gh-81881: shutil.copyfile() now raises SpecialFileError for sockets and device files.

  • gh-140924: Add locale.localize(), locale.delocalize() and platform-specific locale constants from the _locale module to locale.__all__.

  • gh-115634: Fix a deadlock in concurrent.futures.ProcessPoolExecutor when using max_tasks_per_child, present since the feature was introduced in Python 3.11. The executor stopped scheduling queued tasks after a worker process exited upon reaching its task limit. Based on a fix proposed by Tabrez Mohammed.

  • gh-140344: The classes ast.slice, ast.ExtSlice, ast.Index, ast.Suite, ast.AugLoad, ast.AugStore, and ast.Param, deprecated since Python 3.9, now issue deprecation warnings on use. They are now scheduled for removal in Python 3.21.

    The dims property of ast.Tuple objects, deprecated since Python 3.9, now issues a deprecation warning when accessed. The property is scheduled for removal in Python 3.21. Use the (non-deprecated) elts property of ast.Tuple objects instead.

    The deprecated global names are also no longer imported by from ast import *.

  • gh-140326: Fix the asyncio REPL namespace so that relative imports no longer resolve against the asyncio package and __file__ is no longer set.

  • gh-139398: Add supported _sunder_ names to the dir() method of the enum module to support them in REPL autocompletion.

  • gh-139819: rlcompleter: Avoid suggesting attributes that are not accessible on instances (e.g., Enum members showing __name__). Patch by Peter (ttw225).

  • gh-79638: Disallow all access in urllib.robotparser if the robots.txt file is unreachable due to server or network errors.

  • gh-86533: The os.makedirs() function and pathlib.Path.mkdir() method now have a parent_mode parameter to specify the mode for intermediate directories when creating parent directories. This allows one to match the behavior from Python 3.6 and earlier for os.makedirs().

  • gh-64192: Add the optional buffersize parameter to multiprocessing.pool.Pool.imap() and multiprocessing.pool.Pool.imap_unordered() to limit the number of submitted tasks whose results have not yet been yielded. If the buffer is full, iteration over the iterables pauses until a result is yielded from the buffer. To fully utilize pool’s capacity when using this feature, set buffersize at least to the number of processes in pool (to consume iterable as you go), or even higher (to prefetch the next N=buffersize-processes arguments).

  • gh-51067: Add remove() and repack() to ZipFile.

  • gh-134261: zip: On reproducible builds, ZipFile uses UTC instead of the local time when writing file datetimes to avoid underflows.

  • gh-133998: Fix struct.error exception when creating a file with gzip.GzipFile or compressing data with gzip.compress() if the system time is outside the range 00:00:00 UTC, January 1, 1970 through 06:28:15 UTC, February 7, 2106, or explicitly passed mtime argument is outside the range 0 to 2**32-1.

  • gh-68164: Fix zipfile.ZipFile.writestr() so it sets the “regular file” bit by default.

  • gh-46927: Prevent readline from overriding the COLUMNS and LINES environment variables, as values are not updated on terminal resize.

  • gh-72902: Optimize (~x1.4 speedup) fractions.Fraction.from_decimal() and fractions.Fraction.from_float() for Decimal and float inputs, respectively. Patch by Sergey B Kirpichev.

  • gh-128110: Fix bug in the parsing of email address headers that could result in extraneous spaces in the decoded text when using a modern email policy. Space between pairs of adjacent RFC 2047 encoded-words is now ignored, per section 6.2 (and consistent with existing parsing of unstructured headers like Subject).

  • gh-129382: The venv.EnvBuilder and venv.create() APIs now use the platform-dependent default for symlinks from venv’s command-line interface.

  • gh-107398: Fix tarfile stream mode exception when process the file with the gzip extra field.

  • gh-121109: Fix tarfile performance issue when reading archives in streaming mode (e.g. r|*).

  • gh-120665: Fixed an issue where unittest loaders would load and instantiate unittest.TestCase-derived subclasses that are also abstract base classes, which can’t be instantiated.

  • gh-115988: lzma adds constants to support the newer BCJ filters for ARM64 and RISC-V.

  • gh-108518: The iterator returned by concurrent.futures.Executor.map() is no longer automatically closed if a function call raises an exception. Use method close() to explicitly close the iterator.

  • gh-113329: Fix OSError being raised when trying to run doctests on a class objects in the REPL. Patch by Sten Wessel.

  • gh-105708: Accept an uppercase V prefix in IPvFuture addresses in urllib.parse.urlsplit().

  • gh-103925: Fix csv.Sniffer.sniff() for a sample with \r\n line endings in which a quoted field ends a line: a letter could be detected as the delimiter.

  • gh-60055: Let urllib.robotparser.RobotFileParser accept a urllib.request.Request object as well as a url string when setting a robots.txt url.

  • gh-102967: A bug in doctest._SpoofOut.truncate() was causing None to be passed to StringIO.seek() when no size was given. A simple fix skips the seek call when no size is given so the buffer can be truncated from the current position.

  • gh-91099: imaplib.IMAP4.login() now raises exceptions with str instead of bytes. Patch by Florian Best.

  • gh-82039: http.cookiejar.FileCookieJar.load() now checks the first, format signature line in a case-insensitive manner. Patch by Ashley Harvey.

  • gh-101267: When a worker process terminates unexpectedly, concurrent.futures.ProcessPoolExecutor now sets a separate BrokenProcessPool exception on each pending future instead of sharing a single instance among them all. Sharing one exception produced malformed tracebacks: each Future.result() call re-raised the same object, appending another copy of the traceback to it.

  • bpo-46375: Add io.BytesIO.peek() method to read without advancing position.

  • bpo-47216: Added mtime option to gzip.open(), which will be passed to the constructor of GzipFile.

  • gh-70758: Creating a new turtle screen after the previous one was closed no longer raises turtle.Terminator on the first turtle command.

  • bpo-45509: Gzip headers are now checked for corrupted NAME, COMMENT and HCRC fields.

  • gh-75245: socket.socket.makefile() now supports line buffering (buffering=1) in text mode, as open() does and as it worked in Python 2. Previously it silently used block buffering. In binary mode it now emits a RuntimeWarning and uses the default buffer size, also as open() does.

  • bpo-44012: The exploded attribute of ipaddress.IPv6Address and ipaddress.IPv6Interface now supports addresses with a scope ID (link-local addresses). Previously the former raised AddressValueError and the latter omitted the scope ID.

  • bpo-40469: TimedRotatingFileHandler now uses the creation time instead of the last modification time of an existing log file as the basis for the first rotation after handler creation, if supported by the OS and file system. This allows it to be used in short-running programs that start and end before the rotation interval expires.

  • bpo-42861: Add next_network() and next_network(). Patch by Faisal Mahmood.

  • gh-84687: The os.exec* functions now set the filename attribute of the raised FileNotFoundError or NotADirectoryError to the program name passed by the caller.

  • gh-83869: Fix tarfile reading an archive with a GNU sparse 1.0 member whose size is set in the pax extended header. The offset of the next header was computed from the offset of the data, which is already past the sparse map, and from the size of the member, which can be the apparent size of the sparse file. All following members were unreachable.

  • gh-61366: http.cookiejar.MozillaCookieJar now reads session cookies written by curl and Wget, which use 0 in the expiration time field. Contributed by Jérémie Detrey.

IDLE

  • gh-82183: When the shell is busy running code, using “Run… Customized” with “Restart shell” unchecked now reports that the shell is executing instead of restarting it anyway.

  • gh-83653: Blanking an integer entry in IDLE’s Settings dialog, such as “Auto squeeze min lines”, no longer saves an empty string as an invalid configuration value.

  • gh-65339: Saving the IDLE Shell or an Output window now defaults to a .txt extension and lists text files before Python files, since their content is not Python source.

  • gh-80504: The “In files:” field of IDLE’s Find in Files dialog now always contains a full directory path, even for an unsaved editor or the Shell. This shows in the grep output which directory was searched.

  • gh-134300: Do not add the idlelib directory to the path of the IDLE user process. User code run in IDLE can no longer import idlelib submodules as top-level modules, such as import help.

  • gh-89360: Fix a rare crash in the IDLE editor when the completion window is closed: deleting a key binding for a sequence that is not bound to the virtual event is now ignored instead of raising a ValueError.

  • gh-71956: Fix Replace All in the IDLE editor’s Replace dialog when the search direction is “Up” and “Wrap around” is off: it now replaces all matches above the current position instead of only the first one.

  • gh-152728: Move functions run.fix_scaling, editor.fixwordbreaks (as fix_word_breaks) and pyshell.fix_x11_paste to idlelib.util.

  • gh-66331: Set the WM_CLASS window property of IDLE’s windows to Idle on X11, so that window managers group and label them correctly instead of using the default Toplevel.

  • gh-85320: IDLE now reads and writes its configuration files and the breakpoints file using UTF-8 instead of the locale encoding. This keeps non-ASCII data (such as non-ASCII paths) from being corrupted and makes the files portable between environments.

  • bpo-6699: Warn the user if a file will be overwritten when saving.

Documentation

  • gh-118150: Clarify in the difflib documentation what junk actually does, its drawbacks, and how to control it.

  • gh-86726: Greatly expand the tkinter documentation to cover the full public API of the package and its submodules. The descriptions are oriented towards Python rather than Tcl/Tk, with corrected return types and versionadded/versionchanged information.

  • gh-150319: Generic builtin and standard library types now document the meaning of their type parameters.

  • gh-109503: Fix documentation for shutil.move() on usage of os.rename() since nonatomic move might be used even if the files are on the same filesystem. Patch by Fang Li

Core and Builtins

  • gh-155752: Fix a crash when a types.GenericAlias argument gains a __typing_subst__ hook after the alias parameters have been cached.

  • gh-155504: Fix a crash when thread state creation fails before the thread state is fully initialized.

  • gh-129752: Don’t update adaptive counters in the free-threaded build when thread-local bytecode is disabled (-X tlbc=0). Patch by Donghee Na.

  • gh-155515: Track the internal HAMT iterators, which back iteration over a contextvars.Context, with the garbage collector. A reference cycle running through such an iterator was never collected, leaking the whole context it iterated over.

  • gh-155400: Fix a deadlock in the free-threaded build between two threads assigning to a special method of the same class. While applying the type slot updates with the world stopped, only the type lock was prevented from being released; the type dict mutex could still be released and re-acquired, in the wrong order, if the thread blocked on the stop-the-world mutex.

  • gh-155315: Fix marshal so that a frozendict referenced more than once in the serialized data round-trips correctly, instead of failing to load with ValueError. Patch by tonghuaroot.

  • gh-155363: Fix a leak in the free-threaded build when creating a thread state fails after an internal QSBR slot has been reserved for it. The slot could never be reclaimed, so the QSBR array grew without bound across repeated failures.

  • gh-154701: Fix an infinite loop in JIT when a FOR_ITER side exit links an executor back to itself.

  • gh-154937: Fix a data race on thread handle identifiers when _thread._shutdown() runs concurrently with the startup of non-daemon threads in the free-threaded build.

  • gh-154902: Fix a crash when __conditional_annotations__ is rebound to a non-set object.

  • gh-133931: Fix data races when setting attributes of function objects on the free threaded build.

  • gh-154775: When matching a complex literal in case statements, an extraneous + sign (for example, 1++1j or 1-+1j) is no longer allowed.

  • gh-154709: Fix an out-of-bounds access in reverse dictionary iterators when the underlying dictionary is cleared and modified after the iterator is created.

  • gh-154695: Fix asyncio.Task raising AttributeError when created with eager_start=True and no explicit loop argument.

  • gh-154044: Fix a data race on a descriptor’s __qualname__ cache in the free-threaded build.

  • gh-154196: Improve AttributeError messages from unresolved lazy imports. Patch by Bartosz Sławecki.

  • gh-153809: Fix interpreter crash while deallocating objects of asyncio.Task on free-threaded builds. Contributed by Sergey Miryanov.

  • gh-154429: Slightly speed up deallocation of objects that are not tracked by the garbage collector, such as int, float and str.

  • gh-154275: Fix a crash when getting deeply nested __parameters__ from a types.GenericAlias objects.

  • gh-154043: Fix a data race when iterating a shared types.GenericAlias iterator from multiple threads under the free-threaded build.

  • gh-154014: Fix a JIT assertion during interpreter shutdown by initializing vm_data fields for cold executors that bypass _Py_ExecutorInit().

  • gh-153932: Fix thread safety issue in the __reduce__ method of enumerate.

  • gh-153881: Fix potential data race when calling __getstate__() under the free-threaded build.

  • gh-153785: AttributeError: The default error message is now generated from name and obj attributes when both are set and the exception was constructed with no positional arguments, or with a single positional argument equal to name. Patch by Bartosz Sławecki.

  • gh-152075: Reduced lock contention during LOAD_GLOBAL bytecode specialization under free threading.

  • gh-78959: Add the order parameter to memoryview.cast(). With order='F' it creates a zero-copy Fortran-contiguous (column-major) view of a flat buffer, mirroring the order argument of memoryview.tobytes().

  • gh-153570: Fix a use-after-free in bytearray.take_bytes() when the argument’s __index__() method resizes the bytearray. Patch by tonghuaroot.

  • gh-153568: Speed up the parser by caching repeated identifiers during a parse.

  • gh-153568: Speed up the parser by letting memoization lookups that cannot match return immediately.

  • gh-153419: Fix multiple bytearray crashes and reference leaks caused by skipping __init__() and broken state setup code.

  • gh-153298: Fixes a data race in types.GenericAlias __parameters__ initialization on free-threading builds.

  • gh-153205: Fix a potential SystemError during vector calls when memory allocation fails. A MemoryError is now raised instead.

  • gh-153171: Improve syntax error messages for misplaced not after an operator in contexts where a generic “invalid syntax” error was previously reported, such as 1 << 2 + not x and 1 * + not x.

  • gh-153236: Propagate exceptions raised while importing lazy submodules instead of reporting them as missing attributes.

  • gh-102960: Frame objects now support weak references. Patch by Łukasz Langa.

  • gh-152682: Fix NULL pointer dereference in compile() when a reserved name (e.g. __classdict__) is used as a type parameter name and memory allocation fails while formatting the error message.

  • gh-152635: Fix a crash caused when running out of memory creating a _interpchannels channel. Now a MemoryError is correctly raised.

  • gh-152405: Do not expose the internal mapping of types.MappingProxyType when performing rich-compare operations with non-stdlib types. Previously, it was possible to mutate the internal mapping of a proxy there. Now we pass not the original dict instance, but its copy, when dealing with custom types.

  • gh-152492: collections.OrderedDict update method can now accept frozendict as an argument.

  • gh-152375: Fix undefined behaviour when a sys.monitoring callback raised an exception while the program was following a branch or loop.

  • gh-152192: Fix a truncated oparg being passed to JIT trace initialization for a JUMP_BACKWARD with an EXTENDED_ARG.

  • gh-152235: Defer GC tracking of set.intersection(), set.difference(), set.symmetric_difference(), set.union() and set.__sub__. Patch by Donghee Na.

  • gh-152235: Defer GC tracking of a set or frozenset to the end of its construction from iterable. Patch by Donghee Na.

  • gh-152228: Fix an assertion failure when python is built in a debug mode that happened in str.replace() under a limited memory situation.

  • gh-151722: frozendict.fromkeys() now only tracks the frozendict in the garbage collector once the dictionary is fully initialized. Patch by Donghee Na and Victor Stinner.

  • gh-151763: Fixes possible crash on types.CodeType deallocation.

  • gh-152020: On the free-threaded build, asyncio.all_tasks() no longer loses eager-started tasks when called from a thread other than the one running the event loop.

  • gh-151763: Fix a potential crash in compile(), exec(), eval() and ast.parse() when an allocation fails: the parser or compiler could return without setting an exception.

  • gh-151912: Fixed a crash in type() when selecting a metaclass whose tp_new slot is NULL. Such metaclasses are now rejected with TypeError instead of causing a NULL pointer dereference.

  • gh-151895: Fixed a crash in marshal.loads() when an allocation failed while loading a reference-tracked dictionary; it now raises MemoryError.

  • gh-151905: Fix OOM error handling in PyFrame_GetBack() to propagate exceptions instead of masking them as None.

  • gh-151907: Avoid creating list objects in comprehensions when the comprehension is not used as a value.

  • gh-151773: Fix a crash in contextvars.ContextVar.set() when memory allocation fails.

  • gh-151665: inspect.signature() now works on the lazy evaluators of type aliases and type parameters instead of raising ValueError.

  • gh-151672: Fix an inconsistency where calling __lazy_import__ with a string fromlist would return a types.LazyImportType that resolves to the named member, rather than the module being imported.

  • gh-151722: Defer GC tracking of frozendict to end of construction. Patch by Donghee Na.

  • gh-151619: Fix an issue where using non-module global or builtin namespaces (such as dictionaries passed to exec()) could cause cached global loads to produce unresolved lazy imports.

  • gh-151646: Fix a data race in free-threading builds between gc.get_stats() and a concurrent garbage collection cycle. Access to the per-generation statistics is now serialized with a mutex so the reader observes a consistent snapshot.

  • gh-151126: Fix a crash when sharing memoryview objects between interpreters fails due to running out of memory. It now raises a proper MemoryError.

  • gh-151644: Fix a data race in sys.setdlopenflags() and sys.getdlopenflags() when called concurrently in the free-threaded build. The underlying _PyImport_GetDLOpenFlags and _PyImport_SetDLOpenFlags functions now use atomic load/store operations.

  • gh-151126: Avoid possible crash in _winapi.c where a device has no memory left. Now it properly raises a MemoryError. Patch by Ivy Xu.

  • gh-151126: Avoid possible crash in getpath.c where a device has no memory left. Now it properly raises a MemoryError. Patch by Ivy Xu.

  • gh-151546: Fix the stack limit check if Python is linked to musl (ex: Alpine Linux). Use the stack size set by the linker to compute the stack limits. Patch by Victor Stinner.

  • gh-151510: Fix a crash in __lazy_import__() when called without an explicit globals argument and without a current Python frame.

  • gh-151461: Fix direct execution of files with invalid source encodings to report the underlying codec lookup or decoding error instead of the generic SyntaxError: encoding problem message. Patch by Bartosz Sławecki.

  • gh-151377: Fix races in free-threaded builds when updating type slots for newly created classes and when removing entries from a base type’s subclasses dictionary.

  • gh-151218: PyConfig_Set() and sys.set_int_max_str_digits() now replace sys.flags (create a new object), instead of modifying sys.flags in-place. Patch by Victor Stinner.

  • gh-151297: Fix an invalid pointer dereference that could occur when calling PyObject_Realloc() with a NULL pointer in free-threaded builds or with PYTHONMALLOC set to mimalloc.

  • gh-151253: If import encodings (first import) fails at Python startup, dump the Python path configuration to help users debugging their configuration. Patch by Victor Stinner.

  • gh-151238: Fix a crash when compiling a concatenated f-string or t-string if an error occurs when processing one of it’s parts.

  • gh-151112: Fix a crash in the compiler that could occur when running out of memory.

  • gh-151126: Fix a crash, when there’s no memory left on a device, which happened in: code compilation, _interpchannels module, _winapi.CreateProcess() function.

    Now these places raise proper MemoryError errors.

  • gh-150902: Apply an existing optimization of PyCriticalSection (single mutex) to PyCriticalSection2: avoid acquiring the same locks that the current CS has already acquired.

  • gh-151065: Fix memory leak when using the mimalloc memory allocator.

  • gh-151029: On Linux, fix sys.remote_exec() unable to find remote writable memory when libpython replaced on disk.

  • gh-150942: Speed up frame local variable item collection by appending result pairs to the output list without an extra reference-count round-trip (using the internal reference-stealing list append helper). Patch by Omkar Kabde.

  • gh-150988: Fix a reference leak in OSError when attributes are set before super().__init__().

  • gh-145685: The internal method cache used for types is now a per-type cache instead of a global per-interpreter one, improving performance and reducing cache misses. Patch by Kumar Aditya.

  • gh-146495: Improve SyntaxError message for && and || operators, suggesting and/& and or/| respectively.

  • gh-148874: Ignore interrupts immediately after calling the __enter__ method of a context menager in a with statement. This ensures that the __exit__ method is always called in a with statement.

  • gh-150459: Fix SyntaxError error message for from x lazy import y. Raise SyntaxWarning on from . lazy import x (with whitespace between the dots and a module named lazy).

  • gh-150858: Fix a data race while changing __qualname__ of a type concurrently on free-threaded builds.

  • gh-150723: Fix perf jitdump timestamps on macOS. Events were stamped using CLOCK_MONOTONIC, but macOS profilers timestamp their samples with mach_absolute_time(). The mismatch prevented the JIT code mappings from lining up with the samples, so no Python frame could be resolved.

  • gh-150723: Fix malformed perf jitdump thread ids on macOS. The thread_id field of the JR_CODE_LOAD record was written as a 64-bit value instead of the 32-bit value required by the jitdump format, which shifted every following field and prevented profilers from resolving Python frames.

  • gh-150700: Fix a SystemError when compiling a class-scope comprehension containing a lambda that references __class__, __classdict__, or __conditional_annotations__. Patch by Bartosz Sławecki.

  • gh-150633: Fix the frozen importer accepting module names with embedded null bytes, which caused it to bypass the sys.modules cache and create duplicate module objects.

  • gh-144774: Fix data race in BaseException when an exception is copied while being mutated.

  • gh-150411: Fix a data race in the free-threaded build when gc.get_count() reads the young generation allocation count while another thread updates it.

  • gh-150374: Fix double release of the import lock on lazy import reification errors.

  • gh-148613: Fix a data race in the free-threaded build between gc.set_threshold() and garbage collection scheduling during object allocation.

  • gh-149156: Fix an intermittent crash after os.fork() when perf trampoline profiling is enabled and the child returns through trampoline frames inherited from the parent process.

  • gh-149449: Fix a use-after-free crash when the unicodedata module was removed from sys.modules and garbage-collected between calls that decode \N{...} escapes or use the namereplace codec error handler.

  • gh-150207: Fix a crash when a memory allocation fails during tokenizer initialization. A proper MemoryError is now raised instead.

  • gh-150107: asyncio: sendfile() and sock_sendfile() event loop methods now call file.seek(offset) if file has a seek() method, even if offset is 0 (default value).

  • gh-150208: Avoid double-quoting string values from pyconfig.h in sysconfigdata variables.

  • gh-150146: Fix a crash on a complex type variable substitution.

    from typing import TypeVar; memoryview[TypeVar("")][*typing.Mapping[..., ...]] used to fail due to missing NULL check on _unpack_args C function call.

  • gh-148587: sys.lazy_modules is now a set instead of a dict as initially spelled out in PEP 810.

  • gh-150027: Improve performance of frozenset objects by avoiding copies during construction.

  • gh-150042: Fix refleak in queue.SimpleQueue.put if memory allocation fails.

  • gh-149590: Fix crash when faulthandler is imported more than once.

  • gh-138325: Speed up converting a list to a tuple in the tuple(genexpr) fast path and in starred tuple displays (e.g. (*a, *b)) by stealing the list’s items into the tuple instead of copying them.

  • gh-149816: Fix a race condition in _PyBytes_FromList in free-threading mode.

  • gh-149816: Fix a race condition in memoryview with free-threading.

  • gh-149807: Fix hash(frozendict): compute the hash of each (key, value) pair correctly. Patch by Victor Stinner.

  • gh-149805: Fix a SystemError when compiling a compiling __classdict__ class annotation. Found by OSS-Fuzz in #512907042.

  • gh-149738: sqlite3: Disallow removing row_factory and text_factory attributes of a connection to prevent a crash on a query.

  • gh-139808: Add branch protections for AArch64 (BTI/PAC) in assembly code used by -X perf_jit (Linux perf profiler integration).

  • gh-127727: Warn when running a virtual environment created for a different minor Python version than the current interpreter, and suggest using python -m venv --upgrade.

  • gh-148871: The empty tuple () is now loaded via LOAD_COMMON_CONSTANT instead of LOAD_CONST, removing it from per-code-object co_consts tuples.

  • gh-149689: Fix missing error propagation in parser action helpers when memory allocation fails. Patch by Thomas Kowalski.

  • gh-149676: Fix frozendict | frozendict hash.

  • gh-148829: sentinel objects now support a repr= argument and their __module__ attribute is writable.

  • gh-149642: Allow imports inside exec() calls within functions under PYTHON_LAZY_IMPORTS=all.

  • gh-144957: Fix lazy from imports of module attributes provided by module-level __getattr__.

  • gh-149459: Fix a crash in the JIT optimizer when a specialized LOAD_SPECIAL guard deoptimized after inserting the synthetic NULL stack entry.

  • gh-149321: Do not support none as a lazy imports mode.

  • gh-149162: Fix a potential deadlock in PyUnicode_InternFromString() and other interning functions in the free-threaded build when called from C++ static local initializers.

  • gh-148817: Fold large constant list and set literals used as the iterable of a for loop or in/not in test into a constant tuple or frozenset, restoring an optimization previously done by the AST optimizer that was lost when constant folding moved to the CFG.

  • gh-148825: Fix build error if specialization is disabled.

  • gh-148450: Fix abc.register() so it invalidates type version tags for registered classes.

  • gh-75723: Avoid re-executing .pth files when site.addsitedir() is called for a known directory.

  • gh-145857: The DELETE_GLOBAL opcode is now replaced with PUSH_NULL; STORE_GLOBAL.

  • gh-145855: The DELETE_ATTR opcode is now replaced with PUSH_NULL; STORE_ATTR.

  • gh-145854: The DELETE_NAME opcode is now replaced with PUSH_NULL; STORE_NAME.

  • gh-91484: memoryview.cast() now allows casting from N-D to 1-D for F-contiguous.

  • gh-85260: compile() now raises ValueError instead of crashing on a debug build if an identifier field of an AST node (such as the name of a function, a class, an imported module or a caught exception) is "None", "True" or "False".

  • bpo-38131: Produce more meaningful messages when compiling AST objects with wrong field values. Patch by Batuhan Taskaya.

C API

Build

  • gh-90604: configure no longer sets MULTIARCH on OpenBSD platforms.

  • gh-154271: Define _XOPEN_SOURCE=600 on Solaris and illumos, so that on illumos the socket module is built with sendmsg(), recvmsg() and the CMSG_* helpers. This also enables the forkserver multiprocessing start method.

  • gh-154136: Fix building the math module on FreeBSD. Define _ISOC23_SOURCE to make the C23 library declarations (such as sinpi() in math.h) visible.

  • gh-154070: Build the curses module against a wide-character capable ncurses even when it is not named ncursesw – for example the pkgsrc ncurses on NetBSD and illumos, or the system ncurses on macOS. Such a library previously produced a narrow build.

  • gh-152902: Added Intel icx compiler support to configure.ac. Contributed by High Performance Kernels LLC.

  • gh-154055: The curses and curses.panel modules can now be built against a curses library that lacks the X/Open attr_t and soft-label attribute functions, scr_set() or resizeterm() – such as the native SVr4 curses of illumos and Solaris. These functions are probed and used only when present.

  • gh-136687: Add the --with-curses option to configure to select the curses backend (ncursesw, ncurses or the system’s native curses) or, as --without-curses, to exclude the curses and curses.panel modules from the build.

  • gh-126877: Fix the configure check for Tcl/Tk which could wrongly succeed with optimizing compilers when the libraries are missing.

  • gh-153511: Removes the legacy MSI and Nuget build scripts, the legacy py.exe launcher (now replaced by the Python install manager), and adds a PC/layout readme.

  • gh-153438: Update Windows build and installer tooling and documentation to use the current download URL for nuget.exe.

  • gh-152870: Fix a compilation error in the decimal C extension (_decimal) when it is built with EXTRA_FUNCTIONALITY. Context.apply() called the internal _apply helper using its pre-Argument-Clinic signature; the call is now made through the generated _impl function.

  • gh-152769: Enable the perf profiler trampoline on Alpine Linux with the musl C library on x86_64 and aarch64. The trampoline is architecture-specific and does not depend on the C library, so the same assembly trampoline used for glibc is reused for musl.

  • gh-152502: The curses module now detects its optional functions with configure capability probes instead of assuming ncurses, so it builds against narrow (non-wide) ncurses and other curses implementations such as NetBSD curses, exposing exactly the functions they provide.

  • gh-152240: Fix C stack unwinding tests on Linux LoongArch builds by teaching the manual frame pointer unwinder to recognize the LoongArch frame layout.

  • gh-151163: Updated Android build to include SQLite version 3.53.2.

  • gh-115119: Fix the detection of libmpdec header when no .pc files are available.

  • gh-148294: Corrected the use of AC_PATH_TOOL in configure.ac to allow a C++ compiler to be found on PATH.

  • gh-131372: Add a --with-build-details-suffix configure flag to allow Linux distributions that co-install multiple versions of Python in the same tree to avoid build-details.json clashes.

  • gh-148260: On Linux when Python is linked to the musl C library, use a thread stack size of at least 1 MiB instead of musl default which is 128 kiB. Patch by Victor Stinner.

  • gh-148832: Fix --enable-bolt build by switching the default BOLT flag from -icf=1 to -icf=0. -icf=1 folds address-taken functions and breaks type-slot dispatch, crashing on list and tuple concatenation. Patched by Shamil Abdulaev.

  • gh-138800: Fix library name in python3.pc on Android.

  • gh-139314: Add the --with-zlib and --with-bzip2 configure options to select the zlib and bzip2 implementations used to build the zlib and bz2 modules. In addition to the default system libraries, they can build against zlib-rs and libbzip2-rs, and --with-zlib=zlib-ng verifies that the detected zlib is zlib-ng. --without-zlib and --without-bzip2 exclude the modules from the build.

  • gh-115119: Removed bundled copy of the libmpdec, use system library if it’s available. Patch by Sergey B Kirpichev.

Python 3.15.0 beta 1

Release date: 2026-05-07

Security

  • gh-149254: Update Android and iOS installer to use OpenSSL 3.5.6.

  • gh-149017: Update bundled libexpat to version 2.8.0.

  • gh-148252: Fixed string table and sample record bounds checks in _remote_debugging when decoding certain .pyb inputs on 32-bit builds. Patch by Maurycy Pawłowski-Wieroński.

  • gh-90309: Base64-encode values when embedding cookies to JavaScript using the http.cookies.BaseCookie.js_output() method to avoid injection and escaping.

  • gh-148808: Added buffer boundary check when using nbytes parameter with asyncio.AbstractEventLoop.sock_recvfrom_into(). Only relevant for Windows and the asyncio.ProactorEventLoop.

  • 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-146581: Fix vulnerability in shutil.unpack_archive() for ZIP files on Windows which allowed to write files outside of the destination tree if the patch in the archive contains a Windows drive prefix. Now such invalid paths will be skipped. Files containing “..” in the name (like “foo..bar”) are no longer skipped.

  • gh-137586: Fix a PATH-injection vulnerability in webbrowser on macOS where osascript was invoked without an absolute path. The new MacOS class uses /usr/bin/open directly, eliminating the dependency on osascript entirely.

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

Core and Builtins

  • gh-148940: Revert the process size based deferral of garbage collection (gh-133464). The performance issue this change resolves is also fixed by gh-142562. This approach has the problem that process size as seen by the OS (e.g. the resident size or RSS) does not immediately decrease after cyclic garbage is freed since mimalloc defers returning memory of the OS. This change applies to the free-threaded GC only.

  • gh-149243: Check for recursion limits in CALL_ALLOC_AND_ENTER_INIT opcode.

  • gh-126910: Add support for unwinding JIT frames using GNU backtrace. Patch by Diego Russo and Pablo Galindo

  • gh-149171: Allow assignment to the __module__ attribute of typing.TypeAliasType instances.

  • gh-149122: Fix a crash in optimized calls to all(), any(), tuple(), list(), and set() with an async generator expression argument (for example, tuple(await x for x in y)). These calls now correctly raise TypeError instead of crashing.

  • gh-149049: Fix stack underflow for BINARY_OP in tier 2.

  • gh-83065: Fix a deadlock that could occur when one thread is importing a submodule (for example import pkg.sub.mod) while another thread is importing one of its parent packages (for example import pkg.sub) and that parent’s __init__.py itself imports the submodule. The import system now acquires module locks in hierarchical (parent-before-child) order so the two threads serialise instead of raising _DeadlockError.

  • gh-113956: Fix a data race in sys.intern() in the free-threaded build when interning a string owned by another thread. An interned copy owned by the current thread is used instead when it is not safe to immortalize the original.

  • gh-148850: Fix the memory sanitizer false positive in os.getrandom().

  • gh-148820: Fix a race in _PyRawMutex on the free-threaded build where a Py_PARK_INTR return from _PySemaphore_Wait could let the waiter destroy its semaphore before the unlocking thread’s _PySemaphore_Wakeup completed, causing a fatal ReleaseSemaphore error.

  • gh-148829: Add sentinel, implementing PEP 661. PEP by Tal Einat; patch by Jelle Zijlstra.

  • gh-146270: Fix a sequential consistency bug in structmember.c.

  • gh-148766: The interpreter help (such as python --help) is now in color. Patch by Hugo van Kemenade.

  • gh-148571: Fix a crash in the JIT optimizer when specialized opcode families inherited incompatible recorded operand layouts.

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

  • gh-142516: Forward-port the generational cycle garbage collector to the default 3.15 build, replacing the incremental collector while leaving the free-threaded collector unchanged.

  • gh-146462: Added PyTypeObject.tp_basicsize, PyTypeObject.tp_dictoffset, and PyHeapTypeObject.ht_cached_keys offsets to _Py_DebugOffsets to support version-independent read-only dict introspection tools.

  • gh-145239: Unary plus is now accepted in match literal patterns, mirroring the existing support for unary minus. Patch by Bartosz Sławecki.

  • 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-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream.

  • 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-146527: Add a GCMonitor class with a get_gc_stats method to the _remote_debugging module to allow reading GC statistics from an external Python process without requiring the full RemoteUnwinder functionality. Patch by Sergey Miryanov and Pablo Galindo.

  • 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-148189: Repaired undercount of bytes in type-specific free lists reported by sys._debugmallocstats(). For types that participate in cyclic garbage collection, it was missing two pointers used by GC.

  • 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-149202: Enable frame pointers by default for GCC-compatible CPython builds, including -mno-omit-leaf-frame-pointer, -marm on 32-bit ARM, and/or -mbackchain on s390x platforms when the compiler supports them, so profilers and debuggers can unwind native interpreter frames more reliably. Users can pass --without-frame-pointers to ./configure to opt out.

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

  • gh-147998: Fixed a memory leak in interpreter helper calls so cleanup works when an operation falls across interpreter boundaries. Patch by Maurycy Pawłowski-Wieroński.

  • gh-146455: Fix O(N²) compile-time regression in constant folding after it was moved from AST to CFG optimizer.

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

  • gh-142186: Global sys.monitoring events can now be turned on and disabled on a per code object basis. Returning DISABLE from a callback disables the event for the entire code object (for the current tool).

  • gh-126910: Add support for unwinding JIT frames using GDB. Patch by Diego Russo and Pablo Galindo.

  • 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-98894: Restore function__entry and function__return DTrace/SystemTap probes that were broken since Python 3.11.

  • gh-116021: Support for creating instances of abstract AST nodes from the ast module is deprecated and scheduled for removal in Python 3.20. Patch by Brian Schubert.

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

  • gh-137600: ast: The constructors of AST nodes now raise a TypeError when a required argument is omitted or when a keyword argument that does not map to a field on the AST node is passed. These cases had previously raised a DeprecationWarning since Python 3.13. Patch by Brian Schubert.

  • gh-137293: Fix SystemError when searching ELF Files in sys.remote_exec().

  • gh-135357: Add support for socket.SO_PASSRIGHTS on Linux.

  • gh-134690: Removed deprecated in PEP 626 since Python 3.12 codeobject.co_lnotab from types.CodeType.

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

Library

  • gh-148823: Defer the import of _colorize in argparse until needed for coloring output.

  • gh-141560: Add an annotation_format parameter to inspect.getfullargspec().

  • gh-139489: Add the xml.is_valid_text() function, which allows to check whether a string can be used in the XML document.

  • gh-142389: Add backticks to stdlib argparse help to display in colour. Patch by Hugo van Kemenade.

  • gh-149377: Update bundled pip to 26.1.1

  • gh-142389: Add backtick markup support in argparse option help text to highlight inline code when color output is enabled. Patch by Hugo van Kemenade.

  • gh-148675: Remove F and D formats from array and memoryview. Patch by Victor Stinner.

  • gh-149342: Fix _remote_debugging binary writing so that sampling a thread whose Python frame stack is empty (for example while it is in a C call or mid-syscall) no longer raises RuntimeError("Invalid stack encoding type"), and so that BinaryWriter.total_samples after finalize() or context-manager exit includes samples flushed from the RLE buffer. Patch by Maurycy Pawłowski-Wieroński.

  • gh-149010: The inspect module CLI now reports as much information as it has available for non-source modules when --details is specified, and provides an error message rather than a traceback when --details is omitted. It also reports improved information when the given target location is not the target’s defining location and when the given target is a data value rather than a class or function definition.

  • gh-146609: Use argparse for colour help timeit CLI. Patch by Hugo van Kemenade.

  • gh-142389: Add backticks for colour to regrtest and pdb’s help description. Patch by Hugo van Kemenade.

  • gh-144384: Lazily import _colorize. Patch by Hugo van Kemenade.

  • gh-149321: Fix import cycles exposed by running standard library modules with -X lazy_imports=none.

  • gh-145378: Generate consistent colors for pdb commands in pdb REPL.

  • gh-149296: Add a dump subcommand to profiling.sampling that prints a single traceback-style snapshot of a running process’s Python stack, including per-thread status, source line highlighting, optional bytecode opcode names, and async-aware task reconstruction. Patch by Pablo Galindo.

  • gh-143231: A module attribute has been added to warnings.WarningMessage.

  • gh-148675: ctypes: Change the _type_ of c_float_complex, c_double_complex and c_longdouble_complex from F, D and G to Zf, Zd and Zg for compatibility with numpy. Patch by Victor Stinner.

  • gh-148675: The array.typecodes type changed from str to tuple to support type codes longer than 1 character (Zf and Zd). Patch by Victor Stinner.

  • gh-149221: Catch rare math domain error for random.binomialvariate().

  • gh-149231: In tomllib, the number of parts in TOML keys is now limited.

  • gh-143231: unittest.TestCase.assertWarns() and unittest.TestCase.assertWarnsRegex() no longer swallow warnings that do not match the specified category or regex. Nested context managers are now supported.

  • gh-149214: Fix _remote_debugging misreading non-ASCII Unicode strings (Latin-1, BMP and non-BMP) from a remote process. Filenames and function names that contain non-ASCII characters are now reported correctly in stack traces, the sampling profiler, and asyncio task introspection.

  • gh-149189: pprint now uses modern defaults: indent=4 and width=88, and the default compact=False output is now formatted similar to pretty-printed json.dumps(), with opening parentheses and brackets followed by a newline and the contents indented by one level. The expand parameter, added in 3.15.0a8, has been removed; compact=False (the default) now produces the former expand=True layout. Patch by Hugo van Kemenade.

  • gh-149173: Fix inverted PYTHON_BASIC_REPL environment check in pdb._pyrepl_available.

  • gh-149117: Fix runpy.run_module() and runpy.run_path() to set the name attribute on the ImportError they raise.

  • gh-149148: ensurepip: Upgrade bundled pip to 26.1. This version fixes the CVE 2026-3219 vulnerability. Patch by Victor Stinner.

  • gh-149009: Validate that profiling.sampling binary profiles do not contain more unique (thread, interpreter) pairs than declared in the header. Patch by Maurycy Pawłowski-Wieroński.

  • gh-148292: ssl: Update ssl.SSLSocket and ssl.SSLObject for OpenSSL 4. The classes now remember if they get a ssl.SSLEOFError. In this case, following read(), sendfile(), write(), and do_handshake() calls raise ssl.SSLEOFError without calling the underlying OpenSSL function. Thanks to that, ssl.SSLSocket behaves the same on all OpenSSL versions on EOF. Patch by Victor Stinner.

  • gh-149085: Add a max_threads keyword argument to faulthandler.dump_traceback(), faulthandler.dump_traceback_later(), faulthandler.enable(), and faulthandler.register().

  • gh-148641: pkgutil.resolve_name() gets a new optional, keyword-only argument called strict. The default is False for backward compatibility.

  • gh-148093: Fix an out-of-bounds read of one byte in binascii.a2b_uu(). Raise binascii.Error, instead of reading past the buffer end.

  • gh-149083: dataclasses.MISSING and dataclasses.KW_ONLY are now instances of sentinel.

  • gh-148914: Fix memoization of in-band PickleBuffer in the Python implementation of pickle. Previously, identical PickleBuffers did not preserve identity, and empty writable PickleBuffer memoized an empty bytearray object in place of b'', so the following references to b'' were unpickled as an empty bytearray object.

  • gh-149026: Add colour to pickletools CLI output. Patch by Hugo van Kemenade.

  • gh-148991: Add colour to tokenize CLI output. Patch by Hugo van Kemenade.

  • gh-138907: Support RFC 9309 in urllib.robotparser.

  • gh-148981: Add color parameter to ast.dump().

  • gh-148849: Deprecate http.cookies.Morsel.js_output() and http.cookies.BaseCookie.js_output(), which will be removed in Python 3.19. Use http.cookies.Morsel.output() or http.cookies.BaseCookie.output() instead.

  • gh-146311: Add a canonical keyword-only parameter to the base16, base32, base64, base85, ascii85, and Z85 decoders in base64 and binascii. When true, encodings with non-zero padding bits (base16/32/64) or non-canonical encodings (base85/ascii85) are rejected. Single-character final groups in binascii.a2b_ascii85() and binascii.a2b_base85() are now always rejected as encoding violations, regardless of canonical; previously they were silently ignored and produced no output bytes.

  • gh-148947: Fix crash in @dataclasses.dataclass with slots=True that occurred when a function found within the class had an empty __class__ cell.

  • gh-148680: ForwardRef objects that contain internal names to represent known objects now show the type_repr of the known object rather than the internal __annotationlib_name_x__ name when evaluated as strings.

  • gh-124397: The threading module added tooling to support concurrent iterator access: threading.serialize_iterator, threading.synchronized_iterator(), and threading.concurrent_tee().

  • gh-148801: xml.etree.ElementTree: Fix a crash in Element.__deepcopy__ on deeply nested trees.

  • gh-148735: xml.etree.ElementTree: Fix a use-after-free in Element.findtext when the element tree is mutated concurrently during the search.

  • gh-148740: Fix usage for uuid command-line interface to support a custom namespace be provided for uuid3 and uuid5.

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

  • gh-148675: array, struct: Add support for Zd and Zf formats for double complex and float complex. Patch by Victor Stinner.

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

  • gh-148641: PEP 829 (package startup configuration files) implements a new format <name>.start parallel to <name>.pth files, to replace import lines in the latter.

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

  • gh-148615: Fix pdb to accept standard – end of options separator. Reported by haampie. Patched by Shrey Naithani.

  • gh-146553: Fix infinite loop in typing.get_type_hints() when __wrapped__ forms a cycle. Patch by Shamil Abdulaev.

  • gh-148599: Update the socket module’s WSA error messages to match official documentation.

  • 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-148518: If an email containing an address header that ended in an open double quote was parsed with a non-compat32 policy, accessing the username attribute of the mailbox accessed through that header object would result in an IndexError. It now correctly returns an empty string as the result.

  • 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-148352: Add more color to calendar’s CLI output. Patch by Hugo van Kemenade.

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

  • gh-130472: Integrate fancycompleter with import completions.

  • 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-148207: typing.TypeVarTuple now accepts bound, covariant, contravariant, and infer_variance parameters, matching the interface of typing.TypeVar and typing.ParamSpec.

  • 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-147991: Improve tomllib import time (up to 10x faster). Patch by Victor Stinner.

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

  • gh-146256: The profiling.sampling module now supports JSONL output format via --jsonl. Each run emits a newline-delimited JSON file that is sequentially parseable by external tools, scripts, and programmatic consumers. Patch by Maurycy Pawłowski-Wieroński.

  • 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-137586: Add MacOS to webbrowser for macOS, which opens URLs via /usr/bin/open instead of piping AppleScript to osascript. Deprecate MacOSXOSAScript in favour of MacOS.

  • gh-146406: Cross-language method suggestions are now shown for AttributeError on builtin types and their subclasses. For example, [].push() suggests append, (1,2).append(3) suggests using a list, None.keys() suggests expecting a dict, and 1.0.__or__ suggests using an int.

  • 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-145917: Add MIME types for TTC and Haptics formats to mimetypes. (Contributed by Charlie Lin in gh-145918.)

  • 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-145378: Use PyREPL as the default input console for pdb

  • 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-145056: Add support for frozendict in dataclasses.asdict() and dataclasses.astuple().

  • 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-130750: Restore quoting of choices in argparse error messages for improved clarity and consistency with documentation.

  • gh-137855: Reduce the import time of dataclasses module by ~20%.

  • 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-108411: typing.IO and typing.BinaryIO method arguments are now positional-only.

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

  • gh-142307: imaplib: deprecate support for IMAP4.file. This attribute was never meant to be part of the public interface and altering its value may result in unclosed files or other synchronization issues with the underlying socket. Patch by Bénédikt Tran.

  • gh-141449: Improve tests and documentation for non-function callables as annotate functions.

  • gh-140287: The asyncio REPL now handles exceptions when executing PYTHONSTARTUP scripts. Patch by Bartosz Sławecki.

  • gh-139489: Add the xml.is_valid_name() function, which allows to check whether a string can be used as an element or attribute name in XML.

  • gh-75707: Add optional mtime argument to tarfile.open(), for setting the mtime header field in .tar.gz archives.

  • gh-125862: The contextlib.contextmanager() and contextlib.asynccontextmanager() decorators now work correctly with generators, coroutine functions, and async generators when the wrapped callables are used as decorators.

  • gh-135528: http.cookiejar: add “tv”, “or”, “nom”, “sch”, and “web” to the default list of supported country code second-level domains.

  • gh-135056: Add a -H or --header CLI option to python -m http.server. Contributed by Anton I. Sipos.

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

  • gh-133956: Fix bug where @dataclass wouldn’t detect ClassVar fields if ClassVar was re-exported from a module other than typing.

  • gh-132631: Fix “I/O operation on closed file” when parsing JSON Lines file with JSON CLI.

  • gh-108951: asyncio: Add TaskGroup.cancel which cancels unfinished tasks and exits the group without raising asyncio.CancelledError.

  • 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-122476: The email module no longer incorrectly uses RFC 2047 encoding for a mailbox with non-ASCII characters in its local-part. Under a policy with utf8 set False, attempting to serialize such a message will now raise an HeaderWriteError. There is no valid 7-bit encoding for an internationalized local-part. Use email.policy.SMTPUTF8 (or another policy with utf8=True) to correctly pass through the local-part as Unicode characters.

  • gh-83938: The email module no longer incorrectly uses RFC 2047 encoding for a mailbox with non-ASCII characters in its domain. Under a policy with utf8 set False, attempting to serialize such a message will now raise an HeaderWriteError. Either apply an appropriate IDNA encoding to convert the domain to ASCII before serialization, or use email.policy.SMTPUTF8 (or another policy with utf8=True) to correctly pass through the internationalized domain name as Unicode characters.

  • gh-81074: The email module no longer treats email addresses with non-ASCII characters as defects when parsing a Unicode string or in the addr_spec parameter to email.headerregistry.Address. RFC 5322 permits such addresses, and they were already supported when parsing bytes and in the Address username parameter.

    The (undocumented) email.errors.NonASCIILocalPartDefect is no longer used and should be considered deprecated.

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

  • gh-113471: Allow http.server to set a default content-type when serving files with an unknown or missing extension.

  • gh-83281: email: improve handling trailing garbage in address lists to avoid throwing AttributeError in certain edge cases

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

Documentation

Tests

  • gh-149425: Increase time delta in test.test_zipfile.test_core.OtherTests.test_write_without_source_date_epoch

  • gh-148600: Add OpenSSL 4.0.0 support to test configurations.

Build

  • gh-149353: Avoid unnecessary JIT-related rebuilds during make install after --enable-optimizations builds.

  • gh-149351: Avoid possible broken macOS framework install names when DESTDIR is specified during builds.

  • gh-149252: Update to WASI SDK 33.

  • gh-148690: Windows free-threaded builds now output to a different default path with default filenames, for example, PCbuild/amd64t/python.exe rather than PCbuild/amd64/python3.15t.exe. The PC/layout script has been updated to ensure compatibility of generated layouts.

  • gh-146475: Block Apple Clang from being used to build the JIT as it ships without required LLVM tools.

  • gh-148644: Errors during the PGO training job on Windows are no longer ignored, and a non-zero return code will cause the build to fail.

  • 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-138451: Allow for custom LLVM path using LLVM_TOOLS_INSTALL_DIR during JIT build.

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

Windows

  • gh-149254: Updated bundled version of OpenSSL to 3.5.6.

  • gh-148690: Non-freethreaded builds on Windows now support extensions linked to python3t.dll, and will include a copy of that library in normal installs that references the non-freethreaded runtime.

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

macOS

  • gh-142295: For Python macOS framework builds, update Info.plist files to be more compliant with current Apple guidelines. Original patch contributed by Martinus Verburg.

  • gh-149254: Update macOS installer to use OpenSSL 3.5.6.

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.

C API

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

Build

  • gh-138489: When cross-compiling for WASI by build_wasm or build_emscripten, the build-details.json step is now included in the build process, just like with native builds.

    This fixes the libinstall task which requires the build-details.json file during the process.

  • gh-138497: The LLVM version used by the JIT at build time can now be modified using the LLVM_VERSION environment variable. Use this at your own risk, as there is only one officially supported LLVM version. For more information, please check Tools/jit/README.md.

  • gh-95952: When cross-compiling for WASI, require that the HOSTRUNNER environment variable be explicitly set.

    This was needed as macOS lacks the appropriate CLI tools to set a reasonable default.

  • gh-138061: Ensure reproducible builds by making JIT stencil header generation deterministic.

  • gh-128042: ./configure now warns when --enable-optimizations and CFLAGS=-O0 are both set, suggesting removing -O0 from CFLAGS for optimal performance. Patch by Taegyun Kim.

  • gh-132339: Add support for OpenSSL 3.5.

  • gh-135621: PyREPL no longer depends on the curses standard library. Contributed by Łukasz Langa.

  • gh-135927: Fix building with MSVC when passing option /std:clatest.

  • gh-119132: Remove “experimental” tag from the CPython free-threading build.

  • gh-135497: Fix the detection of MAXLOGNAME in the configure.ac script.

  • gh-134923: Windows builds with profile-guided optimization enabled now use /GENPROFILE and /USEPROFILE instead of deprecated /LTCG: options.

  • gh-134632: Fixed build-details.json generation to use INCLUDEPY, in order to reference the pythonX.Y subdirectory of the include directory, as required in PEP 739, instead of the top-level include directory.

  • gh-134486: The ctypes module now performs a more portable test for the definition of alloca(3), fixing a compilation failure on NetBSD.

  • gh-134455: Fixed build-details.json generation to use the correct c_api.headers as defined in PEP 739, instead of c_api.include.

  • gh-134273: Add support for configuring compiler flags for the JIT with CFLAGS_JIT

  • gh-115119: Removed implicit fallback to the bundled copy of the libmpdec library. Now this should be explicitly enabled via --with-system-libmpdec set to no or --without-system-libmpdec. Patch by Sergey B Kirpichev.

  • gh-131769: Fix detecting when the build Python in a cross-build is a pydebug build.

  • gh-117088: AIX linker don’t support -h option, so avoid it through platform check

  • gh-123681: Check the strftime() behavior at runtime instead of at the compile time to support cross-compiling. Remove the internal macro _Py_NORMALIZE_CENTURY.

  • gh-127545: Fix crash when building on Linux/m68k.

Python 3.14.0 beta 1

Release date: 2025-05-06

Windows

Tools/Demos

  • gh-130453: Allow passing multiple keyword arguments with the same function name in pygettext.

  • gh-130195: Add warning messages when pygettext unimplemented -a/--extract-all option is called.

Tests

  • gh-133131: The iOS testbed will now select the most recently released “SE-class” device for testing if a device isn’t explicitly specified.

  • gh-91048: Add ability to externally inspect all pending asyncio tasks, even if no task is currently entered on the event loop.

  • gh-109981: The test helper that counts the list of open file descriptors now uses the optimised /dev/fd approach on all Apple platforms, not just macOS. This avoids crashes caused by guarded file descriptors.

  • gh-132678: Add --prioritize to -m test. This option allows the user to specify which selected tests should execute first, even if the order is otherwise randomized. This is particularly useful for tests that run the longest.

  • gh-131290: Tests in Lib/test can now be correctly executed as standalone scripts.

Security

  • gh-115322: The underlying extension modules behind readline:, subprocess, and ctypes now raise audit events on previously uncovered code paths that could lead to file system access related to C function calling and external binary execution. The ctypes.call_function audit hook has also been fixed to use an unsigned value for its function pointer.

Library

IDLE

  • gh-112936: fix IDLE: no Shell menu item in single-process mode.

Documentation

  • gh-107006: Move documentation and example code for threading.local from its docstring to the official docs.

  • gh-125142: As part of the builtin help intro text, show the keyboard shortcuts for the new, non-basic REPL (F1, F2, and F3).

Core and Builtins

  • gh-133336: -J is no longer reserved for use by Jython. Patch by Adam Turner.

  • gh-133261: Fix bug where the cycle GC could untrack objects in the trashcan because they looked like they were immortal. When objects are added to the trashcan, we take care to ensure they keep a mortal reference count.

  • gh-133346: Added experimental color theming support to the _colorize module.

  • gh-132917: For the free-threaded build, check the process memory usage increase before triggering a full automatic garbage collection. If the memory used has not increased 10% since the last collection then defer it.

  • gh-91048: Add a new python -m asyncio ps PID command-line interface to inspect asyncio tasks in a running Python process. Displays a flat table of await relationships. A variant showing a tree view is also available as python -m asyncio pstree PID. Both are useful for debugging async code. Patch by Pablo Galindo, Łukasz Langa, Yury Selivanov, and Marta Gomez Macias.

  • gh-133304: Workaround NaN’s “canonicalization” in PyFloat_Pack4() and PyFloat_Unpack4() on RISC-V.

  • gh-133197: Improve SyntaxError error messages for incompatible string / bytes prefixes.

  • gh-133231: Add new utilities of observing JIT compilation: sys._jit.is_available(), sys._jit.is_enabled(), and sys._jit.is_active().

Library

Core and Builtins

  • gh-131798: Split CALL_LEN into several uops allowing the JIT to remove them when optimizing. Patch by Diego Russo.

  • gh-131798: Use sym_new_type instead of sym_new_not_null for _BUILD_STRING, _BUILD_SET

  • gh-132942: Fix two races in the type lookup cache. This affected the free-threaded build and could cause crashes (apparently quite difficult to trigger).

  • gh-131798: Propagate the return type of _BINARY_OP_SUBSCR_TUPLE_INT in JIT. Patch by Tomas Roun

  • gh-132952: Speed up startup with the -S argument by importing the private _io module instead of io. This fixes a performance regression introduced earlier in Python 3.14 development and restores performance to the level of Python 3.13.

  • gh-131798: Allow the JIT to remove int guards after _CALL_LEN by setting the return type to int. Patch by Diego Russo

  • gh-131798: Split CALL_TUPLE_1 into several uops allowing the JIT to remove some of them. Patch by Tomas Roun

  • gh-131798: Split CALL_STR_1 into several uops allowing the JIT to remove some of them. Patch by Tomas Roun

  • gh-132825: Enhance unhashable key/element error messages for dict and set. Patch by Victor Stinner.

  • gh-131591: Reset any PEP 768 remote debugging pending call in children after os.fork() calls.

  • gh-132713: Fix repr(list) race condition: hold a strong reference to the item while calling repr(item). Patch by Victor Stinner.

  • gh-132661: Implement PEP 750 (Template Strings). Add new syntax for t-strings and implement new internal string.templatelib.Template and string.templatelib.Interpolation types.

  • gh-132479: Fix compiler crash in certain circumstances where multiple module-level annotations include comprehensions and other nested scopes.

  • gh-132747: Fix a crash when calling __get__() of a method with a None second argument.

  • gh-132744: Certain calls now check for runaway recursion and respect the system recursion limit.

  • gh-132449: Syntax errors that look like misspellings of Python keywords now provide a helpful fix suggestion for the typo. Contributed by Pablo Galindo Salgado.

Library

  • gh-132737: Support profiling code that requires __main__, such as pickle.

Core and Builtins

  • gh-132639: Added PyLong_AsNativeBytes(), PyLong_FromNativeBytes() and PyLong_FromUnsignedNativeBytes() to the limited C API.

  • gh-100239: Add specialisation for BINARY_OP/SUBSCR on list and slice.

  • gh-132508: Uses tagged integers on the evaluation stack to represent the instruction offsets when reraising an exception. This avoids the need to box the integer which could fail in low memory conditions.

  • gh-124476: Fix decoding from the locale encoding in the C.UTF-8 locale.

  • gh-131927: Compiler warnings originating from the same module and line number are now only emitted once, matching the behaviour of warnings emitted from user code. This can also be configured with warnings filters.

  • gh-132457: Make staticmethod() and classmethod() generic.

  • gh-131798: Use sym_new_type instead of sym_new_not_null for _BUILD_LIST, _BUILD_SET, _BUILD_MAP

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

  • gh-132386: Fix crash when passing a dict subclass as the globals parameter to exec().

  • gh-127682: No longer call __iter__ twice when creating and executing a generator expression. Creating a generator expression from a non-interable will raise only when the generator expression is executed. This brings the behavior of generator expressions in line with other generators.

  • gh-132261: The internal storage for annotations and annotate functions on classes now uses different keys in the class dictionary. This eliminates various edge cases where access to the __annotate__ and __annotations__ attributes would behave unpredictably.

  • gh-132284: Don’t wrap base PyCFunction slots on class creation if not overridden.

  • gh-130415: Improve the JIT’s ability to remove unused constant and local variable loads, and fix an issue where deallocating unused values could cause JIT code to crash or behave incorrectly.

  • gh-126703: Fix possible use after free in cases where a method’s definition has the same lifetime as its self.

  • gh-132286: Fix that type.__annotate__ was not deleted, when type.__annotations__ was deleted.

  • gh-131798: Allow the JIT to remove an extra _TO_BOOL_BOOL instruction after _CONTAINS_OP_DICT by setting the return type to bool.

  • gh-124715: Prevents against stack overflows when calling Py_DECREF(). Third-party extension objects no longer need to use the “trashcan” mechanism, as protection is now built into the Py_DECREF() macro.

  • gh-131798: Allow the JIT compiler to remove some type checks for operations on lists, tuples, dictionaries, and sets.

  • gh-128398: Improve error message when an object supporting the synchronous (resp. asynchronous) context manager protocol is entered using async with (resp. with) instead of with (resp. async with). Patch by Bénédikt Tran.

  • gh-131798: Allow the JIT to remove unicode guards after _BINARY_OP_SUBSCR_STR_INT by setting the return type to string.

  • gh-131878: Handle uncaught exceptions in the main input loop for the new REPL.

  • gh-131878: Fix support of unicode characters with two or more codepoints on Windows in the new REPL.

  • gh-126835: Move constant folding to the peephole optimizer. Rename AST optimization related files (Python/ast_opt.c -> Python/ast_preprocess.c), structs (_PyASTOptimizeState -> _PyASTPreprocessState) and functions (_PyAST_Optimize -> _PyAST_Preprocess, _PyCompile_AstOptimize -> _PyCompile_AstPreprocess).

  • gh-114809: Add support for macOS multi-arch builds with the JIT enabled

  • gh-131507: PyREPL now supports syntax highlighting. Contributed by Łukasz Langa.

  • gh-130907: If the __annotations__ of a module object are accessed while the module is executing, return the annotations that have been defined so far, without caching them.

  • gh-130104: Three-argument pow() now try calling __rpow__() if necessary. Previously it was only called in two-argument pow() and the binary power operator.

  • gh-130070: Fixed an assertion error for exec() passed a string source and a non-None closure. Patch by Bartosz Sławecki.

  • gh-129958: Fix a bug that was allowing newlines inconsistently in format specifiers for single-quoted f-strings. Patch by Pablo Galindo.

  • gh-129858: elif statements that follow an else block now have a specific error message.

  • gh-69605: Add module autocomplete to PyREPL.

  • gh-128555: Add the sys.flags.thread_inherit_context flag.

  • gh-123539: Improve SyntaxError message for using import ... as and from ... import ... as with not a name.

  • gh-102567: -X importtime now accepts value 2, which indicates that an importtime entry should also be printed if an imported module has already been loaded. Patch by Noah Kim and Adam Turner.

  • gh-116436: Improve error message when TypeError occurs during dict.update()

  • gh-103997: String arguments passed to “-c” are now automatically dedented. This allows “python -c” invocations to be indented in shell scripts without causing indentation errors. (Patch by Jon Crall and Steven Sun)

Library

  • gh-89562: Remove hostflags member from PySSLContext struct.

C API

Build

  • gh-113464: Use the cpython-bin-deps “externals” repository for Windows LLVM dependency management. Installing LLVM manually is no longer necessary for Windows JIT builds.

  • gh-133183: iOS compiler shims now include IPHONEOS_DEPLOYMENT_TARGET in target triples, ensuring that SDK version minimums are honored.

  • gh-133167: Fix compilation process with --enable-optimizations and --without-docstrings.

  • gh-133171: Since free-threaded builds do not support the experimental JIT compiler, prevent these configurations from being combined.

  • gh-132758: Fix building with tail call interpreter and pystats.

  • gh-132649: The PClayout script now allows passing --include-tcltk on Windows ARM64.

  • gh-132257: Change the default LTO flags on GCC to not pass -flto-partition=none, and allow parallelization of LTO. For newer GNU makes and GCC, this has a multiple factor speedup for LTO build times, with no noticeable loss in performance.

  • gh-132026: Fix use of undefined identifiers in platform triplet detection on MIPS Linux platforms.

Python 3.14.0 alpha 7

Release date: 2025-04-08

macOS

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

  • gh-131423: Update macOS installer to use OpenSSL 3.0.16. Patch by Bénédikt Tran.

  • gh-131025: Update macOS installer to ship with SQLite 3.49.1.

Windows

  • gh-131423: Update bundled version of OpenSSL to 3.0.16. The new build also disables uplink support, which may be relevant to embedders but has no impact on normal use.

  • gh-131453: Some SND_* and MB_* constants are added to winsound.

  • gh-91349: Replaces our copy of zlib with zlib-ng, for performance improvements in zlib.

  • gh-131025: Update Windows installer to ship with SQLite 3.49.1.

Tools/Demos

  • gh-132121: Always escape non-printable Unicode characters in pygettext.

  • gh-131852: msgfmt no longer adds the POT-Creation-Date to generated .mo files for consistency with GNU msgfmt.

Tests

  • gh-131277: Allow to unset one or more environment variables at once via EnvironmentVarGuard.unset(). Patch by Bénédikt Tran.

  • gh-131050: test_ssl.test_dh_params is skipped if the underlying TLS library does not support finite-field ephemeral Diffie-Hellman.

Security

  • gh-131809: Update bundled libexpat to 2.7.1

  • gh-131261: Upgrade to libexpat 2.7.0

  • gh-121284: Fix bug in the folding of rfc2047 encoded-words when flattening an email message using a modern email policy. Previously when an encoded-word was too long for a line, it would be decoded, split across lines, and re-encoded. But commas and other special characters in the original text could be left unencoded and unquoted. This could theoretically be used to spoof header lines using a carefully constructed encoded-word if the resulting rendered email was transmitted or re-parsed.

Library

Documentation

Core and Builtins

  • gh-131798: Allow the JIT to remove an extra _TO_BOOL_BOOL instruction after _CONTAINS_OP_SET by setting the return type to bool.

  • gh-132011: Fix crash when calling list.append() as an unbound method.

  • gh-131998: Fix a crash when using an unbound method descriptor object in a function where a bound method descriptor was used.

  • gh-131591: Implement PEP 768 (Safe external debugger interface for CPython). Add a new sys.remote_exec() function to the sys module. This function schedules the execution of a Python file in a separate process. Patch by Pablo Galindo, Matt Wozniski and Ivona Stojanovic.

  • gh-131798: Allow JIT to omit str guard in truthiness test when str type is known.

  • gh-131833: Add support for optionally dropping grouping parentheses when using multiple exception types as per PEP 758. Patch by Pablo Galindo

  • gh-130924: Usage of a name in a function-scope annotation no longer triggers creation of a cell for that variable. This fixes a regression in earlier alphas of Python 3.14.

  • gh-131800: Improve the experimental JIT’s ability to remove type checks for certain subscripting operations.

  • gh-131738: Compiler emits optimized code for builtin any/all/tuple calls over a generator expression.

  • gh-131719: Fix missing NULL check in _PyMem_FreeDelayed in free-threaded build.

  • gh-131670: Fix anext() failing on sync __anext__() raising an exception.

  • gh-131666: Fix signature of anext_awaitable.close objects. Patch by Bénédikt Tran.

  • gh-130415: Optimize comparison of two constants in JIT builds

  • gh-129149: Add fast path for small and medium-size integers in PyLong_FromInt32(), PyLong_FromUInt32(), PyLong_FromInt64() and PyLong_FromUInt64(). Patch by Chris Eibl.

  • gh-130887: Optimize the AArch64 code generation for the JIT. Patch by Diego Russo

  • gh-130956: Optimize the AArch64 code generation for the JIT. Patch by Diego Russo

  • gh-130928: Fix error message when formatting bytes using the 'i' flag. Patch by Maxim Ageev.

  • gh-130935: Annotations at the class and module level that are conditionally defined are now only reflected in __annotations__ if the block they are in is executed. Patch by Jelle Zijlstra.

  • gh-130775: Do not crash on negative column and end_column in ast locations.

  • gh-130704: Optimize LOAD_FAST and its superinstruction form to reduce reference counting overhead. These instructions are replaced with faster variants that load borrowed references onto the operand stack when we can prove that the reference in the frame outlives the reference loaded onto the stack.

  • gh-88887: Fixing multiprocessing Resource Tracker process leaking, usually observed when running Python as PID 1.

  • gh-130115: Fix an issue with thread identifiers being sign-extended on some platforms.

Library

  • gh-99108: Add support for built-in implementation of HMAC (RFC 2104) based on HACL*. Patch by Bénédikt Tran.

Core and Builtins

  • gh-130080: Implement PEP 765: Disallow return/break/continue that exit a finally block.

  • gh-129900: Fix return codes inside SystemExit not getting returned by the REPL.

  • gh-128632: Disallow __classdict__ as the name of a type parameter. Using this name would previously crash the interpreter in some circumstances.

  • gh-126703: Improve performance of builtin methods by using a freelist.

  • gh-126703: Improve performance of range by using a freelist.

C API

  • gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen.

  • gh-131525: The PyTupleObject now caches the computed hash value in the new field ob_hash.

Build

  • gh-131865: The DTrace build now properly passes the CC and CFLAGS variables to the dtrace command when utilizing SystemTap on Linux.

  • gh-131675: Fix mimalloc library builds for 32-bit ARM targets.

  • gh-131691: clang-cl on Windows needs option /EHa to support SEH (structured exception handling) correctly. Fix by Chris Eibl.

  • gh-131278: Add optimizing flag WITH_COMPUTED_GOTOS to Windows builds for when using a compiler that supports it (currently clang-cl). Patch by Chris Eibl.

  • gh-130213: Update the vendored HACL* library to fix build issues with older clang compilers.

  • gh-130673: Fix potential KeyError when handling object sections during JIT building process.

Python 3.14.0 alpha 6

Release date: 2025-03-14

macOS

Windows

  • gh-131020: pylauncher correctly detects a BOM when searching for the shebang. Fix by Chris Eibl.

Tools/Demos

  • gh-130453: Make it possible to override default keywords in pygettext.

  • gh-85012: Correctly reset msgctxt when compiling messages in msgfmt.

  • gh-130453: Extend support for specifying custom keywords in pygettext.

  • gh-130195: Add warning messages when pygettext unimplemented -a/--extract-all option is called.

  • gh-130057: Add support for translator comments in pygettext.py.

  • gh-130025: The iOS testbed now correctly handles symlinks used as Python framework references.

  • gh-129911: Fix the keyword entry in the help output of pygettext.

Tests

  • gh-129200: Multiple iOS testbed runners can now be started at the same time without introducing an ambiguity over simulator ownership.

  • gh-130292: The iOS testbed will now run successfully on a machine that has not previously run Xcode tests (such as CI configurations).

  • gh-130293: The tests of terminal colorization are no longer sensitive to the value of the TERM variable in the testing environment.

  • gh-129401: Fix a flaky test in test_repr_rlock that checks the representation of multiprocessing.RLock.

  • gh-126332: Add unit tests for pyrepl.

Security

  • gh-127371: Avoid unbounded buffering for tempfile.SpooledTemporaryFile.writelines(). Previously, disk spillover was only checked after the lines iterator had been exhausted. This is now done after each line is written.

Library

Documentation

Core and Builtins

  • gh-131141: Fix data race in sys.monitoring instrumentation while registering callback.

  • gh-130804: Fix support of unicode characters on Windows in the new REPL.

  • gh-130932: Fix incorrect exception handling in _PyModule_IsPossiblyShadowing

  • gh-122029: sys.setprofile() and sys.settrace() will not generate a c_call event for INSTRUMENTED_CALL_FUNCTION_EX if the callable is a method with a C function wrapped, because we do not generate c_return event in such case.

  • gh-129964: Fix JIT crash on Windows on Arm. Patch by Diego Russo and Brandt Bucher.

  • gh-130851: Fix a crash in the free threading build when constructing a code object with co_consts that contains instances of types that are not otherwise generated by the bytecode compiler.

  • gh-128534: Ensure that both left and right branches have the same source for async for loops. Add these branches to the co_branches() iterator.

  • gh-130794: Fix memory leak in the free threaded build when resizing a shared list or dictionary from multiple short-lived threads.

  • gh-130415: Improve JIT understanding of integers in boolean context.

  • gh-130382: Fix PyRefTracer_DESTROY not being sent from Python/ceval.c Py_DECREF().

  • gh-130574: Renumber RESUME from 149 to 128.

  • gh-124878: Fix race conditions during runtime finalization that could lead to accessing freed memory.

  • gh-130415: Improve the experimental JIT’s ability to narrow boolean values based on the results of truthiness tests.

  • gh-130618: Fix a bug that was causing UnicodeDecodeError or SystemError to be raised when using f-strings with lambda expressions with non-ASCII characters. Patch by Pablo Galindo

  • gh-123044: Make sure that the location of branch targets in match cases is in the body, not the pattern.

  • gh-128534: Add branch monitoring (BRANCH_LEFT and BRANCH_RIGHT events) for async for loops.

  • gh-130163: Fix possible crashes related to concurrent change and use of the sys module attributes.

  • gh-122029: INSTRUMENTED_CALL_KW will expand the method before monitoring to reflect the actual behavior more accurately.

  • gh-130415: Improve JIT’s ability to optimize strings in boolean contexts.

  • gh-130396: Use actual stack limits (from pthread_getattr_np(3)) for linux, and other systems with _GNU_SOURCE defined, when determining limits for C stack protection.

  • gh-128396: Fix a crash that occurs when calling locals() inside an inline comprehension that uses the same local variable as the outer frame scope where the variable is a free or cell var.

  • gh-129107: Fix two more bytearray functions for free threading.

  • gh-127705: Use tagged references (_PyStackRef) for the default build as well as for the free-threading build. This has a small negative performance impact short-term but will enable larger speedups in the future and significantly reduce maintenance costs by allowing a single implementation of tagged references in the future.

  • gh-130094: Fix two race conditions involving concurrent imports that could lead to spurious failures with ModuleNotFoundError.

  • gh-129107: Make bytearray iterator safe under free threading.

  • gh-115802: Use the more efficient “medium” code model for JIT-compiled code on supported platforms.

  • gh-107956: A build-details.json file is now install in the platform-independent standard library directory (PEP 739 implementation).

  • gh-116042: Fix location for SyntaxErrors of invalid escapes in the tokenizer. Patch by Pablo Galindo

  • gh-91079: Change C stack overflow protection to consider the amount of stack consumed, rather than a counter. This allows deeper recursion in many cases, but remains safe.

  • gh-129715: Improve the experimental JIT’s handling of returns to unknown callers.

Library

  • gh-129983: Fix data race in compile_template in sre.c.

Core and Builtins

  • gh-129967: Fix a race condition in the free threading build when repr(set) is called concurrently with set.clear().

  • gh-129953: The internal (evaluation) stack is now spilled to memory whenever execution escapes from the interpreter or JIT compiled code. This should have no observable effect in either Python or builtin extensions, but will allow various important optimizations in the future.

  • gh-129515: Clarify syntax error messages for conditional expressions when a statement is specified before an if or after an else keyword.

  • gh-129349: bytes.fromhex() and bytearray.fromhex() now accepts ASCII bytes and bytes-like objects.

  • gh-129149: Add fast path for medium-size integers in PyLong_FromSsize_t(). Patch by Chris Eibl.

  • gh-129107: Make the bytearray safe under free threading.

  • gh-128974: Fix a crash in UnicodeError.__str__ when custom attributes implement __str__() with side-effects. Patch by Bénédikt Tran.

  • gh-126085: typing.TypeAliasType now supports star unpacking.

  • gh-125331: from __future__ import barry_as_FLUFL now works in more contexts, including when it is used in files, with the -c flag, and in the REPL when there are multiple statements on the same line. Previously, it worked only on subsequent lines in the REPL, and when the appropriate flags were passed directly to compile(). Patch by Pablo Galindo.

  • gh-121464: Make concurrent iterations over the same enumerate() iterator safe under free-threading. See Strategy for Iterators in Free Threading.

  • gh-87790: Support underscore and comma as thousands separators in the fractional part for floating-point presentation types of the new-style string formatting (with format() or f-strings). Patch by Sergey B Kirpichev.

  • gh-124445: Fix specialization of generic aliases that are generic over a typing.ParamSpec and have been specialized with a nested type variable.

  • gh-120608: Adapt reversed() for use in the free-threading build. The reversed() is still not thread-safe in the sense that concurrent iterations may see the same object, but they will not corrupt the interpreter state.

Library

  • gh-100388: Fix the platform._sys_version() method when __DATE__ is undefined at buildtime by changing default buildtime datetime string to the UNIX epoch.

Core and Builtins

  • bpo-44369: Improve syntax errors for incorrectly closed strings. Patch by Pablo Galindo

C API

Build

  • gh-131035: Use -flto=thin for faster build times using clang-cl on Windows. Patch by Chris Eibl.

  • gh-130740: Ensure that Python.h is included before stdbool.h unless pyconfig.h is included before or in some platform-specific contexts.

  • gh-130090: Building with PlatformToolset=ClangCL on Windows now supports PGO (profile guided optimization). Patch by Chris Eibl with invaluable support from Steve Dover.

  • gh-129819: Allow building the JIT with the tailcall interpreter.

  • gh-129989: Fix a bug where the tailcall interpreter was enabled when --without-tail-call-interp was provided to the configure script.

  • gh-129838: Don’t redefine _Py_NO_SANITIZE_UNDEFINED when compiling with a recent GCC version and undefined sanitizer enabled.

  • gh-82909: #pragma-based linking with python3*.lib can now be switched off with Py_NO_LINK_LIB. Patch by Jean-Christophe Fillion-Robin.

Python 3.14.0 alpha 5

Release date: 2025-02-11

macOS

  • gh-91132: Update macOS installer to use ncurses 6.5.

Tools/Demos

  • gh-129248: The iOS test runner now strips the log prefix from each line output by the test suite.

  • gh-104400: Fix several bugs in extraction by switching to an AST parser in pygettext.

Tests

  • gh-129386: Add test.support.reset_code, which can be used to reset various bytecode-level optimizations and local instrumentation for a function.

  • gh-128474: Disable test_embed test cases that segfault on BOLT instrument binaries. The tests are only disabled when BOLT is enabled.

  • gh-128003: Add an option --parallel-threads=N to the regression test runner that runs individual tests in multiple threads in parallel in order to find concurrency bugs. Note that most of the test suite is not yet reviewed for thread-safety or annotated with @thread_unsafe when necessary.

Security

  • gh-105704: When using urllib.parse.urlsplit() and urllib.parse.urlparse() host parsing would not reject domain names containing square brackets ([ and ]). Square brackets are only valid for IPv6 and IPvFuture hosts according to RFC 3986 Section 3.2.2.

  • gh-126108: Fix a possible NULL pointer dereference in PySys_AddWarnOptionUnicode().

  • gh-80222: Fix bug in the folding of quoted strings when flattening an email message using a modern email policy. Previously when a quoted string was folded so that it spanned more than one line, the surrounding quotes and internal escapes would be omitted. This could theoretically be used to spoof header lines using a carefully constructed quoted string if the resulting rendered email was transmitted or re-parsed.

  • gh-119511: Fix a potential denial of service in the imaplib module. When connecting to a malicious server, it could cause an arbitrary amount of memory to be allocated. On many systems this is harmless as unused virtual memory is only a mapping, but if this hit a virtual address size limit it could lead to a MemoryError or other process crash. On unusual systems or builds where all allocated memory is touched and backed by actual ram or storage it could’ve consumed resources doing so until similarly crashing.

Library

IDLE

  • gh-129873: Simplify displaying the IDLE doc by only copying the text section of idle.html to idlelib/help.html. Patch by Stan Ulbrych.

Documentation

Core and Builtins

  • gh-100239: Replace the opcode BINARY_SUBSCR and its family by BINARY_OP with oparg NB_SUBSCR.

  • gh-129732: Fixed a race in _Py_qsbr_reserve in the free threading build.

  • gh-129763: Remove the internal LLTRACE macro (use Py_DEBUG instead).

  • gh-129715: Improve JIT performance for generators.

  • gh-129643: Fix thread safety of PyList_Insert() in free-threading builds.

  • gh-129668: Fix race condition when raising MemoryError in the free threaded build.

  • gh-129643: Fix thread safety of PyList_SetItem() in free-threading builds. Patch by Kumar Aditya.

  • gh-128563: Fix an issue where the “lltrace” debug feature could have been incorrectly enabled for some frames.

  • gh-129393: On FreeBSD, sys.platform doesn’t contain the major version anymore. It is always 'freebsd', instead of 'freebsd13' or 'freebsd14'.

Library

Core and Builtins

  • gh-129231: Improve memory layout of JIT traces. Patch by Diego Russo

  • gh-129149: Add fast path for medium-size integers in PyLong_FromUnsignedLong(), PyLong_FromUnsignedLongLong() and PyLong_FromSize_t().

  • gh-129201: The free-threaded version of the cyclic garbage collector has been optimized to conditionally use CPU prefetch instructions during the collection. This can reduce collection times by making it more likely that data is in the CPU cache when it is needed. The prefetch instructions are enabled if the number of long-lived objects (objects surviving a full collection) exceeds a threshold.

  • gh-129093: Fix f-strings such as f'{expr=}' sometimes not displaying the full expression when the expression contains !=.

  • gh-124363: Treat debug expressions in f-string as raw strings. Patch by Pablo Galindo

  • gh-128714: Fix the potential races in get/set dunder methods __annotations__, __annotate__ and __type_params__ for function object, and add related tests.

  • gh-128799: Add frame of except* to traceback when it wraps a naked exception.

  • gh-128842: Collect JIT memory stats using pystats. Patch by Diego Russo.

  • gh-100239: Specialize BINARY_OP for bitwise logical operations on compact ints.

  • gh-128910: Undocumented and unused private C-API functions _PyTrash_begin and _PyTrash_end are removed.

  • gh-128807: Add a marking phase to the free-threaded GC. This is similar to what was done in gh-126491. Since the free-threaded GC does not have generations and is not incremental, the marking phase looks for all objects reachable from known roots. The roots are objects known to not be garbage, like the module dictionary for sys. For most programs, this marking phase should make the GC a bit faster since typically less work is done per object.

  • gh-100239: Add opcode BINARY_OP_EXTEND which executes a pair of functions (guard and specialization functions) accessed from the inline cache.

  • gh-128563: A new type of interpreter has been added to CPython. This interpreter uses tail calls for its instruction handlers. Preliminary benchmark results suggest 7-11% geometric mean faster on pyperformance (depending on platform), and up to 30% faster on Python-intensive workloads. This interpreter currently only works on newer compilers, such as clang-19. Other compilers will continue using the old interpreter. Patch by Ken Jin, with ideas on how to implement this in CPython by Mark Shannon, Garret Gu, Haoran Xu, and Josh Haberman.

  • gh-126703: Improve performance of iterating over lists and tuples by using a freelist for the iterator objects.

  • gh-127953: The time to handle a LINE event in sys.monitoring (and sys.settrace) is now independent of the number of lines in the code object.

  • gh-128330: Restore terminal control characters on REPL exit.

  • gh-128016: Improved the SyntaxWarning message for invalid escape sequences to clarify that such sequences will raise a SyntaxError in future Python releases. The new message also suggests a potential fix, i.e., Did you mean "\\e"?.

  • gh-126004: Fix handling of UnicodeError.start and UnicodeError.end values in the codecs.replace_errors() error handler. Patch by Bénédikt Tran.

  • gh-126004: Fix handling of UnicodeError.start and UnicodeError.end values in the codecs.backslashreplace_errors() error handler. Patch by Bénédikt Tran.

  • gh-126004: Fix handling of UnicodeError.start and UnicodeError.end values in the codecs.xmlcharrefreplace_errors() error handler. Patch by Bénédikt Tran.

  • gh-127119: Slightly optimize the int deallocator.

  • gh-127349: Fixed the error when resizing terminal in Python REPL. Patch by Semyon Moroz.

  • gh-125723: Fix crash with gi_frame.f_locals when generator frames outlive their generator. Patch by Mikhail Efimov.

Library

Core and Builtins

  • gh-115911: If the current working directory cannot be determined due to permissions, then import will no longer raise PermissionError. Patch by Alex Willmer.

Library

C API

Build

  • gh-129660: Drop test_embed from PGO training, whose contribution in recent versions is considered to be ignorable.

  • gh-128902: Fix compile errors with Clang 9 and older due to lack of __attribute__((fallthrough)) support.

Python 3.14.0 alpha 4

Release date: 2025-01-14

macOS

  • gh-127592: Usage of the unified Apple System Log APIs was disabled when the minimum macOS version is earlier than 10.12.

Tools/Demos

  • gh-128152: Fix a bug where Argument Clinic’s C pre-processor parser tried to parse pre-processor directives inside C comments. Patch by Erlend Aasland.

Tests

  • gh-128690: Temporarily do not use test_embed in PGO profile builds until the problem with test_init_pyvenv_cfg failing in some configurations is resolved.

Library

Core and Builtins

  • gh-128078: Fix a SystemError when using anext() with a default tuple value. Patch by Bénédikt Tran.

  • gh-128717: Fix a crash when setting the recursion limit while other threads are active on the free threaded build.

  • gh-124483: Treat Py_DECREF and variants as escaping when generating opcode and uop metadata. This prevents the possibility of a __del__ method causing the JIT to behave incorrectly.

  • gh-126703: Improve performance of class methods by using a freelist.

  • gh-128137: Update PyASCIIObject layout to handle interned field with the atomic operation. Patch by Donghee Na.

Library

Core and Builtins

  • gh-126868: Increase usage of freelist for int allocation.

  • gh-114203: Optimize Py_BEGIN_CRITICAL_SECTION for simple recursive calls.

  • gh-127705: Adds stackref debugging when Py_STACKREF_DEBUG is set. Finds all double-closes and leaks, logging the origin and last borrow.

    Inspired by HPy’s debug mode. https://docs.hpyproject.org/en/latest/debug-mode.html

  • gh-128079: Fix a bug where except* does not properly check the return value of an ExceptionGroup’s split() function, leading to a crash in some cases. Now when split() returns an invalid object, except* raises a TypeError with the original raised ExceptionGroup object chained to it.

  • gh-128030: Avoid error from calling PyModule_GetFilenameObject on a non-module object when importing a non-existent symbol from a non-module object.

Library

  • gh-128035: Indicate through ssl.HAS_PHA whether the ssl module supports TLSv1.3 post-handshake client authentication (PHA). Patch by Will Childs-Klein.

Core and Builtins

  • gh-127274: Add a new flag, CO_METHOD, to co_flags that indicates whether the code object belongs to a function defined in class scope.

  • gh-66409: During the path initialization, we now check if base_exec_prefix is the same as base_prefix before falling back to searching the Python interpreter directory.

  • gh-127970: We now use the location of the libpython runtime library used in the current process to determine sys.base_prefix on all platforms implementing the dladdr function defined by the UNIX standard — this includes Linux, Android, macOS, iOS, FreeBSD, etc. This was already the case on Windows and macOS Framework builds.

  • gh-127773: Do not use the type attribute cache for types with incompatible MRO.

  • gh-127903: Objects/unicodeobject.c: fix a crash on DEBUG builds in _copy_characters when there is nothing to copy.

  • gh-127809: Fix an issue where the experimental JIT may infer an incorrect result type for exponentiation (** and **=), leading to bugs or crashes.

  • gh-126862: Fix a possible overflow when a class inherits from an absurd number of super-classes. Reported by Valery Fedorenko. Patch by Bénédikt Tran.

C API

Build

  • gh-128627: For Emscripten builds the function pointer cast call trampoline now uses the wasm-gc ref.test instruction if it’s available instead of Wasm JS type reflection.

  • gh-128472: Skip BOLT optimization of functions using computed gotos, fixing errors on build with LLVM 19.

  • gh-115765: GNU Autoconf 2.72 is now required to generate configure. Patch by Erlend Aasland.

  • gh-123925: Fix building the curses module on platforms with libncurses but without libncursesw.

  • gh-90905: Add support for cross-compiling to x86_64 on aarch64/arm64 macOS.

  • gh-128321: Set LIBS instead of LDFLAGS when checking if sqlite3 library functions are available. This fixes the ordering of linked libraries during checks, which was incorrect when using a statically linked libsqlite3.

  • gh-100384: Error on unguarded-availability in macOS builds, preventing invalid use of symbols that are not available in older versions of the OS.

  • gh-128104: Remove Py_STRFTIME_C99_SUPPORT conditions in favor of requiring C99 strftime(3) specifier support at build time. When cross-compiling, there is no build time check and support is assumed.

  • gh-127951: Add option --pystats to the Windows build to enable performance statistics collection.

Python 3.14.0 alpha 3

Release date: 2024-12-17

Windows

  • gh-127353: Allow to force color output on Windows using environment variables. Patch by Andrey Efremov.

  • gh-125729: Makes the presence of the turtle module dependent on the Tcl/Tk installer option. Previously, the module was always installed but would be unusable without Tcl/Tk.

Tools/Demos

Tests

  • gh-127906: Test the limited C API in test_cppext. Patch by Victor Stinner.

  • gh-127637: Add tests for the dis command-line interface. Patch by Bénédikt Tran.

  • gh-126925: iOS test results are now streamed during test execution, and the deprecated xcresulttool is no longer used.

  • gh-127076: Disable strace based system call tests when LD_PRELOAD is set.

  • gh-127076: Filter out memory-related mmap, munmap, and mprotect calls from file-related ones when testing io behavior using strace.

Security

Library

Documentation

Core and Builtins

  • gh-127740: Fix error message in bytes.fromhex() when given an odd number of digits to properly indicate that an even number of hexadecimal digits is required.

  • gh-127058: PySequence_Tuple now creates the resulting tuple atomically, preventing partially created tuples being visible to the garbage collector or through gc.get_referrers()

  • gh-127599: Fix statistics for increments of object reference counts (in particular, when a reference count was increased by more than 1 in a single operation).

  • gh-127651: When raising ImportError for missing symbols in from imports, use __file__ in the error message if __spec__.origin is not a location

  • gh-127582: Fix non-thread-safe object resurrection when calling finalizers and watcher callbacks in the free threading build.

  • gh-127434: The iOS compiler shims can now accept arguments with spaces.

  • gh-127536: Add missing locks around some list assignment operations in the free threading build.

  • gh-127085: Fix race when exporting a buffer from a memoryview object on the free-threaded build.

  • gh-127238: Correct error message for sys.set_int_max_str_digits().

  • gh-113841: Fix possible undefined behavior division by zero in complex’s _Py_c_pow().

Library

Core and Builtins

  • gh-126491: Add a marking phase to the GC. All objects that can be transitively reached from builtin modules or the stacks are marked as reachable before cycle detection. This reduces the amount of work done by the GC by approximately half.

  • gh-127020: Fix a crash in the free threading build when PyCode_GetCode(), PyCode_GetVarnames(), PyCode_GetCellvars(), or PyCode_GetFreevars() were called from multiple threads at the same time.

  • gh-127010: Simplify GC tracking of dictionaries. All dictionaries are tracked when created, rather than being lazily tracked when a trackable object was added to them. This simplifies the code considerably and results in a slight speedup.

  • gh-126980: Fix __buffer__() of bytearray crashing when READ or WRITE are passed as flags.

  • gh-126937: Fix TypeError when a ctypes.Structure has a field size that doesn’t fit into an unsigned 16-bit integer. Instead, the maximum number of bits is sys.maxsize.

  • gh-126868: Increase performance of int by adding a freelist for compact ints.

  • gh-126881: Fix crash in finalization of dtoa state. Patch by Kumar Aditya.

  • gh-126892: Require cold or invalidated code to “warm up” before being JIT compiled again.

  • gh-126091: Ensure stack traces are complete when throwing into a generator chain that ends in a custom generator.

  • gh-126024: Optimize decoding of short UTF-8 sequences containing non-ASCII characters by approximately 15%.

  • gh-125420: Add memoryview.index() to memoryview objects. Patch by Bénédikt Tran.

  • gh-125420: Add memoryview.count() to memoryview objects. Patch by Bénédikt Tran.

  • gh-124470: Fix crash in free-threaded builds when replacing object dictionary while reading attribute on another thread

  • gh-69639: Implement mixed-mode arithmetic rules combining real and complex numbers as specified by C standards since C99. Patch by Sergey B Kirpichev.

  • gh-120010: Correct invalid corner cases which resulted in (nan+nanj) output in complex multiplication, e.g., (1e300+1j)*(nan+infj). Patch by Sergey B Kirpichev.

  • gh-109746: If _thread.start_new_thread() fails to start a new thread, it deletes its state from interpreter and thus avoids its repeated cleanup on finalization.

C API

Build

  • gh-127865: Fix build failure on systems without thread-locals support.

  • gh-127629: Emscripten builds now include ctypes support.

  • gh-127111: Updated the Emscripten web example to use ES6 modules and be built into a distinct web_example subfolder.

  • gh-115869: Make jit_stencils.h (which is produced during JIT builds) reproducible.

  • gh-126898: The Emscripten build of Python is now based on ES6 modules.

Python 3.14.0 alpha 2

Release date: 2024-11-19

Windows

  • gh-126911: Update credits command output.

  • gh-118973: Ensures the experimental free-threaded install includes the _tkinter module. The optional Tcl/Tk component must also be installed in order for the module to work.

  • gh-126497: Fixes venv failure due to missing redirector executables in experimental free-threaded installs.

  • gh-126074: Removed unnecessary DLLs from Windows embeddable package

  • gh-125315: Avoid crashing in platform due to slow WMI calls on some Windows machines.

  • gh-126084: Fix venvwlauncher to launch pythonw instead of python so no extra console window is created.

  • gh-125842: Fix a SystemError when sys.exit() is called with 0xffffffff on Windows.

  • gh-125550: Enable the Python install manager to detect Python 3.14 installs from the Windows Store.

  • gh-123803: All Windows code pages are now supported as “cpXXX” codecs on Windows.

Tools/Demos

  • gh-126807: Fix extraction warnings in pygettext.py caused by mistaking function definitions for function calls.

  • gh-126167: The iOS testbed was modified so that it can be used by third-party projects for testing purposes.

Tests

  • gh-126909: Fix test_os extended attribute tests to work on filesystems with 1 KiB xattr size limit.

  • gh-125730: Change make test to not run GUI tests by default. Use make ci to run tests with GUI tests instead.

  • gh-124295: Add translation tests to the argparse module.

Security

Library

Documentation

  • gh-126622: Added stub pages for removed modules explaining their removal, where to find replacements, and linking to the last Python version that supported them. Contributed by Ned Batchelder.

  • gh-125277: Require Sphinx 7.2.6 or later to build the Python documentation. Patch by Adam Turner.

  • gh-60712: Include the object type in the lists of documented types. Change by Furkan Onder and Martin Panter.

Core and Builtins

  • gh-126795: Increase the threshold for JIT code warmup. Depending on platform and workload, this can result in performance gains of 1-9% and memory savings of 3-5%.

  • gh-126341: Now ValueError is raised instead of SystemError when trying to iterate over a released memoryview object.

  • gh-126688: Fix a crash when calling os.fork() on some operating systems, including SerenityOS.

Library

  • gh-126066: Fix importlib to not write an incomplete .pyc files when a ulimit or some other operating system mechanism is preventing the write to go through fully.

Core and Builtins

  • gh-126222: Do not include count of “peek” items in _PyUop_num_popped. This ensures that the correct number of items are popped from the stack when a micro-op exits with an error.

  • gh-126366: Fix crash when using yield from on an object that raises an exception in its __iter__.

Library

  • gh-126209: Fix an issue with skip_file_prefixes parameter which resulted in an inconsistent behaviour between the C and Python implementations of warnings.warn(). Patch by Daehee Kim.

Core and Builtins

  • gh-126312: Fix crash during garbage collection on an object frozen by gc.freeze() on the free-threaded build.

  • gh-103951: Relax optimization requirements to allow fast attribute access to module subclasses.

  • gh-126072: Following gh-126101, for Code Objects like lambda, annotation and type alias, we no longer add None to its co_consts.

  • gh-126195: Improve JIT performance by 1.4% on macOS Apple Silicon by using platform-specific memory protection APIs. Patch by Diego Russo.

  • gh-126139: Provide better error location when attempting to use a future statement with an unknown future feature.

  • gh-126072: Add a new attribute in co_flags to indicate whether the first item in co_consts is the docstring. If a code object has no docstring, None will NOT be inserted.

  • gh-126076: Relocated objects such as tuple, bytes and str objects are properly tracked by tracemalloc and its associated hooks. Patch by Pablo Galindo.

  • gh-90370: Avoid temporary tuple creation for vararg in argument passing with Argument Clinic generated code (if arguments either vararg or positional-only).

  • gh-126018: Fix a crash in sys.audit() when passing a non-string as first argument and Python was compiled in debug mode.

  • gh-126012: The memoryview type now supports subscription, making it a generic type.

  • gh-125837: Adds LOAD_SMALL_INT and LOAD_CONST_IMMORTAL instructions. LOAD_SMALL_INT pushes a small integer equal to the oparg to the stack. LOAD_CONST_IMMORTAL does the same as LOAD_CONST but is more efficient for immortal objects. Removes RETURN_CONST instruction.

  • gh-125942: On Android, the errors setting of sys.stdout was changed from surrogateescape to backslashreplace.

  • gh-125859: Fix a crash in the free threading build when gc.get_objects() or gc.get_referrers() is called during an in-progress garbage collection.

  • gh-125868: It was possible in 3.14.0a1 only for attribute lookup to give the wrong value. This was due to an incorrect specialization in very specific circumstances. This is fixed in 3.14.0a2.

  • gh-125498: The JIT has been updated to leverage Clang 19’s new preserve_none attribute, which supports more platforms and is more useful than LLVM’s existing ghccc calling convention. This also removes the need to manually patch the calling convention in LLVM IR, simplifying the JIT compilation process.

  • gh-125703: Correctly honour tracemalloc hooks in specialized Py_DECREF paths. Patch by Pablo Galindo

  • gh-125593: Use color to highlight error locations in traceback from exception group

  • gh-125017: Fix crash on certain accesses to the __annotations__ of staticmethod and classmethod objects.

  • gh-125588: The Python PEG generator can now use f-strings in the grammar actions. Patch by Pablo Galindo

  • gh-125444: Fix illegal instruction for older Arm architectures. Patch by Diego Russo, testing by Ross Burton.

  • gh-118423: Add a new INSTRUCTION_SIZE macro to the cases generator which returns the current instruction size.

  • gh-125038: Fix crash when iterating over a generator expression after direct changes on gi_frame.f_locals. Patch by Mikhail Efimov.

  • gh-124855: Don’t allow the JIT and perf support to be active at the same time. Patch by Pablo Galindo

  • gh-123714: Update JIT compilation to use LLVM 19

  • gh-123930: Improve the error message when a script shadowing a module from the standard library causes ImportError to be raised during a “from” import. Similarly, improve the error message when a script shadowing a third party module attempts to “from” import an attribute from that third party module while still initialising.

  • gh-119793: The map() built-in now has an optional keyword-only strict flag like zip() to check that all the iterables are of equal length. Patch by Wannes Boeykens.

Library

  • gh-118950: Fix bug where SSLProtocol.connection_lost wasn’t getting called when OSError was thrown on writing to socket.

  • gh-113570: Fixed a bug in reprlib.repr where it incorrectly called the repr method on shadowed Python built-in types.

C API

Build

  • gh-126691: Removed the --with-emscripten-target configure flag. We unified the node and browser options and the same build can now be used, independent of target runtime.

  • gh-123877: Use wasm32-wasip1 as the target triple for WASI instead of wasm32-wasi. The latter will eventually be reclaimed for WASI 1.0 while CPython currently only supports WASI preview1.

  • gh-126458: Disable SIMD support for HACL under WASI.

  • gh-89640: Hard-code float word ordering as little endian on WASM.

  • gh-126206: make clinic now runs Argument Clinic using the --force option, thus forcefully regenerating generated code.

  • gh-126187: Introduced Tools/wasm/emscripten.py to simplify doing Emscripten builds.

  • gh-124932: For cross builds, there is now support for having a different install prefix than the host_prefix used by getpath.py. This is set to / by default for Emscripten, on other platforms the default behavior is the same as before.

  • gh-125946: The minimum supported Android version is now 7.0 (API level 24).

  • gh-125940: The Android build now supports 16 KB page sizes.

  • gh-89640: Improve detection of float word ordering on Linux when link-time optimizations are enabled.

  • gh-124928: Emscripten builds now require node >= 18.

  • gh-115382: Fix cross compile failures when the host and target SOABIs match.

Python 3.14.0 alpha 1

Release date: 2024-10-15

macOS

  • gh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15.

  • gh-123797: Check for runtime availability of ptsname_r function on macos.

  • gh-123418: Updated macOS installer build to use OpenSSL 3.0.15.

Windows

  • gh-124487: Increases Windows required OS and API level to Windows 10.

  • gh-124609: Fix _Py_ThreadId for Windows builds using MinGW. Patch by Tony Roberts.

  • gh-124448: Updated bundled Tcl/Tk to 8.6.15.

  • gh-124254: Ensures experimental free-threaded binaries remain installed when updating.

  • gh-123915: Ensure that Tools\msi\buildrelease.bat uses different directories for AMD64 and ARM64 builds.

  • gh-123418: Updated Windows build to use OpenSSL 3.0.15.

  • gh-123476: Add support for socket.TCP_QUICKACK on Windows platforms.

  • gh-122573: The Windows build of CPython now requires 3.10 or newer.

  • gh-100256: mimetypes no longer fails when it encounters an inaccessible registry key.

  • gh-119679: Ensures correct import libraries are included in Windows installs.

  • gh-119690: Adds Unicode support and fixes audit events for _winapi.CreateNamedPipe.

  • gh-111201: Add support for new pyrepl on Windows

  • gh-119070: Fixes py.exe handling of shebangs like /usr/bin/env python3.12, which were previously interpreted as python3.exe instead of python3.12.exe.

  • gh-117505: Fixes an issue with the Windows installer not running ensurepip in a fully isolated environment. This could cause unexpected interactions with the user site-packages.

  • gh-118209: Avoid crashing in mmap on Windows when the mapped memory is inaccessible due to file system errors or access violations.

  • gh-79846: Makes ssl.create_default_context() ignore invalid certificates in the Windows certificate store

Tools/Demos

  • gh-123418: Update GitHub CI workflows to use OpenSSL 3.0.15 and multissltests to use 3.0.15, 3.1.7, and 3.2.3.

Tests

  • gh-125041: Re-enable skipped tests for zlib on the s390x architecture: only skip checks of the compressed bytes, which can be different between zlib’s software implementation and the hardware-accelerated implementation.

  • gh-124378: Updated test_ttk to pass with Tcl/Tk 8.6.15.

  • gh-124213: Detect whether the test suite is running inside a systemd-nspawn container with --suppress-sync=true option, and skip the test_os and test_mmap tests that are failing in this scenario.

  • gh-124190: Add capability to ignore entire files or directories in check warning CI tool

  • gh-121921: Update Lib/test/crashers/bogus_code_obj.py so that it crashes properly again.

  • gh-112301: Add tooling to check for changes in compiler warnings. Patch by Nate Ohlson.

  • gh-59022: Add tests for pkgutil.extend_path(). Patch by Andreas Stocker.

  • gh-99242: os.getloadavg() may throw OSError when running regression tests under certain conditions (e.g. chroot). This error is now caught and ignored, since reporting load average is optional.

  • gh-121084: Fix test_typing random leaks. Clear typing ABC caches when running tests for refleaks (-R option): call _abc_caches_clear() on typing abstract classes and their subclasses. Patch by Victor Stinner.

  • gh-121160: Add a test for readline.set_history_length(). Note that this test may fail on readline libraries.

  • gh-121200: Fix test_expanduser_pwd2() of test_posixpath. Call getpwnam() to get pw_dir, since it can be different than getpwall() pw_dir. Patch by Victor Stinner.

  • gh-121188: When creating the JUnit XML file, regrtest now escapes characters which are invalid in XML, such as the chr(27) control character used in ANSI escape sequences. Patch by Victor Stinner.

  • gh-120801: Cleaned up fixtures for importlib.metadata tests and consolidated behavior with ‘test.support.os_helper’.

  • gh-119727: Add --single-process command line option to Python test runner (regrtest). Patch by Victor Stinner.

  • gh-119273: Python test runner no longer runs tests using TTY (ex: test_ioctl) in a process group (using setsid()). Previously, tests using TTY were skipped. Patch by Victor Stinner.

  • gh-119050: regrtest test runner: Add XML support to the refleak checker (-R option). Patch by Victor Stinner.

  • gh-101525: Skip test_gdb if the binary is relocated by BOLT. Patch by Donghee Na.

  • gh-107562: Test certificates have been updated to expire far in the future. This allows testing Y2038 with system time set to after that, so that actual Y2038 issues can be exposed, and not masked by expired certificate errors.

Security

  • gh-125140: Remove the current directory from sys.path when using PyREPL.

  • gh-123678: Upgrade libexpat to 2.6.3

  • gh-112301: Enable compiler options that warn of potential security vulnerabilities.

  • gh-122792: Changed IPv4-mapped ipaddress.IPv6Address to consistently use the mapped IPv4 address value for deciding properties. Properties which have their behavior fixed are is_multicast, is_reserved, is_link_local, is_global, and is_unspecified.

  • gh-112301: Add ability to ignore warnings per file with warning count in warning checking tooling. Patch by Nate Ohlson.

  • gh-112301: Add macOS warning tracking to warning check tooling. Patch by Nate Ohlson.

  • gh-122133: Authenticate the socket connection for the socket.socketpair() fallback on platforms where AF_UNIX is not available like Windows.

    Patch by Gregory P. Smith <greg@krypto.org> and Seth Larson <seth@python.org>. Reported by Ellie <el@horse64.org>

  • gh-121957: Fixed missing audit events around interactive use of Python, now also properly firing for python -i, as well as for python -m asyncio. The events in question are cpython.run_stdin and cpython.run_startup.

  • gh-112301: Enable runtime protections for glibc to abort execution when unsafe behavior is encountered, for all platforms except Windows.

  • gh-121285: Remove backtracking from tarfile header parsing for hdrcharset, PAX, and GNU sparse headers.

  • gh-112301: Add default compiler options to improve security. Enable -Wimplicit-fallthrough, -fstack-protector-strong, -Wtrampolines.

  • gh-118773: Fixes creation of ACLs in os.mkdir() on Windows to work correctly on non-English machines.

  • gh-118486: os.mkdir() on Windows now accepts mode of 0o700 to restrict the new directory to the current user. This fixes CVE 2024-4030 affecting tempfile.mkdtemp() in scenarios where the base temporary directory is more permissive than the default.

Library