Python 3.14.0a3

This commit is contained in:
Hugo van Kemenade 2024-12-17 11:49:37 +02:00
parent b9a492b809
commit 401bfc69d1
120 changed files with 1200 additions and 279 deletions

View File

@ -657,7 +657,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
Export API
^^^^^^^^^^
.. versionadded:: next
.. versionadded:: 3.14
.. c:struct:: PyLongLayout
@ -769,7 +769,7 @@ PyLongWriter API
The :c:type:`PyLongWriter` API can be used to import an integer.
.. versionadded:: next
.. versionadded:: 3.14
.. c:struct:: PyLongWriter

View File

@ -1964,7 +1964,7 @@ Utility functions
.. availability:: Windows
.. versionadded:: next
.. versionadded:: 3.14
.. function:: cast(obj, type)
@ -2825,4 +2825,4 @@ Exceptions
.. availability:: Windows
.. versionadded:: next
.. versionadded:: 3.14

View File

@ -617,7 +617,7 @@ defined by the module. The specific list of defined symbols is available as
Memory page has hardware error.
.. versionadded:: next
.. versionadded:: 3.14
.. data:: EALREADY

View File

@ -324,7 +324,7 @@ Edge and Level Trigger Polling (epoll) Objects
:const:`EPOLLEXCLUSIVE` was added. It's only supported by Linux Kernel 4.5
or later.
.. versionadded:: next
.. versionadded:: 3.14
:const:`EPOLLWAKEUP` was added. It's only supported by Linux Kernel 3.5
or later.

View File

@ -4153,7 +4153,7 @@ copying.
Count the number of occurrences of *value*.
.. versionadded:: next
.. versionadded:: 3.14
.. method:: index(value, start=0, stop=sys.maxsize, /)
@ -4162,7 +4162,7 @@ copying.
Raises a :exc:`ValueError` if *value* cannot be found.
.. versionadded:: next
.. versionadded:: 3.14
There are also several readonly attributes available:

View File

