Python 3.14.0a5

This commit is contained in:
Hugo van Kemenade 2025-02-11 19:16:07 +02:00
parent 5cdd6e5e75
commit 3ae9101482
148 changed files with 1721 additions and 622 deletions

View file

@ -76,7 +76,7 @@ Direct API functions
Resize the internal buffer of *bytearray* to *len*. Resize the internal buffer of *bytearray* to *len*.
Failure is a ``-1`` return with an exception set. Failure is a ``-1`` return with an exception set.
.. versionchanged:: next .. versionchanged:: 3.14
A negative *len* will now result in an exception being set and -1 returned. A negative *len* will now result in an exception being set and -1 returned.

View file

@ -623,7 +623,7 @@ Object Protocol
Objects that are immortal in one CPython version are not guaranteed to Objects that are immortal in one CPython version are not guaranteed to
be immortal in another. be immortal in another.
.. versionadded:: next .. versionadded:: 3.14
.. c:function:: int PyUnstable_TryIncRef(PyObject *obj) .. c:function:: int PyUnstable_TryIncRef(PyObject *obj)

View file

@ -17,7 +17,7 @@ a suspended *future*. These utilities and the underlying machinery
can be used from within a Python program or by external profilers can be used from within a Python program or by external profilers
and debuggers. and debuggers.
.. versionadded:: next .. versionadded:: 3.14
.. function:: print_call_graph(future=None, /, *, file=None, depth=1, limit=None) .. function:: print_call_graph(future=None, /, *, file=None, depth=1, limit=None)

View file

@ -2117,7 +2117,7 @@ Utility functions
executable file. It may be an empty string. executable file. It may be an empty string.
.. availability:: Windows, macOS, iOS, glibc, BSD libc, musl .. availability:: Windows, macOS, iOS, glibc, BSD libc, musl
.. versionadded:: next .. versionadded:: 3.14
.. function:: FormatError([code]) .. function:: FormatError([code])

View file

@ -392,7 +392,7 @@ An :class:`IMAP4` instance has the following methods:
iteration, and public method to remain stable, but should not subclass, iteration, and public method to remain stable, but should not subclass,
instantiate, compare, or otherwise directly reference the class. instantiate, compare, or otherwise directly reference the class.
.. versionadded:: next .. versionadded:: 3.14
.. method:: IMAP4.list([directory[, pattern]]) .. method:: IMAP4.list([directory[, pattern]])

View file

@ -316,7 +316,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
Add ``__builtins__`` attribute to functions. Add ``__builtins__`` attribute to functions.
.. versionchanged:: next .. versionchanged:: 3.14
Add ``f_generator`` attribute to frames. Add ``f_generator`` attribute to frames.

View file

@ -1683,7 +1683,7 @@ or `the MSDN <https://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx>`_ on Windo
:meth:`io.BufferedIOBase.readinto`, :meth:`io.BufferedIOBase.read`, or :meth:`io.BufferedIOBase.readinto`, :meth:`io.BufferedIOBase.read`, or
:meth:`io.TextIOBase.read` :meth:`io.TextIOBase.read`
.. versionadded:: next .. versionadded:: 3.14
.. function:: sendfile(out_fd, in_fd, offset, count) .. function:: sendfile(out_fd, in_fd, offset, count)

View file

@ -529,7 +529,7 @@ file then shutil will silently fallback on using less efficient
.. versionchanged:: 3.14 .. versionchanged:: 3.14
Solaris now uses :func:`os.sendfile`. Solaris now uses :func:`os.sendfile`.
.. versionchanged:: next .. versionchanged:: 3.14
Copy-on-write or server-side copy may be used internally via Copy-on-write or server-side copy may be used internally via
:func:`os.copy_file_range` on supported Linux filesystems. :func:`os.copy_file_range` on supported Linux filesystems.

View file

@ -2871,7 +2871,7 @@ objects.
>>> (grow, len(grow)) >>> (grow, len(grow))
(bytearray(b'abc\x00\x00'), 5) (bytearray(b'abc\x00\x00'), 5)
.. versionadded:: next .. versionadded:: 3.14
Since bytearray objects are sequences of integers (akin to a list), for a Since bytearray objects are sequences of integers (akin to a list), for a
bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be

View file

@ -1280,7 +1280,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
to this function) are not guaranteed to be immortal in future versions, to this function) are not guaranteed to be immortal in future versions,
and vice versa for mortal objects. and vice versa for mortal objects.
.. versionadded:: next .. versionadded:: 3.14
.. impl-detail:: .. impl-detail::

