Skip to content

Latest commit

 

History

History
2402 lines (1718 loc) · 54.7 KB

3.12.0b1.rst

File metadata and controls

2402 lines (1718 loc) · 54.7 KB

Fixed a security in flaw in :func:`!uu.decode` that could allow for directory traversal based on the input if no out_file was specified.

Do not expose the local on-disk location in directory indexes produced by :class:`http.client.SimpleHTTPRequestHandler`.

Upgrade built-in :mod:`hashlib` SHA3 implementation to a verified implementation from the HACL* project. Used when OpenSSL is not present or lacks SHA3.

:func:`urllib.parse.urlsplit` now strips leading C0 control and space characters following the specification for URLs defined by WHATWG in response to :cve:`2023-24329`. Patch by Illia Volochii.

Implement PEP 701 changes in the :mod:`tokenize` module. Patch by Marta Gómez Macías and Pablo Galindo Salgado

Fix wrong ordering of assignments in code like a, a = x, y. Contributed by Carl Meyer.

Improve syntax error message for invalid constructs in PEP 695 contexts and in annotations when from __future__ import annotations is active.

Fix three error handling bugs in ast.c's validation of pattern matching statements.

Do not add a frame to the traceback in the sys.setprofile and sys.settrace trampoline functions. This ensures that frames are not duplicated if an exception is raised in the callback function, and ensures that frames are not omitted if a C callback is used and that does not add the frame.

Fix an issue where some :term:`bytecode` instructions could ignore PEP 523 when "inlining" calls.

Change behavior of sys.monitoring.events.LINE events in sys.monitoring: Line events now occur when a new line is reached dynamically, instead of using a static approximation, as before. This makes the behavior very similar to that of "line" events in sys.settrace. This should ease porting of tools from 3.11 to 3.12.

Fix float("nan") to produce a quiet NaN on platforms (like MIPS) where the meaning of the signalling / quiet bit is inverted from its usual meaning. Also introduce a new macro Py_INFINITY matching C99's INFINITY, and refactor internals to rely on C99's NAN and INFINITY macros instead of hard-coding bit patterns for infinities and NaNs. Thanks Sebastian Berg.

Multi-phase init extension modules may now indicate that they support running in subinterpreters that have their own GIL. This is done by using Py_MOD_PER_INTERPRETER_GIL_SUPPORTED as the value for the Py_mod_multiple_interpreters module def slot. Otherwise the module, by default, cannot be imported in such subinterpreters. (This does not affect the main interpreter or subinterpreters that do not have their own GIL.) In addition to the isolation that multi-phase init already normally requires, support for per-interpreter GIL involves one additional constraint: thread-safety. If the module has external (linked) dependencies and those libraries have any state that isn't thread-safe then the module must do the additional work to add thread-safety. This should be an uncommon case.

The GIL is now (optionally) per-interpreter. This is the fundamental change for PEP 684. This is all made possible by virtue of the isolated state of each interpreter in the process. The behavior of the main interpreter remains unchanged. Likewise, interpreters created using Py_NewInterpreter() are not affected. To get an interpreter with its own GIL, call Py_NewInterpreterFromConfig().

Multi-phase init extension modules may now indicate whether or not they actually support multiple interpreters. By default such modules are expected to support use in multiple interpreters. In the uncommon case that one does not, it may use the new Py_mod_multiple_interpreters module def slot. A value of 0 means the module does not support them. 1 means it does. The default is 1.

Fix an issue where :class:`list` or :class:`tuple` repetition could fail to respect PEP 683.

Improve the performance of :c:func:`PyObject_HasAttrString`

Improve the performance of :func:`hasattr` for module objects with a missing attribute.

Reduce object creation while calling callback function from gc. Patch by Donghee Na.

Disallow the "z" format specifier in %-format of bytes objects.

Fix performance loss when accessing an object's attributes with __getattr__ defined.

Improve handling of edge cases in showing Exception.__notes__. Ensures that the messages always end with a newline and that string/bytes are not exploded over multiple lines. Patch by Carey Metcalfe.