@ -20,10 +20,10 @@
#define PY_MINOR_VERSION 14
#define PY_MICRO_VERSION 0
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
#define PY_RELEASE_SERIAL 2
#define PY_RELEASE_SERIAL 3
/* Version as a string */
#define PY_VERSION "3.14.0a2+"
#define PY_VERSION "3.14.0a3"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Tue Nov 19 16:52:22 2024
# Autogenerated by Sphinx on Tue Dec 17 11:49:52 2024
# as part of the release process.
topics = {'assert': 'The "assert" statement\n'
'**********************\n'
@ -1312,15 +1312,19 @@
'The arguments must either both be numbers, or one argument must be '
'an\n'
'integer and the other must be a sequence. In the former case, the\n'
'numbers are converted to a common type and then multiplied '
'together.\n'
'In the latter case, sequence repetition is performed; a negative\n'
'repetition factor yields an empty sequence.\n'
'numbers are converted to a common real type and then multiplied\n'
'together. In the latter case, sequence repetition is performed; '
'a\n'
'negative repetition factor yields an empty sequence.\n'
'\n'
'This operation can be customized using the special "__mul__()" '
'and\n'
'"__rmul__()" methods.\n'
'\n'
'Changed in version 3.14: If only one operand is a complex number, '
'the\n'
'other operand is converted to a floating-point number.\n'
'\n'
'The "@" (at) operator is intended to be used for matrix\n'
'multiplication. No builtin Python types implement this operator.\n'
'\n'
@ -1391,21 +1395,30 @@
'arguments must either both be numbers or both be sequences of the '
'same\n'
'type. In the former case, the numbers are converted to a common '
'type\n'
'and then added together. In the latter case, the sequences are\n'
'real\n'
'type and then added together. In the latter case, the sequences '
'are\n'
'concatenated.\n'
'\n'
'This operation can be customized using the special "__add__()" '
'and\n'
'"__radd__()" methods.\n'
'\n'
'Changed in version 3.14: If only one operand is a complex number, '
'the\n'
'other operand is converted to a floating-point number.\n'
'\n'
'The "-" (subtraction) operator yields the difference of its '
'arguments.\n'
'The numeric arguments are first converted to a common type.\n'
'The numeric arguments are first converted to a common real type.\n'
'\n'
'This operation can be customized using the special "__sub__()" '
'and\n'
'"__rsub__()" methods.\n',
'"__rsub__()" methods.\n'
'\n'
'Changed in version 3.14: If only one operand is a complex number, '
'the\n'
'other operand is converted to a floating-point number.\n',
'bitwise': 'Binary bitwise operations\n'
'*************************\n'
'\n'
@ -4561,18 +4574,18 @@
'\n'
'When a description of an arithmetic operator below uses the '
'phrase\n'
'“the numeric arguments are converted to a common type”, this '
'means\n'
'that the operator implementation for built-in types works as '
'“the numeric arguments are converted to a common real type”, '
'this\n'
'means that the operator implementation for built-in types '
'works as\n'
'follows:\n'
'\n'
'* If either argument is a complex number, the other is '
'converted to\n'
' complex;\n'
'* If both arguments are complex numbers, no conversion is '
'performed;\n'
'\n'
'* otherwise, if either argument is a floating-point number, '
'the other\n'
' is converted to floating point;\n'
'* if either argument is a complex or a floating-point number, '
'the\n'
' other is converted to a floating-point number;\n'
'\n'
'* otherwise, both must be integers and no conversion is '
'necessary.\n'
@ -7144,8 +7157,12 @@
'trailing zeros are not removed from the result.\n'
'\n'
'The "\',\'" option signals the use of a comma for a '
'thousands separator.\n'
'For a locale aware separator, use the "\'n\'" integer '
'thousands separator\n'
'for floating-point presentation types and for integer '
'presentation\n'
'type "\'d\'". For other presentation types, this option is '
'an error. For\n'
'a locale aware separator, use the "\'n\'" integer '
'presentation type\n'
'instead.\n'
'\n'

1152
Misc/NEWS.d/3.14.0a3.rst Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
The Emscripten build of Python is now based on ES6 modules.

View File

@ -1 +0,0 @@
Make ``jit_stencils.h`` (which is produced during JIT builds) reproducible.

View File

@ -1,2 +0,0 @@
Updated the Emscripten web example to use ES6 modules and be built into a
distinct ``web_example`` subfolder.

View File

@ -1 +0,0 @@
Emscripten builds now include ctypes support.

View File

@ -1 +0,0 @@
Fix build failure on systems without thread-locals support.

View File

@ -1,2 +0,0 @@
``PyThreadState_Clear()`` now warns (and calls ``sys.excepthook``) if the
thread state still has an active exception.

View File

@ -1,10 +0,0 @@
Add a new import and export API for Python :class:`int` objects (:pep:`757`):
* :c:func:`PyLong_GetNativeLayout`;
* :c:func:`PyLong_Export`;
* :c:func:`PyLong_FreeExport`;
* :c:func:`PyLongWriter_Create`;
* :c:func:`PyLongWriter_Finish`;
* :c:func:`PyLongWriter_Discard`.
Patch by Victor Stinner.

View File

@ -1 +0,0 @@
Reading text from a non-blocking stream with ``read`` may now raise a :exc:`BlockingIOError` if the operation cannot immediately return bytes.

View File

@ -1,6 +0,0 @@
Ensure that the value of :attr:`UnicodeEncodeError.start <UnicodeError.start>`
retrieved by :c:func:`PyUnicodeEncodeError_GetStart` lies in
``[0, max(0, objlen - 1)]`` where *objlen* is the length of
:attr:`UnicodeEncodeError.object <UnicodeError.object>`. Similar
arguments apply to :exc:`UnicodeDecodeError` and :exc:`UnicodeTranslateError`
and their corresponding C interface. Patch by Bénédikt Tran.

View File

@ -1,2 +0,0 @@
Improve error message when calling the C API without an active thread state
on the :term:`free-threaded <free threading>` build.

View File

@ -1,6 +0,0 @@
Ensure that the value of :attr:`UnicodeEncodeError.end <UnicodeError.end>`
retrieved by :c:func:`PyUnicodeEncodeError_GetEnd` lies in ``[min(1, objlen),
max(min(1, objlen), objlen)]`` where *objlen* is the length of
:attr:`UnicodeEncodeError.object <UnicodeError.object>`. Similar arguments
apply to :exc:`UnicodeDecodeError` and :exc:`UnicodeTranslateError` and their
corresponding C interface. Patch by Bénédikt Tran.

View File

@ -1,3 +0,0 @@
The :ref:`Unicode Exception Objects <unicodeexceptions>` C API
now raises a :exc:`TypeError` if its exception argument is not
a :exc:`UnicodeError` object. Patch by Bénédikt Tran.

View File

@ -1,2 +0,0 @@
Fix loss of callbacks after more than one call to
:c:func:`PyUnstable_AtExit`.

View File

@ -1,2 +0,0 @@
The previously undocumented function :c:func:`PySequence_In` is :term:`soft deprecated`.
Use :c:func:`PySequence_Contains` instead.

View File

@ -1 +0,0 @@
If :func:`!_thread.start_new_thread` fails to start a new thread, it deletes its state from interpreter and thus avoids its repeated cleanup on finalization.

View File

@ -1,2 +0,0 @@
Correct invalid corner cases which resulted in ``(nan+nanj)`` output in complex
multiplication, e.g., ``(1e300+1j)*(nan+infj)``. Patch by Sergey B Kirpichev.

View File

@ -1,2 +0,0 @@
Implement mixed-mode arithmetic rules combining real and complex numbers
as specified by C standards since C99. Patch by Sergey B Kirpichev.

View File

@ -1 +0,0 @@
Fix crash in free-threaded builds when replacing object dictionary while reading attribute on another thread

View File

@ -1,2 +0,0 @@
Add :meth:`memoryview.count` to :class:`memoryview` objects. Patch by
Bénédikt Tran.

View File

@ -1,2 +0,0 @@
Add :meth:`memoryview.index` to :class:`memoryview` objects. Patch by
Bénédikt Tran.

View File

@ -1,2 +0,0 @@
Optimize decoding of short UTF-8 sequences containing non-ASCII characters
by approximately 15%.

View File

@ -1,2 +0,0 @@
Ensure stack traces are complete when throwing into a generator chain that
ends in a custom generator.

View File

@ -1,2 +0,0 @@
Require cold or invalidated code to "warm up" before being JIT compiled
again.

View File

@ -1 +0,0 @@
Fix crash in finalization of dtoa state. Patch by Kumar Aditya.

View File

@ -1 +0,0 @@
Increase performance of :class:`int` by adding a freelist for compact ints.

View File

@ -1,3 +0,0 @@
Fix :exc:`TypeError` when a :class:`ctypes.Structure` has a field size
that doesn't fit into an unsigned 16-bit integer.
Instead, the maximum number of *bits* is :data:`sys.maxsize`.

View File

@ -1,3 +0,0 @@
Fix :meth:`~object.__buffer__` of :class:`bytearray` crashing when
:attr:`~inspect.BufferFlags.READ` or :attr:`~inspect.BufferFlags.WRITE` are
passed as flags.

View File

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

View File

@ -1,4 +0,0 @@
Fix a crash in the free threading build when :c:func:`PyCode_GetCode`,
:c:func:`PyCode_GetVarnames`, :c:func:`PyCode_GetCellvars`, or
:c:func:`PyCode_GetFreevars` were called from multiple threads at the same
time.

View File

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

View File

@ -1,6 +0,0 @@
Calling :meth:`argparse.ArgumentParser.add_argument_group` on an argument group,
and calling :meth:`argparse.ArgumentParser.add_argument_group` or
:meth:`argparse.ArgumentParser.add_mutually_exclusive_group` on a mutually
exclusive group now raise exceptions. This nesting was never supported, often
failed to work correctly, and was unintentionally exposed through inheritance.
This functionality has been deprecated since Python 3.11.

View File

@ -1,2 +0,0 @@
Fix possible undefined behavior division by zero in :class:`complex`'s
:c:func:`_Py_c_pow`.

View File

@ -1 +0,0 @@
Correct error message for :func:`sys.set_int_max_str_digits`.

View File

@ -1 +0,0 @@
Fix race when exporting a buffer from a :class:`memoryview` object on the :term:`free-threaded <free threading>` build.

View File

@ -1,2 +0,0 @@
Add missing locks around some list assignment operations in the free
threading build.

View File

@ -1 +0,0 @@
The iOS compiler shims can now accept arguments with spaces.

View File

@ -1,2 +0,0 @@
Fix non-thread-safe object resurrection when calling finalizers and watcher
callbacks in the free threading build.

View File

@ -1 +0,0 @@
When raising :exc:`ImportError` for missing symbols in ``from`` imports, use ``__file__`` in the error message if ``__spec__.origin`` is not a location

View File

@ -1,2 +0,0 @@
Fix statistics for increments of object reference counts (in particular, when
a reference count was increased by more than 1 in a single operation).

View File

@ -1,3 +0,0 @@
``PySequence_Tuple`` now creates the resulting tuple atomically, preventing
partially created tuples being visible to the garbage collector or through
``gc.get_referrers()``

View File

@ -1,3 +0,0 @@
Fix error message in :func:`bytes.fromhex` when given an odd number of
digits to properly indicate that an even number of hexadecimal digits is
required.

View File

@ -1 +0,0 @@
Publicly expose :func:`traceback.print_list` in :attr:`!traceback.__all__`.

View File

@ -1,10 +0,0 @@
Authentication was added to the :mod:`multiprocessing` forkserver start
method control socket so that only processes with the authentication key
generated by the process that spawned the forkserver can control it. This
is an enhancement over the other :gh:`97514` fixes so that access is no
longer limited only by filesystem permissions.
The file descriptor exchange of control pipes with the forked worker process
now requires an explicit acknowledgement byte to be sent over the socket after
the exchange on all forkserver supporting platforms. That makes testing the
above much easier.

View File

@ -1,2 +0,0 @@
Fixed :class:`multiprocessing.Process` reporting a ``.exitcode`` of 1 even on success when
using the ``"fork"`` start method while using a :class:`concurrent.futures.ThreadPoolExecutor`.

View File

@ -1,2 +0,0 @@
Improve the performances of :func:`fnmatch.translate` by a factor 1.7. Patch
by Bénédikt Tran.

View File

@ -1,3 +0,0 @@
Guarantee that the position of a file-like object passed to
:func:`zipfile.is_zipfile` is left untouched after the call.
Patch by Bénédikt Tran.

View File

@ -1 +0,0 @@
:func:`readline.append_history_file` now raises a :exc:`ValueError` when given a negative value.

View File

@ -1,3 +0,0 @@
The :mod:`http.cookies` module now supports parsing obsolete :rfc:`850`
date formats, in accordance with :rfc:`9110` requirements.
Patch by Nano Zheng.

View File

@ -1,2 +0,0 @@
Fix possible crash (in debug build), incorrect output or returning incorrect
value from raw binary ``write()`` when writing to console on Windows.

View File

@ -1,2 +0,0 @@
The ``usage`` parameter of :class:`argparse.ArgumentParser` no longer
affects the default value of the ``prog`` parameter in subparsers.

View File

@ -1,2 +0,0 @@
Fixed intermittent failures of :any:`os.confstr`, :any:`os.pathconf` and
:any:`os.sysconf` on iOS and Android.

View File

@ -1 +0,0 @@
Add :data:`~errno.EHWPOISON` error code to :mod:`errno`.

View File

@ -1,3 +0,0 @@
``locale.nl_langinfo(locale.ERA)`` now returns multiple era description
segments separated by semicolons. Previously it only returned the first
segment on platforms with Glibc.

View File

@ -1,3 +0,0 @@
Fix issue where :func:`urllib.request.pathname2url` raised :exc:`OSError`
when given a Windows path containing a colon character not following a
drive letter, such as before an NTFS alternate data stream.

View File

@ -1 +0,0 @@
Make :func:`linecache.checkcache` thread safe and GC re-entrancy safe.

View File

@ -1 +0,0 @@
Fix :func:`os.path.normpath` for drive-relative paths on Windows.

View File

@ -1,4 +0,0 @@
Fix issue where :func:`urllib.request.url2pathname` and
:func:`~urllib.request.pathname2url` always used UTF-8 when quoting and
unquoting file URIs. They now use the :term:`filesystem encoding and error
handler`.

View File

@ -1,2 +0,0 @@
Make tkinter widget methods :meth:`!after` and :meth:`!after_idle` accept
arguments passed by keyword.

View File

@ -1,3 +0,0 @@
Improve the :exc:`~getopt.GetoptError` error message when a long option
prefix matches multiple accepted options in :func:`getopt.getopt` and
:func:`getopt.gnu_getopt`.

View File

@ -1,2 +0,0 @@
Raise :exc:`TypeError` in :meth:`!_pydatetime.timedelta.__new__` if the passed arguments are not :class:`int` or :class:`float`, so that the Python
implementation is in line with the C implementation.

View File

@ -1,2 +0,0 @@
Improve import time of :mod:`mimetypes` by around 11-16 times. Patch by Hugo
van Kemenade.

View File

@ -1 +0,0 @@
In the :mod:`trace` module, increase the coverage precision (``cov%``) to one decimal.

View File

@ -1,3 +0,0 @@
When running under a virtual environment with the :mod:`site` disabled (see
:option:`-S`), :data:`sys.prefix` and :data:`sys.base_prefix` will now point
to the virtual environment, instead of the base installation.

View File

@ -1,2 +0,0 @@
The :exc:`~ctypes.COMError` exception is now public.
Previously, this was private and only available in ``_ctypes``.

View File

@ -1,2 +0,0 @@
Fix the representation of :class:`itertools.count` objects when the count
value is :data:`sys.maxsize`.

View File

@ -1,2 +0,0 @@
:mod:`grp`: Make :func:`grp.getgrall` thread-safe by adding a mutex. Patch
by Victor Stinner.

View File

@ -1,3 +0,0 @@
Fix support of STRING and GLOBAL opcodes with non-ASCII arguments in
:mod:`pickletools`. :func:`pickletools.dis` now outputs non-ASCII bytes in
STRING, BINSTRING and SHORT_BINSTRING arguments as escaped (``\xXX``).

View File

@ -1 +0,0 @@
Fix LONG and INT opcodes to only use base 10 for string to integer conversion in :mod:`pickle`.

View File

@ -1,3 +0,0 @@
Fix value of :attr:`urllib.response.addinfourl.url` for ``file:`` URLs that
express relative paths and absolute Windows paths. The canonical URL generated
by :func:`urllib.request.pathname2url` is now used.

View File

@ -1,2 +0,0 @@
Fix crash when calling a :func:`operator.methodcaller` instance from
multiple threads in the free threading build.

View File

@ -1,2 +0,0 @@
Fix issue where :func:`urllib.request.url2pathname` failed to discard any
'localhost' authority present in the URL.

View File

@ -1,2 +0,0 @@
Fix issue where :func:`urllib.request.url2pathname` failed to discard an
extra slash before a UNC drive in the URL path on Windows.

View File

@ -1,2 +0,0 @@
:func:`urllib.request.pathname2url` and :func:`~urllib.request.url2pathname`
no longer convert Windows drive letters to uppercase.

View File

@ -1 +0,0 @@
Support PyREPL history on Windows. Patch by devdanzin and Victor Stinner.

View File

@ -1,4 +0,0 @@
Fix :mod:`shutil.which` on Windows. Now it looks at direct match if and only
if the command ends with a PATHEXT extension or X_OK is not in mode. Support
extensionless files if "." is in PATHEXT. Support PATHEXT extensions that end
with a dot.

View File

@ -1 +0,0 @@
Add colour to :mod:`unittest` output. Patch by Hugo van Kemenade.

View File

@ -1,5 +0,0 @@
:func:`urllib.request.pathname2url` now adds an empty authority when
generating a URL for a path that begins with exactly one slash. For example,
the path ``/etc/hosts`` is converted to the scheme-less URL ``///etc/hosts``.
As a result of this change, URLs without authorities are only generated for
relative paths.

View File

@ -1,2 +0,0 @@
Fix :func:`urllib.request.pathname2url` for paths starting with multiple
slashes on Posix.

View File

@ -1,2 +0,0 @@
Fix :meth:`!io.StringIO.__setstate__` crash, when :const:`None` was passed as
the first value.

View File

@ -1,2 +0,0 @@
The :func:`~ctypes.CopyComPointer` function is now public.
Previously, this was private and only available in ``_ctypes``.

View File

@ -1 +0,0 @@
Remove outdated ``socket.NETLINK_*`` constants not present in Linux kernels beyond 2.6.17.

View File

@ -1,4 +0,0 @@
A ``_sysconfig_vars_(...).json`` file is now shipped in the standard library
directory. It contains the output of :func:`sysconfig.get_config_vars` on
the default environment encoded as JSON data. This is an implementation
detail, and may change at any time.

View File

@ -1,2 +0,0 @@
Fix faulthandler for trampoline frames. If the top-most frame is a
trampoline frame, skip it. Patch by Victor Stinner.

View File

@ -1 +0,0 @@
:mod:`ssl` can show descriptions for errors added in OpenSSL 3.4.

View File

@ -1 +0,0 @@
Publicly expose :data:`~token.EXACT_TOKEN_TYPES` in :attr:`!token.__all__`.

View File

@ -1,2 +0,0 @@
On Linux, :class:`threading.Thread` now sets the thread name to the
operating system. Patch by Victor Stinner.

View File

@ -1,2 +0,0 @@
In :mod:`ssl`, system call failures that OpenSSL reports using
``ERR_LIB_SYS`` are now raised as :exc:`OSError`.

View File

@ -1,3 +0,0 @@
Revert addition of :meth:`!pathlib.Path.scandir`. This method was added in
3.14.0a2. The optimizations remain for file system paths, but other
subclasses should only have to implement :meth:`pathlib.Path.iterdir`.

View File

@ -1,2 +0,0 @@
Add the :option:`dis --specialized` command-line option to show specialized
bytecode. Patch by Bénédikt Tran.

View File

@ -1,3 +0,0 @@
Fixed bug where, on cross-builds, the :mod:`sysconfig` POSIX data was being
generated with the host Python's ``Makefile``. The data is now generated from
current build's ``Makefile``.

View File

@ -1 +0,0 @@
:func:`pdb.set_trace` will not stop at an opcode that does not have an associated line number anymore.

View File

@ -1 +0,0 @@
Make :func:`operator.methodcaller` thread-safe and re-entrant safe.

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