View file

@ -1325,7 +1325,7 @@ Filling
>>> turtle.circle(80) >>> turtle.circle(80)
>>> turtle.end_fill() >>> turtle.end_fill()
.. versionadded:: next .. versionadded:: 3.14
.. function:: begin_fill() .. function:: begin_fill()
@ -1713,7 +1713,7 @@ Special Turtle methods
... turtle.right(60) ... turtle.right(60)
... turtle.forward(100) ... turtle.forward(100)
.. versionadded:: next .. versionadded:: 3.14
.. function:: begin_poly() .. function:: begin_poly()
@ -2008,7 +2008,7 @@ Animation control
... fd(dist) ... fd(dist)
... rt(90) ... rt(90)
.. versionadded:: next .. versionadded:: 3.14
.. function:: delay(delay=None) .. function:: delay(delay=None)

View file

@ -297,7 +297,7 @@ The :mod:`uuid` module defines the special Nil and Max UUID values:
A special form of UUID that is specified to have all 128 bits set to zero A special form of UUID that is specified to have all 128 bits set to zero
according to :rfc:`RFC 9562, §5.9 <9562#section-5.9>`. according to :rfc:`RFC 9562, §5.9 <9562#section-5.9>`.
.. versionadded:: next .. versionadded:: 3.14
.. data:: MAX .. data:: MAX
@ -305,7 +305,7 @@ The :mod:`uuid` module defines the special Nil and Max UUID values:
A special form of UUID that is specified to have all 128 bits set to one A special form of UUID that is specified to have all 128 bits set to one
according to :rfc:`RFC 9562, §5.10 <9562#section-5.10>`. according to :rfc:`RFC 9562, §5.10 <9562#section-5.10>`.
.. versionadded:: next .. versionadded:: 3.14
.. seealso:: .. seealso::

View file

@ -626,7 +626,7 @@ also be used to improve performance.
`preserve_none <https://clang.llvm.org/docs/AttributeReference.html#preserve-none>`_ `preserve_none <https://clang.llvm.org/docs/AttributeReference.html#preserve-none>`_
calling convention. For example, Clang 19 and newer supports this feature. calling convention. For example, Clang 19 and newer supports this feature.
.. versionadded:: next .. versionadded:: 3.14
.. option:: --without-mimalloc .. option:: --without-mimalloc

View file

@ -21,10 +21,10 @@
#define PY_MINOR_VERSION 14 #define PY_MINOR_VERSION 14
#define PY_MICRO_VERSION 0 #define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
#define PY_RELEASE_SERIAL 4 #define PY_RELEASE_SERIAL 5
/* Version as a string */ /* Version as a string */
#define PY_VERSION "3.14.0a4+" #define PY_VERSION "3.14.0a5"
/*--end constants--*/ /*--end constants--*/

File diff suppressed because it is too large Load diff

1378
Misc/NEWS.d/3.14.0a5.rst Normal file

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
Fix compile errors with Clang 9 and older due to lack of ``__attribute__((fallthrough))`` support.

View file

@ -1,2 +0,0 @@
Drop ``test_embed`` from PGO training, whose contribution in recent
versions is considered to be ignorable.

View file

@ -1,3 +0,0 @@
Convert the :mod:`decimal` module to use :pep:`757` C API (export-import
integers), offering some speed-up if the integer part of the
:class:`~decimal.Decimal` instance is small. Patch by Sergey B Kirpichev.

View file

@ -1 +0,0 @@
Remove some internal test APIs for the experimental JIT compiler.

View file

@ -1,19 +0,0 @@
The following private functions are deprecated and planned for removal in
Python 3.18:
* :c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`.
* :c:func:`!_PyDict_GetItemStringWithError`: use :c:func:`PyDict_GetItemStringRef`.
* :c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`.
* :c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`.
* :c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`:
use :c:func:`PyLongWriter_Create`.
* :c:func:`!_PyThreadState_UncheckedGet`: use :c:func:`PyThreadState_GetUnchecked`.
* :c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`.
* :c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`.
* :c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`.
The `pythoncapi-compat project
<https://github.com/python/pythoncapi-compat/>`__ can be used to get these new
public functions on Python 3.13 and older.
Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
Add :c:func:`PyImport_ImportModuleAttr` and :c:func:`PyImport_ImportModuleAttrString`
helper functions to import a module and get an attribute of the module. Patch
by Victor Stinner.

View file

@ -1,3 +0,0 @@
Add :c:func:`PyUnstable_TryIncRef` and :c:func:`PyUnstable_EnableTryIncRef`
unstable APIs. These are helpers for dealing with unowned references in
a thread-safe way, particularly in the free threading build.