Don't modify the refcounts of known immortal objects (:const:`True`, :const:`False`, and :const:`None`) in the main interpreter loop.

Provide a helpful hint in the :exc:`TypeError` message when accidentally calling a :term:`module` object that has a callable attribute of the same name (such as :func:`dis.dis` or :class:`datetime.datetime`).

Remove both line and instruction instrumentation before adding new ones for monitoring, to avoid newly added instrumentation being removed immediately.

Implement PEP 695, adding syntactic support for generic classes, generic functions, and type aliases.

A new type X = ... syntax is added for type aliases, which resolves at runtime to an instance of the new class typing.TypeAliasType. The value is lazily evaluated and is accessible through the .__value__ attribute. This is implemented as a new AST node ast.TypeAlias.

New syntax (class X[T]: ..., def func[T](): ...) is added for defining generic functions and classes. This is implemented as a new type_params attribute on the AST nodes for classes and functions. This node holds instances of the new AST classes ast.TypeVar, ast.ParamSpec, and ast.TypeVarTuple.

typing.TypeVar, typing.ParamSpec, typing.ParamSpecArgs, typing.ParamSpecKwargs, typing.TypeVarTuple, and typing.Generic are now implemented in C rather than Python.

There are new bytecode instructions LOAD_LOCALS, LOAD_CLASSDICT_OR_GLOBAL, and LOAD_CLASSDICT_OR_DEREF to support correct resolution of names in class namespaces.

Patch by Eric Traut, Larry Hastings, and Jelle Zijlstra.

Adds three minor linting fixes to the wasm module caught that were caught by ruff.

Optimized asyncio Task creation by deferring expensive string formatting (task name generation) from Task creation to the first time get_name is called. This makes asyncio benchmarks up to 5% faster.

Change the error range for invalid bytes literals.

Do not wrap a single exception raised from a try-except* construct in an :exc:`ExceptionGroup`.

Change the perf map format to remove the '0x' prefix from the addresses

Implement the required C tokenizer changes for PEP 701. Patch by Pablo Galindo Salgado, Lysandros Nikolaou, Batuhan Taskaya, Marta Gómez Macías and sunmy2019.

Clarify the error message raised when the called part of a class pattern isn't actually a class.

Fix bug in line numbers of instructions emitted for :keyword:`except* <except_star>`.

Clarify :exc:`SyntaxWarning` with literal is comparison by specifying which literal is problematic, since comparisons using is with e.g. None and bool literals are idiomatic.

Add :opcode:`LOAD_SUPER_ATTR` (and a specialization for super().method()) to speed up super().method() and super().attr. This makes super().method() roughly 2.3x faster and brings it within 20% of the performance of a simple method call. Patch by Vladimir Matveev and Carl Meyer.

Change the internal offset distinguishing yield and return target addresses, so that the instruction pointer is correct for exception handling and other stack unwinding.

The bitwise inversion operator (~) on bool is deprecated. It returns the bitwise inversion of the underlying int representation such that bool(~True) == True, which can be confusing. Use not for logical negation of bools. In the rare case that you really need the bitwise inversion of the underlying int, convert to int explicitly ~int(x).

Exceptions raised in a typeobject's __set_name__ method are no longer wrapped by a :exc:`RuntimeError`. Context information is added to the exception as a PEP 678 note.

:exc:`AttributeError` now retains the name attribute when pickled and unpickled.

Migrate :meth:`~ssl.SSLContext.set_ecdh_curve` method not to use deprecated OpenSSL APIs. Patch by Donghee Na.

We've replaced our use of _PyRuntime.tstate_current with a thread-local variable. This is a fairly low-level implementation detail, and there should be no change in behavior.

The implementation of PEP-683 which adds Immortal Objects by using a fixed reference count that skips reference counting to make objects truly immutable.

Allow built-in modules to be submodules. This allows submodules to be statically linked into a CPython binary.

Implement PEP 669 Low Impact Monitoring for CPython.

Reduce the number of inline :opcode:`CACHE` entries for :opcode:`CALL`.

