Python 3.13.1

This commit is contained in:
Thomas Wouters 2024-12-03 18:55:12 +01:00
parent dddea7c232
commit 0671451779
186 changed files with 2509 additions and 686 deletions

View file

@ -944,7 +944,7 @@ always available.
This function should be used for specialized purposes only.
It is not guaranteed to exist in all implementations of Python.
.. versionchanged:: next
.. versionchanged:: 3.13.1
The result may include objects from other interpreters.

View file

@ -18,12 +18,12 @@
/*--start constants--*/
#define PY_MAJOR_VERSION 3
#define PY_MINOR_VERSION 13
#define PY_MICRO_VERSION 0
#define PY_MICRO_VERSION 1
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
#define PY_RELEASE_SERIAL 0
/* Version as a string */
#define PY_VERSION "3.13.0+"
#define PY_VERSION "3.13.1"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

File diff suppressed because it is too large Load diff

1882
Misc/NEWS.d/3.13.1.rst Normal file

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
Fix cross compile failures when the host and target SOABIs match.

View file

@ -1 +0,0 @@
Use WASI SDK 24 for testing.

View file

@ -1 +0,0 @@
Allow for specifying the target compile triple for WASI.

View file

@ -1,2 +0,0 @@
Fix detection of whether ``-latomic`` is needed when cross-compiling CPython
using the configure script.

View file

@ -1,2 +0,0 @@
Improve detection of float word ordering on Linux when link-time optimizations
are enabled.

View file

@ -1,2 +0,0 @@
The Android build now supports `16 KB page sizes
<https://developer.android.com/guide/practices/page-sizes>`__.

View file

@ -1 +0,0 @@
Hard-code float word ordering as little endian on WASM.

View file

@ -1,2 +0,0 @@
Set ``wasm32-wasip1`` as the WASI target. The old ``wasm32-wasi`` target is
deprecated so it can be used for an eventual WASI 1.0.

View file

@ -1,2 +0,0 @@
Added ``Py_IsInitialized`` to the list of APIs that are safe to call before
the interpreter is initialized, and updated the embedding tests to cover it.

View file

@ -1,3 +0,0 @@
Fix a bug where dictionary watchers (e.g., :c:func:`PyDict_Watch`) on an
object's attribute dictionary (:attr:`~object.__dict__`) were not triggered
when the object's attributes were modified.

View file

@ -1,2 +0,0 @@
Fix error handling in :class:`ctypes.CDLL` objects
which could result in a crash in rare situations.

View file

@ -1 +0,0 @@
Fixed a bug in ``reprlib.repr`` where it incorrectly called the repr method on shadowed Python built-in types.

View file

@ -1 +0,0 @@
Fix bug where SSLProtocol.connection_lost wasn't getting called when OSError was thrown on writing to socket.

View file