View file

@ -1,3 +0,0 @@
Remove the private ``_Py_InitializeMain()`` function. It was a
:term:`provisional API` added to Python 3.8 by :pep:`587`. Patch by Victor
Stinner.

View file

@ -1,4 +0,0 @@
Remove ``_PyInterpreterState_GetConfigCopy()`` and
``_PyInterpreterState_SetConfig()`` private functions. Use instead
:c:func:`PyConfig_Get` and :c:func:`PyConfig_Set`, public C API added by
:pep:`741` "Python Configuration C API". Patch by Victor Stinner.

View file

@ -1,2 +0,0 @@
Add :c:func:`PyUnstable_IsImmortal` for determining whether an object is
:term:`immortal`.

View file

@ -1,3 +0,0 @@
Remove :c:func:`PySequence_Fast` from the limited C API, since this function
has to be used with :c:macro:`PySequence_Fast_GET_ITEM` which never worked
in the limited C API. Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
Implement :c:func:`PyUnicode_KIND` and :c:func:`PyUnicode_DATA` as function,
in addition to the macros with the same names. The macros rely on C bit
fields which have compiler-specific layout. Patch by Victor Stinner.

View file

@ -1,3 +0,0 @@
Update :c:func:`PyGC_Enable()`, :c:func:`PyGC_Disable()`,
:c:func:`PyGC_IsEnabled()` to use atomic operation for thread-safety
at free-threading build. Patch by Donghee Na.

View file

@ -1 +0,0 @@
Added support for the ``Partitioned`` cookie flag in :mod:`http.cookies`.

View file

@ -1,3 +0,0 @@
If the current working directory cannot be determined due to permissions,
then import will no longer raise :exc:`PermissionError`. Patch by Alex
Willmer.

View file

@ -1,2 +0,0 @@
Add :func:`turtle.fill`, :func:`turtle.poly` and :func:`turtle.no_animation` context managers.
Patch by Marie Roald and Yngve Mardal Moe.

View file

@ -1,2 +0,0 @@
Fix crash with ``gi_frame.f_locals`` when generator frames outlive their
generator. Patch by Mikhail Efimov.

View file

@ -1,2 +0,0 @@
Fixed the error when resizing terminal in Python REPL. Patch by Semyon
Moroz.

View file

@ -1 +0,0 @@
Slightly optimize the :class:`int` deallocator.

View file

@ -1,3 +0,0 @@
Fix handling of :attr:`UnicodeError.start` and :attr:`UnicodeError.end`
values in the :func:`codecs.xmlcharrefreplace_errors` error handler.
Patch by Bénédikt Tran.

View file

@ -1,3 +0,0 @@
Fix handling of :attr:`UnicodeError.start` and :attr:`UnicodeError.end`
values in the :func:`codecs.backslashreplace_errors` error handler. Patch by
Bénédikt Tran.

View file

@ -1,3 +0,0 @@
Fix handling of :attr:`UnicodeError.start` and :attr:`UnicodeError.end`
values in the :func:`codecs.replace_errors` error handler. Patch by Bénédikt
Tran.

View file

@ -1 +0,0 @@
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"?``.

View file

@ -1 +0,0 @@
Restore terminal control characters on REPL exit.

View file

@ -1,2 +0,0 @@
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.

View file

@ -1 +0,0 @@
Improve performance of iterating over lists and tuples by using a freelist for the iterator objects.

View file

@ -1 +0,0 @@
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.

View file

@ -1,2 +0,0 @@
Add opcode ``BINARY_OP_EXTEND`` which executes a pair of functions (guard and
specialization functions) accessed from the inline cache.

View file

@ -1,6 +0,0 @@
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 :mod:`sys`. For most programs, this marking phase should
make the GC a bit faster since typically less work is done per object.

View file

@ -1,2 +0,0 @@
Undocumented and unused private C-API functions ``_PyTrash_begin`` and
``_PyTrash_end`` are removed.

View file

@ -1 +0,0 @@
Specialize ``BINARY_OP`` for bitwise logical operations on compact ints.

View file

@ -1 +0,0 @@
Collect JIT memory stats using pystats. Patch by Diego Russo.

View file

@ -1 +0,0 @@
Add frame of ``except*`` to traceback when it wraps a naked exception.

View file

@ -1 +0,0 @@
Fix the potential races in get/set dunder methods ``__annotations__``, ``__annotate__`` and ``__type_params__`` for function object, and add related tests.

View file