Make the buffer protocol accessible in Python code using the new __buffer__ and __release_buffer__ magic methods. See PEP 688 for details. Patch by Jelle Zijlstra.

PEP 709: inline list, dict and set comprehensions to improve performance and reduce bytecode size.

Bypass instance attribute access of __name__ in repr of :class:`weakref.ref`.

Complex function calls are now faster and consume no C stack space.

len() for 0-dimensional :class:`memoryview` objects (such as memoryview(ctypes.c_uint8(42))) now raises a :exc:`TypeError`. Previously this returned 1, which was not consistent with mem_0d[0] raising an :exc:`IndexError`.

Fix :func:`!pause_reading` to work when called from :func:`!connection_made` in :mod:`asyncio`.

:func:`functools.update_wrapper` now sets the __type_params__ attribute (added by PEP 695).

When an asyncio pipe protocol loses its connection due to an error, and the caller doesn't await wait_closed() on the corresponding StreamWriter, don't log a warning about an exception that was never retrieved. After all, according to the StreamWriter.close() docs, the wait_closed() call is optional ("not mandatory").

Fix issue where an :func:`issubclass` check comparing a class X against a :func:`runtime-checkable protocol <typing.runtime_checkable>` Y with non-callable members would not cause :exc:`TypeError` to be raised if an :func:`isinstance` call had previously been made comparing an instance of X to Y. This issue was present in edge cases on Python 3.11, but became more prominent in 3.12 due to some unrelated changes that were made to runtime-checkable protocols. Patch by Alex Waygood.

Refactored the _posixsubprocess internals to avoid Python C API usage between fork and exec when marking pass_fds= file descriptors inheritable.

Added case_sensitive argument to :meth:`pathlib.PurePath.match`

Fix data descriptor detection in :func:`inspect.getattr_static`.

Fix a race condition in the internal :mod:`multiprocessing.process` cleanup logic that could manifest as an unintended AttributeError when calling process.close().

Update datetime deprecations' stracktrace to point to the calling line

Move the core functionality of the tracemalloc module in the Python/ folder, leaving just the module wrapper in Modules/.

Remove undocumented and unused _paramspec_tvars attribute from some classes in :mod:`typing`.

Fix issue where :meth:`pathlib.Path.glob` raised :exc:`RecursionError` when walking deep directory trees.

Improve performance of :func:`dataclasses.asdict` for the common case where dict_factory is dict. Patch by David C Ellis.

Allow leading whitespace in disambiguated statements in :mod:`pdb`.

Teach :func:`urllib.parse.unsplit` to retain the "//" when assembling itms-services://?action=generate-bugs style Apple Platform Deployment URLs.

:func:`socket.getnameinfo` now releases the GIL while contacting the DNS server

Users may now use importlib.util.allowing_all_extensions() (a context manager) to temporarily disable the strict compatibility checks for importing extension modules in subinterpreters.

Fix issue where :meth:`pathlib.Path.glob` raised :exc:`OSError` when it encountered a symlink to an overly long path.

Prevent possible crash by disallowing instantiation of the :class:`!_csv.Reader` and :class:`!_csv.Writer` types. The regression was introduced in 3.10.0a4 with PR 23224 (:issue:`14935`). Patch by Radislav Chugunov.

Improve performance of :meth:`pathlib.Path.glob` when expanding recursive wildcards ("**") by merging adjacent wildcards and de-duplicating results only when necessary.

Remove unneeded comments and code in turtle.py.

Fixed issue where :meth:`pathlib.Path.glob` returned incomplete results when it encountered a :exc:`PermissionError`. This method now suppresses all :exc:`OSError` exceptions, except those raised from calling :meth:`~pathlib.Path.is_dir` on the top-level path.

Optimize :class:`asyncio.TaskGroup` when using :func:`asyncio.eager_task_factory`. Skip scheduling a done callback if a TaskGroup task completes eagerly.

Optimize :func:`asyncio.gather` when using :func:`asyncio.eager_task_factory` to complete eagerly if all fututres completed eagerly. Avoid scheduling done callbacks for futures that complete eagerly.