@ -1 +0,0 @@
Use color to highlight error locations in traceback from exception group

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,3 +0,0 @@
Building with ``HAVE_DYNAMIC_LOADING`` now works as well as it did in 3.12.
Existing deficiences will be addressed separately.
(See https://github.com/python/cpython/issues/122950.)

View file

@ -1,4 +0,0 @@
Improve the error message when a script shadowing a module from the standard
library causes :exc:`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.

View file

@ -1,2 +0,0 @@
Fix reading and decoding a line from the source file witn non-UTF-8 encoding
for syntax errors raised in the compiler.

View file

@ -1 +0,0 @@
Use the ``pager`` binary, if available (e.g. on Debian and derivatives), to display REPL ``help()``.

View file

@ -1,5 +0,0 @@
Fix a crash caused by immortal interned strings being shared between
sub-interpreters that use basic single-phase init. In that case, the string
can be used by an interpreter that outlives the interpreter that created and
interned it. For interpreters that share obmalloc state, also share the
interned dict with the main interpreter.

View file

@ -1,3 +0,0 @@
Fix a crash in the :meth:`~object.__str__` method of :exc:`UnicodeError`
objects when the :attr:`UnicodeError.start` and :attr:`UnicodeError.end`
values are invalid or out-of-range. Patch by Bénédikt Tran.

View file

@ -1,2 +0,0 @@
Fix crash when iterating over a generator expression after direct changes on ``gi_frame.f_locals``.
Patch by Mikhail Efimov.

View file

@ -1,2 +0,0 @@
Fix possible race condition when calling :meth:`~object.__reduce_ex__` for the
first time in the free threading build.

View file

@ -1 +0,0 @@
Fix a crash in the free threading build when the GC runs concurrently with a new thread starting.

View file

@ -1 +0,0 @@
Fix illegal instruction for older Arm architectures. Patch by Diego Russo, testing by Ross Burton.

View file

@ -1,2 +0,0 @@
Correctly honour :mod:`tracemalloc` hooks in specialized ``Py_DECREF``
paths. Patch by Pablo Galindo

View file

@ -1,2 +0,0 @@
Fix a crash in the free threading build when :func:`gc.get_objects` or
:func:`gc.get_referrers` is called during an in-progress garbage collection.

View file

@ -1,2 +0,0 @@
On Android, the ``errors`` setting of :any:`sys.stdout` was changed from
``surrogateescape`` to ``backslashreplace``.

View file

@ -1,2 +0,0 @@
Fix a crash in :func:`sys.audit` when passing a non-string as first argument
and Python was compiled in debug mode.

View file

@ -1,2 +0,0 @@
Provide better error location when attempting to use a :term:`future
statement <__future__>` with an unknown future feature.

View file

@ -1,2 +0,0 @@
Fix crash during garbage collection on an object frozen by :func:`gc.freeze` on the
free-threaded build.

View file

@ -1,3 +0,0 @@
Fix :mod:`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.

View file

@ -1,2 +0,0 @@
Fix a crash when calling :func:`os.fork` on some operating systems,
including SerenityOS.

View file

@ -1 +0,0 @@
Now :exc:`ValueError` is raised instead of :exc:`SystemError` when trying to iterate over a released :class:`memoryview` object.

View file

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

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 @@
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,2 +0,0 @@
Fix possible undefined behavior division by zero in :class:`complex`'s
:c:func:`_Py_c_pow`.

View file

@ -1,8 +0,0 @@
The :c:func:`Py_Main` documentation moved from the "Very High Level API" section to the
"Initialization and Finalization" section.
Also make it explicit that we expect ``Py_Main`` to typically be called instead
of ``Py_Initialize`` rather than after it (since ``Py_Main`` makes its own
call to ``Py_Initialize``). Document that calling both is
supported but is version dependent on which settings
will be applied correctly.

View file

@ -1,2 +0,0 @@
Include the :class:`object` type in the lists of documented types.
Change by Furkan Onder and Martin Panter.

View file

@ -1,2 +0,0 @@
Writers of CPython's documentation can now use ``next`` as the version for
the ``versionchanged``, ``versionadded``, ``deprecated`` directives.

View file

@ -1,3 +0,0 @@
Clarified the dual usage of the term "free variable" (both the formal
meaning of any reference to names defined outside the local scope, and the
narrower pragmatic meaning of nonlocal variables named in ``co_freevars``).

View file

@ -1,4 +0,0 @@
The :mod:`importlib.metadata` documentation now includes semantic
cross-reference targets for the significant documented APIs. This means
intersphinx references like :func:`importlib.metadata.version` will
now work as expected.

View file

@ -1,3 +0,0 @@
Added definitions for :term:`context`, :term:`current context`, and
:term:`context management protocol`, updated related definitions to be
consistent, and expanded the documentation for :class:`contextvars.Context`.

View file

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

View file

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

View file

@ -1,2 +0,0 @@
Increase currently inadequate vertical spacing for the IDLE browsers (path,
module, and stack) on high-resolution monitors.

View file

@ -1,2 +0,0 @@
Fix :mod:`argparse` metavar processing to allow positional arguments to have a
tuple metavar.

View file

@ -1,2 +0,0 @@
Strip :class:`unittest.IsolatedAsyncioTestCase` stack frames from reported
stacktraces.

View file

@ -1 +0,0 @@
Fix a race condition in :class:`multiprocessing.pool.Pool`.

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 @@
Fix SystemError when match regular expression pattern containing some
combination of possessive quantifier, alternative and capture group.

View file

@ -1 +0,0 @@
Always use :func:`str` to print ``choices`` in :mod:`argparse`.

View file

@ -1 +0,0 @@
Always return an absolute path for :func:`os.path.abspath` on Windows.

View file

@ -1,2 +0,0 @@
:func:`!posixpath.realpath` now raises :exc:`NotADirectoryError` when *strict*
mode is enabled and a non-directory path with a trailing slash is supplied.

View file

@ -1 +0,0 @@
Fixed an issue where :func:`inspect.getclosurevars` would incorrectly classify an attribute name as a global variable when the name exists both as an attribute name and a global variable.

View file

@ -1 +0,0 @@
Update unbounded ``read`` calls in :mod:`zipfile` to specify an explicit ``size`` putting a limit on how much data they may read. This also updates handling around ZIP max comment size to match the standard instead of reading comments that are one byte too long.

View file

@ -1,4 +0,0 @@
Resolve a memory leak introduced in CPython 3.10's :mod:`ssl` when the
:attr:`ssl.SSLSocket.session` property was accessed. Speeds up read and
write access to said property by no longer unnecessarily cloning session
objects via serialization.

View file

@ -1 +0,0 @@
Fix the canvas not clearing after running turtledemo clock.

View file

@ -1 +0,0 @@
Fix unbalanced quote errors occurring when activate.csh in :mod:`venv` was sourced with a custom prompt containing unpaired quotes or newlines.

View file

@ -1,2 +0,0 @@
Fix parent slots detection for dataclasses that inherit from classes with
``__dictoffset__``.

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 +0,0 @@
Remove broken :func:`time.thread_time` and :func:`time.thread_time_ns` on NetBSD.

View file

@ -1,3 +0,0 @@
Fix handling of multiple ``"--"`` (double dashes) in :mod:`argparse`. Only
the first one has now been removed, all subsequent ones are now taken
literally.

View file

@ -1 +0,0 @@
Add RFC 9637 reserved IPv6 block ``3fff::/20`` in :mod:`ipaddress` module.

View file

@ -1 +0,0 @@
:mod:`argparse` now ignores the first ``"--"`` (double dash) between an option and command.

View file

@ -1,2 +0,0 @@
Fix parsing positional argument with :ref:`nargs` equal to ``'?'`` or ``'*'``
if it is preceded by an option and another positional argument.

View file

@ -1,4 +0,0 @@
Positional arguments with :ref:`nargs` equal to ``'*'`` or
:data:`!argparse.REMAINDER` are no longer required. This allows to use
positional argument with ``nargs='*'`` and without ``default`` in mutually
exclusive group and improves error message about required arguments.

View file

@ -1,3 +0,0 @@
Fix parsing mutually exclusive arguments in :mod:`argparse`. Arguments with
the value identical to the default value (e.g. booleans, small integers,
empty or 1-character strings) are no longer considered "not present".

View file

@ -1,2 +0,0 @@
Fix disallowing abbreviation of single-dash long options in :mod:`argparse`
with ``allow_abbrev=False``.

View file

@ -1,2 +0,0 @@
:mod:`argparse` vim supports abbreviated single-dash long options separated
by ``=`` from its value.

View file

@ -1 +0,0 @@
Fixed a bug in :mod:`pdb` where sometimes the breakpoint won't trigger if it was set on a function which is already in the call stack.

View file

@ -1,4 +0,0 @@
Fixed bug in itertools.tee() handling of other tee inputs (a tee in a tee).
The output now has the promised *n* independent new iterators. Formerly,
the first iterator was identical (not independent) to the input iterator.
This would sometimes give surprising results.

View file

@ -1,2 +0,0 @@
Fix a crash related to an integer overflow in :func:`curses.resizeterm`
and :func:`curses.resize_term`.

View file

@ -1,2 +0,0 @@
Fix :mod:`argparse` support of positional arguments with ``nargs='?'``,
``default=argparse.SUPPRESS`` and specified ``type``.

View file

@ -1,2 +0,0 @@
Fix support of :ref:`choices` with string value in :mod:`argparse`. Substrings
of the specified string no longer considered valid values.

View file

@ -1 +0,0 @@
All :mod:`asyncio` REPL prompts run in the same :class:`context <contextvars.Context>`. Contributed by Bartosz Sławecki.

View file

@ -1,2 +0,0 @@
Fix conflicts between abbreviated long options in the parent parser and
subparsers in :mod:`argparse`.

View file

@ -1,2 +0,0 @@
Fix :mod:`argparse` for namespaces with not directly writable dict (e.g.
classes).

View file

@ -1 +0,0 @@
Properly quote template strings in :mod:`venv` activation scripts.

View file

@ -1 +0,0 @@
Fixed :exc:`AssertionError` when using :func:`!asyncio.staggered.staggered_race` with :attr:`asyncio.eager_task_factory`.

View file

@ -1 +0,0 @@
Fix reference cycles left in tracebacks in :func:`asyncio.open_connection` when used with ``happy_eyeballs_delay``

View file

@ -1,2 +0,0 @@
Fix detection of the minimal Queue API needed by the :mod:`logging` module.
Patch by Bénédikt Tran.

View file

@ -1,2 +0,0 @@
Allow calling :func:`os.path.exists` and :func:`os.path.lexists` with
keyword arguments on Windows. Fixes a regression in 3.13.0.

View file

@ -1,5 +0,0 @@
Fix :func:`time.strptime` for ``%c`` and ``%x`` formats in many locales:
Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish,
Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol,
Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi,
Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese.

View file

@ -1 +0,0 @@
Fix refcycles in exceptions raised from :class:`asyncio.TaskGroup` and the python implementation of :class:`asyncio.Future`

View file

@ -1 +0,0 @@
Fixed thread safety in :mod:`ssl` in the free-threaded build. OpenSSL operations are now protected by a per-object lock.

View file

@ -1 +0,0 @@
Fix support for the ``barry_as_FLUFL`` future flag in the new REPL.

View file

@ -1,4 +0,0 @@
Fix ``locale.nl_langinfo(locale.ALT_DIGITS)`` on platforms with glibc.
Now it returns a string consisting of up to 100 semicolon-separated symbols
(an empty string in most locales) on all Posix platforms.
Previously it only returned the first symbol or an empty string.

View file

@ -1,5 +0,0 @@
If the :envvar:`PYTHON_BASIC_REPL` environment variable is set, the
:mod:`site` module no longer imports the :mod:`!_pyrepl` module. Moreover,
the :mod:`site` module now respects :option:`-E` and :option:`-I` command
line options: ignore :envvar:`PYTHON_BASIC_REPL` in this case. Patch by
Victor Stinner.

View file

@ -1,4 +0,0 @@
Fix an issue where providing a :class:`pathlib.PurePath` object as an
initializer argument to a second :class:`~pathlib.PurePath` object with a
different :attr:`~pathlib.PurePath.parser` resulted in arguments to the
former object's initializer being joined by the latter object's parser.

View file

@ -1 +0,0 @@
Don't copy arbitrary values to :c:expr:`_Bool` in the :mod:`struct` module.

View file

@ -1,8 +0,0 @@
Fix encoding issues in :func:`time.strftime`, the
:meth:`~datetime.datetime.strftime` method of the :mod:`datetime` classes
:class:`~datetime.datetime`, :class:`~datetime.date` and
:class:`~datetime.time` and formatting of these classes. Characters not
encodable in the current locale are now acceptable in the format string.
Surrogate pairs and sequence of surrogatescape-encoded bytes are no longer
recombinated. Embedded null character no longer terminates the format
string.

View file

@ -1,4 +0,0 @@
Fix inheritance of nested mutually exclusive groups from parent parser in
:class:`argparse.ArgumentParser`. Previously, all nested mutually exclusive
groups lost their connection to the group containing them and were displayed
as belonging directly to the parser.

View file

@ -1,2 +0,0 @@
Keep :mod:`tkinter` TCL paths in venv pointing to base installation on
Windows.

View file

@ -1 +0,0 @@
Fix a bug where ArgumentError includes the incorrect ambiguous option in :mod:`argparse`.

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