@ -1 +0,0 @@
Treat debug expressions in f-string as raw strings. Patch by Pablo Galindo

View file

@ -1,2 +0,0 @@
Fix f-strings such as ``f'{expr=}'`` sometimes not displaying the full
expression when the expression contains ``!=``.

View file

@ -1,5 +0,0 @@
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.

View file

@ -1,2 +0,0 @@
Add fast path for medium-size integers in :c:func:`PyLong_FromUnsignedLong`,
:c:func:`PyLong_FromUnsignedLongLong` and :c:func:`PyLong_FromSize_t`.

View file

@ -1 +0,0 @@
Improve memory layout of JIT traces. Patch by Diego Russo

View file

@ -1 +0,0 @@
Fix null pointer dereference in :func:`syslog.openlog` when an audit hook raises an exception.

View file

@ -1,2 +0,0 @@
On FreeBSD, :data:`sys.platform` doesn't contain the major version anymore.
It is always ``'freebsd'``, instead of ``'freebsd13'`` or ``'freebsd14'``.

View file

@ -1,2 +0,0 @@
Fix an issue where the "lltrace" debug feature could have been incorrectly
enabled for some frames.

View file

@ -1 +0,0 @@
Fix thread safety of :c:func:`PyList_SetItem` in free-threading builds. Patch by Kumar Aditya.

View file

@ -1,2 +0,0 @@
Fix race condition when raising :exc:`MemoryError` in the free threaded
build.

View file

@ -1 +0,0 @@
Fix thread safety of :c:func:`PyList_Insert` in free-threading builds.

View file

@ -1 +0,0 @@
Improve JIT performance for generators.

View file

@ -1 +0,0 @@
Remove the internal ``LLTRACE`` macro (use :c:macro:`Py_DEBUG` instead).

View file

@ -1 +0,0 @@
Fixed a race in ``_Py_qsbr_reserve`` in the free threading build.

View file

@ -1 +0,0 @@
Replace the opcode BINARY_SUBSCR and its family by BINARY_OP with oparg NB_SUBSCR.

View file

@ -1,3 +0,0 @@
Document that :const:`string.printable` is not printable in the POSIX sense.
In particular, :meth:`string.printable.isprintable() <str.isprintable>` returns
:const:`False`. Patch by Bénédikt Tran.

View file

@ -1,2 +0,0 @@
Require Sphinx 8.1.3 or later to build the Python documentation. Patch by
Adam Turner.

View file

@ -1,2 +0,0 @@
Simplify displaying the IDLE doc by only copying the text section of
idle.html to idlelib/help.html. Patch by Stan Ulbrych.

View file

@ -1 +0,0 @@
Add attribute and item access support to :class:`string.Formatter` in auto-numbering mode, which allows format strings like '{.name}' and '{[1]}'.

View file

@ -1,5 +0,0 @@
Use :func:`os.copy_file_range` in :func:`shutil.copy`, :func:`shutil.copy2`,
and :func:`shutil.copyfile` functions by default. An underlying Linux system
call gives filesystems an opportunity to implement the use of copy-on-write
(in case of btrfs and XFS) or server-side copy (in the case of NFS.)
Patch by Illia Volochii.

View file

@ -1,3 +0,0 @@
Support custom messages for domain errors in the :mod:`math` module
(:func:`math.sqrt`, :func:`math.log` and :func:`math.atanh` were modified as
examples). Patch by Charlie Zhao and Sergey B Kirpichev.

View file

@ -1,2 +0,0 @@
Show tab completions menu below the current line, which results in less
janky behaviour, and fixes a cursor movement bug. Patch by Daniel Hollas

View file

@ -1 +0,0 @@
Add IMAP4 ``IDLE`` support to the :mod:`imaplib` module. Patch by Forest.

View file

@ -1,2 +0,0 @@
Add the :func:`ctypes.util.dllist` function to list the loaded shared
libraries for the current process.

View file

@ -1,3 +0,0 @@
Fixed issue in NamespaceReader where a non-path item in a namespace path,
such as a sentinel added by an editable installer, would break resource
loading.

View file

@ -1 +0,0 @@
Quitting :mod:`pdb` in ``inline`` mode will emit a confirmation prompt and exit gracefully now, instead of printing an exception traceback.

View file

@ -1,2 +0,0 @@
Add :func:`asyncio.capture_call_graph` and
:func:`asyncio.print_call_graph` functions.

View file

@ -1,2 +0,0 @@
Fix round-trip invariance for backslash continuations in
:func:`tokenize.untokenize`.

View file