Fix issue where :meth:`pathlib.Path.glob` returns paths using the case of non-wildcard segments for corresponding path segments, rather than the real filesystem case.

Improve performance of :meth:`pathlib.Path.glob` by using :const:`re.IGNORECASE` to implement case-insensitive matching.

Improve performance of :meth:`pathlib.Path.glob` when evaluating patterns that contain '../' segments.

Update the return type of weekday to the newly added Day attribute

Update the repr of :class:`typing.Unpack` according to PEP 692.

Make :mod:`dis` display the names of the args for :opcode:`!CALL_INTRINSIC_*`.

Do not ignore user-defined __getstate__ and __setstate__ methods for slotted frozen dataclasses.

In :mod:`mmap`, fix several bugs that could lead to access to memory-mapped files after they have been invalidated.

Improve import time of :mod:`platform` module.

Added :func:`turtle.teleport` to the :mod:`turtle` module to move a turtle to a new point without tracing a line, visible or invisible. Patch by Liam Gersten.

Use :func:`io.open_code` for files to be executed instead of raw :func:`open`

Fixed garbled output of :meth:`~unittest.TestCase.assertEqual` when an input lacks final newline.

Fix potential :exc:`OverflowError` in :meth:`sqlite3.Connection.blobopen` for 32-bit builds. Patch by Erlend E. Aasland.

Substitute CTRL-D with CTRL-Z in :mod:`sqlite3` CLI banner when running on Windows.

Module-level attributes January and February are deprecated from :mod:`calendar`.

Isolate :mod:`!_multibytecodec` and codecs extension modules. Patches by Erlend E. Aasland.

Add checks to ensure that [ bracketed ] hosts found by :func:`urllib.parse.urlsplit` are of IPv6 or IPvFuture format.

Update the bundled copy of pip to version 23.1.2.

Make :mod:`dis` display the value of oparg of :opcode:`!KW_NAMES`.

The C.UTF-8 locale is no longer converted to en_US.UTF-8, enabling the use of UTF-8 encoding on systems which have no locales installed.

Fix zipfile.Zipfile creating invalid zip files when force_zip64 was used to add files to them. Patch by Carey Metcalfe.

Deprecated :meth:`datetime.datetime.utcnow` and :meth:`datetime.datetime.utcfromtimestamp`. (Patch by Paul Ganssle)

Avoid compilation error due to tommath.h not being found when building Tkinter against Tcl 8.7 built with bundled libtommath.

:class:`contextlib.suppress` now supports suppressing exceptions raised as part of an :exc:`ExceptionGroup`. If other exceptions exist on the group, they are re-raised in a group that does not contain the suppressed exceptions.

Use :meth:`datetime.datetime.fromisocalendar` in the implementation of :meth:`datetime.datetime.strptime`, which should now accept only valid ISO dates. (Patch by Paul Ganssle)

Prepare :meth:`tkinter.Menu.index` for Tk 8.7 so that it does not raise TclError: expected integer but got "" when it should return None.

:class:`urllib.request.CacheFTPHandler` no longer raises :class:`URLError` if a cached FTP instance is reused. ftplib's endtransfer method calls voidresp to drain the connection to handle FTP instance reuse properly.

Add __orig_bases__ to non-generic TypedDicts, call-based TypedDicts, and call-based NamedTuples. Other TypedDicts and NamedTuples already had the attribute.

Add convenience variable feature to :mod:`pdb`

Deprecate type, choices, and metavar parameters of argparse.BooleanOptionalAction.

Add :mod:`socket` constants for source-specific multicast. Patch by Reese Hyde.

:mod:`socketserver` gains ForkingUnixStreamServer and ForkingUnixDatagramServer classes. Patch by Jay Berry.

Added Enum for months and days in the calendar module.

Create a new Lib/_pydatetime.py file that defines the Python version of the datetime module, and make datetime import the contents of the new library only if the C implementation is missing. Currently, the full Python implementation is defined and then deleted if the C implementation is not available, slowing down import datetime unnecessarily.

Attributes/methods are no longer shadowed by same-named enum members, although they may be shadowed by enum.property's.

Updated importlib.metadata with changes from importlib_metadata 5.2 through 6.5.0, including: Support installed-files.txt for Distribution.files when present. PackageMetadata now stipulates an additional get method allowing for easy querying of metadata keys that may not be present. packages_distributions now honors packages and modules with Python modules that not .py sources (e.g. .pyc, .so). Expand protocol for PackageMetadata.get_all to match the upstream implementation of email.message.Message.get_all in python/typeshed#9620. Deprecated use of Distribution without defining abstract methods. Deprecated expectation that PackageMetadata.__getitem__ will return None for missing keys. In the future, it will raise a KeyError.

Fixed a bug where :mod:`pdb` crashes when reading source file with different encoding by replacing :func:`io.open` with :func:`io.open_code`. The new method would also call into the hook set by :c:func:`PyFile_SetOpenCodeHook`.

Now creating :class:`inspect.Signature` objects with positional-only parameter with a default followed by a positional-or-keyword parameter without one is impossible.

Update the bundled copy of pip to version 23.1.1.

Improve performance of :meth:`pathlib.Path.absolute` and :meth:`~pathlib.Path.cwd` by joining paths only when necessary. Also improve performance of :meth:`pathlib.PurePath.is_absolute` on Posix by skipping path parsing and normalization.

Remove _tkinter module code guarded by definition of the TK_AQUA macro which was only needed for Tk 8.4.7 or earlier and was never actually defined by any build system or documented for manual use.

Update :mod:`cProfile` to use PEP 669 API

Fix misleading exception message when mixed str and bytes arguments are supplied to :class:`pathlib.PurePath` and :class:`~pathlib.Path`.

Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection.setconfig` to :class:`~sqlite3.Connection` to make configuration changes to a database connection. Patch by Erlend E. Aasland.

Set default Flag boundary to STRICT and fix bitwise operations.

Avoid a potential :exc:`ResourceWarning` in :class:`http.client.HTTPConnection` by closing the proxy / tunnel's CONNECT response explicitly.

Fixed an issue with using :meth:`~asyncio.WriteTransport.writelines` in :mod:`asyncio` to send very large payloads that exceed the amount of data that can be written in one call to :meth:`socket.socket.send` or :meth:`socket.socket.sendmsg`, resulting in the remaining buffer being left unwritten.

Fix a bug in doc string generation in :func:`dataclasses.dataclass`.

Isolate :mod:`!_collections` (apply PEP 687). Patch by Erlend E. Aasland.

Added support for :class:`logging.Formatter` defaults parameter to :func:`logging.config.dictConfig` and :func:`logging.config.fileConfig`. Patch by Bar Harel.

Adapt the :mod:`winreg` extension module to PEP 687.

The performance of :func:`isinstance` checks against :func:`runtime-checkable protocols <typing.runtime_checkable>` has been considerably improved for protocols that only have a few members. To achieve this improvement, several internal implementation details of the :mod:`typing` module have been refactored, including typing._ProtocolMeta.__instancecheck__, typing._is_callable_members_only, and typing._get_protocol_attrs. Patches by Alex Waygood.

The members of a runtime-checkable protocol are now considered "frozen" at runtime as soon as the class has been created. See :ref:`"What's new in Python 3.12" <whatsnew-typing-py312>` for more details.

Fixed a bug that caused :mod:`hmac` to raise an exception when the requested hash algorithm was not available in OpenSSL despite being available separately as part of hashlib itself. It now falls back properly to the built-in. This could happen when, for example, your OpenSSL does not include SHA3 support and you want to compute hmac.digest(b'K', b'M', 'sha3_256').

Support sys.last_exc in :mod:`idlelib`.

Improve performance of :func:`ast.get_source_segment`.

Fix a bug in :mod:`pdb` when displaying line numbers of module-level source code.

Adapt the :mod:`msvcrt` extension module to PEP 687.

Adapt the :mod:`winsound` extension module to PEP 687.

Remove deprecation of enum member.member access.

Fixes :func:`unittest.mock.patch` not enforcing function signatures for methods decorated with @classmethod or @staticmethod when patch is called with autospec=True.

Isolate :mod:`!_socket` (apply PEP 687). Patch by Erlend E. Aasland.

Add :meth:`pathlib.PurePath.with_segments`, which creates a path object from arguments. This method is called whenever a derivative path is created, such as from :attr:`pathlib.PurePath.parent`. Subclasses may override this method to share information between path objects.

Fix issue where :func:`os.path.join` added a slash when joining onto an incomplete UNC drive with a trailing slash on Windows.

Fixes :mod:`http.server` accepting HTTP requests with HTTP version numbers preceded by '+', or '-', or with digit-separating '_' characters. The length of the version numbers is also constrained.

Fix various Windows-specific issues with shutil.which.

Improve performance of :func:`inspect.getattr_static`. Patch by Alex Waygood.

:func:`sys._current_exceptions` now returns a mapping from thread-id to an exception instance, rather than to a (typ, exc, tb) tuple.

Polish the help messages and docstrings of :mod:`pdb`.

Add entrypoint keyword-only parameter to :meth:`sqlite3.Connection.load_extension`, for overriding the SQLite extension entry point. Patch by Erlend E. Aasland.

Improve performance of :func:`dataclasses.astuple` and :func:`dataclasses.asdict` in cases where the contents are common Python types.

The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, have a new a filter argument that allows limiting tar features than may be surprising or dangerous, such as creating files outside the destination directory. See :ref:`tarfile-extraction-filter` for details.

Implemented an eager task factory in asyncio. When used as a task factory on an event loop, it performs eager execution of coroutines. Coroutines that are able to complete synchronously (e.g. return or raise without blocking) are returned immediately as a finished task, and the task is never scheduled to the event loop. If the coroutine blocks, the (pending) task is scheduled and returned.

Add case_sensitive keyword-only argument to :meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob`.