@ -1 +0,0 @@
Fix _pyrepl crash when entering a double CTRL-Z on an overflowing line.

View file

@ -1 +0,0 @@
Deprecate ``pdb.Pdb.curframe_locals``

View file

@ -1,2 +0,0 @@
Do not recreate unnamed section on every read in
:class:`configparser.ConfigParser`. Patch by Andrey Efremov.

View file

@ -1 +0,0 @@
Fix handling of the ``secure`` argument of :class:`logging.handlers.SMTPHandler`.

View file

@ -1,6 +0,0 @@
Add :attr:`pathlib.Path.info` attribute, which stores an object
implementing the :class:`pathlib.types.PathInfo` protocol (also new). The
object supports querying the file type and internally caching
:func:`~os.stat` results. Path objects generated by
:meth:`~pathlib.Path.iterdir` are initialized with file type information
gleaned from scanning the parent directory.

View file

@ -1,3 +0,0 @@
When ``-E`` is set, only ignore ``PYTHON_COLORS`` and not
``FORCE_COLOR``/``NO_COLOR``/``TERM`` when colourising output.
Patch by Hugo van Kemenade.

View file

@ -1 +0,0 @@
Add missing Deprecation warnings for :const:`importlib.machinery.DEBUG_BYTECODE_SUFFIXES`, :const:`importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES`, :class:`importlib.machinery.WindowsRegistryFinder`, :class:`importlib.abc.ResourceLoader`, :meth:`importlib.abc.SourceLoader.path_mtime`.

View file

@ -1,2 +0,0 @@
Fix exceptions and incomplete writes after :class:`!asyncio._SelectorTransport`
is closed before writes are completed.

View file

@ -1 +0,0 @@
Avoid reusing quote types in :func:`ast.unparse` if not needed.

View file

@ -1,2 +0,0 @@
Completely support random access of uncompressed unencrypted read-only
zip files obtained by :meth:`ZipFile.open <zipfile.ZipFile.open>`.

View file

@ -1 +0,0 @@
Fixed a frame reference leak in :mod:`bdb`.

View file

@ -1,2 +0,0 @@
Fix incorrect handling of negative read sizes in :meth:`HTTPResponse.read
<http.client.HTTPResponse.read>`. Patch by Yury Manushkin.

View file

@ -1,3 +0,0 @@
:meth:`zipfile.ZipFile.writestr` now respect ``SOURCE_DATE_EPOCH`` that
distributions can set centrally and have build tools consume this in order
to produce reproducible output.

View file

@ -1,2 +0,0 @@
:const:`uuid.NIL` and :const:`uuid.MAX` are now available to represent the Nil
and Max UUID formats as defined by :rfc:`9562`.

View file

@ -1 +0,0 @@
Fix :func:`!asyncio.staggered.staggered_race` leaking tasks and issuing an unhandled exception.

View file

@ -1,2 +0,0 @@
Add :func:`sys._is_immortal` for identifying :term:`immortal` objects at
runtime.

View file

@ -1,5 +0,0 @@
Add locking to :mod:`warnings` to avoid some data races when free-threading
is used. Change ``_warnings_runtime_state.mutex`` to be a recursive mutex
and expose it to :mod:`warnings`, via the :func:`!_acquire_lock` and
:func:`!_release_lock` functions. The lock is held when ``filters`` and
``_filters_version`` are updated.

View file

@ -1,2 +0,0 @@
Default to stdout isatty for color detection instead of stderr. Patch by
Hugo van Kemenade.

View file

@ -1,2 +0,0 @@
Fix PyREPL failure when :data:`os.environ` is overwritten with an invalid
value.

View file

@ -1,3 +0,0 @@
When using macOS system ``libffi``, support for complex types in
:mod:`ctypes` is now checked at runtime (macOS 10.15 or newer). The types
must also be available at build time.

View file

@ -1,5 +0,0 @@
Improve the performance of :func:`base64.b16decode` by up to ten times
by more efficiently checking the byte-string for hexadecimal digits.
Reduce the import time of :mod:`base64` by up to six times,
by no longer importing :mod:`re`.
Patch by Bénédikt Tran, Chris Markiewicz, and Adam Turner.

View file

@ -1 +0,0 @@
Support the *name* keyword argument for eager tasks in :func:`asyncio.loop.create_task`, :func:`asyncio.create_task` and :func:`asyncio.TaskGroup.create_task`, by passing on all *kwargs* to the task factory set by :func:`asyncio.loop.set_task_factory`.

Some files were not shown because too many files have changed in this diff Show more