Isolate the :mod:`io` extension module by applying PEP 687. Patch by Kumar Aditya, Victor Stinner, and Erlend E. Aasland.

Deprecate :class:`collections.abc.ByteString`

Speed up :class:`pathlib.Path` construction by omitting the path anchor from the internal list of path parts.

Functions in the :mod:`dis` module that accept a source code string as argument now print a more concise traceback when the string contains a syntax or indentation error.

The :mod:`unittest` runner will now exit with status code 5 if no tests were run. It is common for test runner misconfiguration to fail to find any tests, this should be an error.

Fix incorrect normalization of UNC device path roots, and partial UNC share path roots, in :class:`pathlib.PurePath`. Pathlib no longer appends a trailing slash to such paths.

Add :func:`tty.cfmakeraw` and :func:`tty.cfmakecbreak` to :mod:`tty` and modernize, the behavior of :func:`tty.setraw` and :func:`tty.setcbreak` to use POSIX.1-2017 Chapter 11 "General Terminal Interface" flag masks by default.

Implement :func:`types.get_original_bases` to provide further introspection for types.

:class:`argparse.ArgumentParser` now catches errors when writing messages, such as when :data:`sys.stderr` is None. Patch by Oleg Iarygin.

Fix datetime.astimezone method return value when invoked on a naive datetime instance that represents local time falling in a timezone transition gap. PEP 495 requires that instances with fold=1 produce earlier times than those with fold=0 in this case.

Decrease execution time of some :mod:`gzip` file writes by 15% by adding more appropriate buffering.

Remove the bundled setuptools wheel from ensurepip, and stop installing setuptools in environments created by venv.

Respect the :class:`http.client.HTTPConnection` .debuglevel flag in :class:`urllib.request.AbstractHTTPHandler` when its constructor parameter debuglevel is not set. And do the same for *HTTPS*.

Remove the long-deprecated imp module.

Deprecate :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` in favor of :func:`importlib.util.find_spec`.

Flatten arguments in :meth:`tkinter.Canvas.coords`. It now accepts not only x1, y1, x2, y2, ... and [x1, y1, x2, y2, ...], but also (x1, y1), (x2, y2), ... and [(x1, y1), (x2, y2), ...].

Remove more deprecated importlib APIs: find_loader(), find_module(), importlib.abc.Finder, pkgutil.ImpImporter, pkgutil.ImpLoader.

Fix potential deadlock in pty.spawn()

Support divert(4) added in FreeBSD 14.

Fix potential file descriptor leaks in :class:`subprocess.Popen`.

Support multiple steps in :func:`math.nextafter`. Patch by Shantanu Jain and Matthias Gorgens.

Make :func:`tempfile.mkdtemp` return absolute paths when its dir parameter is relative.

Convert private :meth:`!_posixsubprocess.fork_exec` to use Argument Clinic.

When creating zip files using :mod:`zipfile`, os.altsep, if not None, will always be treated as a path separator even when it is not /. Patch by Carey Metcalfe.

Deprecation warnings are now emitted for :class:`!ast.Num`, :class:`!ast.Bytes`, :class:`!ast.Str`, :class:`!ast.NameConstant` and :class:`!ast.Ellipsis`. These have been documented as deprecated since Python 3.8, and will be removed in Python 3.14.

Enables :mod:`webbrowser` to detect and launch Microsoft Edge browser.

Fixed the bug in :meth:`pathlib.Path.glob` -- previously a dangling symlink would not be found by this method when the pattern is an exact match, but would be found when the pattern contains a wildcard or the recursive wildcard (**). With this change, a dangling symlink will be found in both cases.

Add :const:`~csv.QUOTE_STRINGS` and :const:`~csv.QUOTE_NOTNULL` to the suite of :mod:`csv` module quoting styles.

Added :meth:`http.client.HTTPConnection.get_proxy_response_headers` that provides access to the HTTP headers on a proxy server response to the CONNECT request.

:mod:`multiprocessing` now supports stronger HMAC algorithms for inter-process connection authentication rather than only HMAC-MD5.

Make :func:`asyncio.subprocess.Process.communicate` close the subprocess's stdin even when called with input=None.

http.client CONNECT method tunnel improvements: Use HTTP 1.1 protocol; send a matching Host: header with CONNECT, if one is not provided; convert IDN domain names to Punycode. Patch by Michael Handler.

Document that the effect of registering or unregistering an :mod:`atexit` cleanup function from within a registered cleanup function is undefined.

Mention the new way of typing **kwargs with Unpack and TypedDict introduced in PEP 692.

Clarifying documentation about the url parameter to urllib.request.urlopen and urllib.request.Request needing to be encoded properly.

Add support for Unicode Path Extra Field in ZipFile. Patch by Yeojin Kim and Andrea Giudiceandrea

Fix extension type from documentation for compiling in C++20 mode

Update test_pack_configure_in and test_place_configure_in for changes to error message formatting in Tk 8.7.

Run test_configure_screen on X11 only, since the DISPLAY environment variable and -screen option for toplevels are not useful on Tk for Win32 or Aqua.

Added property-based tests to the :mod:`zoneinfo` tests, along with stubs for the hypothesis interface. (Patch by Paul Ganssle)

Regression tests for the behaviour of unittest.mock.PropertyMock were added.

fix use of poll in test_epoll's test_control_and_wait

Fix the :func:`os.spawn* <os.spawnl>` tests failing on Windows when the working directory or interpreter path contains spaces.

BOLT optimization is now applied to the libpython shared library if building a shared library. BOLT instrumentation and application settings can now be influenced via the BOLT_INSTRUMENT_FLAGS and BOLT_APPLY_FLAGS configure variables.

PYTHON_FOR_REGEN now require Python 3.10 or newer.

Define .PHONY / virtual make targets consistently and properly.

Add gcc fallback of mkfifoat/mknodat for macOS. Patch by Donghee Na.

The TKINTER_PROTECT_LOADTK macro is no longer defined or used in the _tkinter module. It was previously only defined when building against Tk 8.4.13 and older, but Tk older than 8.5.12 has been unsupported since gh-issue-91152.

Extended workaround defining static_assert when missing from the libc headers to all clang and gcc builds. In particular, this fixes building on macOS <= 10.10.

Changed the default value of the SHELL Makefile variable from /bin/sh to /bin/sh -e to ensure that complex recipes correctly fail after an error. Previously, make install could fail to install some files and yet return a successful result.

Add platform triplets for 64-bit LoongArch:

  • loongarch64-linux-gnusf
  • loongarch64-linux-gnuf32
  • loongarch64-linux-gnu

Patch by Zhang Na.

Update Windows installer to use SQLite 3.42.0.

Fix a potential [Errno 13] Permission denied when using :func:`shutil.copystat` within Windows Subsystem for Linux (WSL) on a mounted filesystem by adding errno.EACCES to the list of ignored errors within the internal implementation.

Fix virtual environment :file:`activate` script having incorrect line endings for Cygwin.

Fixes venvs not working in bash on Windows across different disks

Update Windows installer to use SQLite 3.41.2.

Fixed a bug where :exc:`TypeError` was raised when calling :func:`ntpath.realpath` with a bytes parameter in some cases.

Update macOS installer to Tcl/Tk 8.6.13.

Update macOS installer to SQLite 3.42.0.

Add os.PRIO_DARWIN_THREAD, os.PRIO_DARWIN_PROCESS, os.PRIO_DARWIN_BG and os.PRIO_DARWIN_NONUI. These can be used with os.setpriority to run the process at a lower priority and make use of the efficiency cores on Apple Silicon systems.

Support reading SOCKS proxy configuration from macOS System Configuration. Patch by Sam Schott.

update curses textbox to additionally handle backspace using the curses.ascii.DEL key press.

Update macOS installer to SQLite 3.41.2.

Fix completions for Tk Aqua 8.7 (currently blank).

About prints both tcl and tk versions if different (expected someday).

Fix IDLE test hang on macOS.

Argument Clinic C converters now accept the unused keyword, for wrapping a parameter with :c:macro:`Py_UNUSED`. Patch by Erlend E. Aasland.

Added unstable C API for extracting the value of "compact" integers: :c:func:`PyUnstable_Long_IsCompact` and :c:func:`PyUnstable_Long_CompactValue`.

We've added Py_NewInterpreterFromConfig() and PyInterpreterConfig to the public C-API (but not the stable ABI; not yet at least). The new function may be used to create a new interpreter with various features configured. The function was added to support PEP 684 (per-interpreter GIL).

:c:func:`PyType_FromSpec` and its variants now allow creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new`. The tp_new is ignored. This behavior is deprecated and will be disallowed in 3.14+. The new :c:func:`PyType_FromMetaclass` already disallows it.

Add :c:func:`PyUnstable_Object_GC_NewWithExtraData` function that can be used to allocate additional memory after an object for data not managed by Python.

Introduced :c:func:`PyUnstable_WritePerfMapEntry`, :c:func:`PyUnstable_PerfMapState_Init` and :c:func:`PyUnstable_PerfMapState_Fini`. These allow extension modules (JIT compilers in particular) to write to perf-map files in a thread safe manner. The :doc:`../howto/perf_profiling` also uses these APIs to write entries in the perf-map file.

Added C API for extending types whose instance memory layout is opaque: :c:member:`PyType_Spec.basicsize` can now be zero or negative, :c:func:`PyObject_GetTypeData` can be used to get subclass-specific data, and :c:macro:`Py_TPFLAGS_ITEMS_AT_END` can be used to safely extend variable-size objects. See PEP 697 for details.

Add a new C-API function to eagerly assign a version tag to a PyTypeObject: PyUnstable_Type_AssignVersionTag().

:c:macro:`PyObject_GC_Resize` should calculate preheader size if needed. Patch by Donghee Na.

Add support of more formatting options (left aligning, octals, uppercase hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C strings, variable width and precision) in :c:func:`PyUnicode_FromFormat` and :c:func:`PyUnicode_FromFormatV`.

Add unstable C-API functions to get the code object, lasti and line number from the internal _PyInterpreterFrame in the limited API. The functions are:

  • PyCodeObject * PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame)
  • int PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame)
  • int PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame)