库
gh-118418 [https://github.com/python/cpython/issues/118418]: A
DeprecationWarning
is now emitted if you fail to pass a value to the new type_params parameter oftyping._eval_type()
ortyping.ForwardRef._evaluate()
. (Using either of these private and undocumented functions is discouraged to begin with, but failing to pass a value to thetype_params
parameter may lead to incorrect behaviour on Python 3.12 or newer.)gh-118660 [https://github.com/python/cpython/issues/118660]: Add an optional second type parameter to
typing.ContextManager
andtyping.AsyncContextManager
, representing the return types of__exit__()
and__aexit__()
respectively. This parameter defaults tobool | None
.gh-118650 [https://github.com/python/cpython/issues/118650]: The
enum
module allows method namedrepr*
to be defined onEnum
types.gh-118648 [https://github.com/python/cpython/issues/118648]: Add type parameter defaults to
typing.Generator
andtyping.AsyncGenerator
.gh-101137 [https://github.com/python/cpython/issues/101137]: Mime type
text/x-rst
is now supported bymimetypes
.gh-118164 [https://github.com/python/cpython/issues/118164]: The Python implementation of the
decimal
module could appear to hang in relatively small power cases (like2**117
) if context precision was set to a very high value. A different method to check for exactly representable results is used now that doesn't rely on computing10**precision
(which could be effectively too large to compute).gh-111744 [https://github.com/python/cpython/issues/111744]:
breakpoint()
andpdb.set_trace()
now enter the debugger immediately after the call rather than before the next line is executed.gh-118500 [https://github.com/python/cpython/issues/118500]: Add
pdb
support for zipappsgh-118406 [https://github.com/python/cpython/issues/118406]: Add signature for
sqlite3.Connection
objects.gh-101732 [https://github.com/python/cpython/issues/101732]: Use a Y2038 compatible openssl time function when available.
gh-118404 [https://github.com/python/cpython/issues/118404]: Fix
inspect.signature()
for non-comparable callables.gh-118402 [https://github.com/python/cpython/issues/118402]: Fix
inspect.signature()
for the result of thefunctools.cmp_to_key()
call.gh-116622 [https://github.com/python/cpython/issues/116622]: On Android,
sysconfig.get_platform
now returns the format specified by PEP 738 [https://peps.python.org/pep-0738/].gh-118285 [https://github.com/python/cpython/issues/118285]: Allow to specify the signature of custom callable instances of extension type by the
__textsignature_
attribute. Specify signatures ofoperator.attrgetter
,operator.itemgetter
, andoperator.methodcaller
instances.gh-118314 [https://github.com/python/cpython/issues/118314]: Fix an edge case in
binascii.a2b_base64()
strict mode, where excessive padding is not detected when no padding is necessary.gh-118271 [https://github.com/python/cpython/issues/118271]: Add the
PhotoImage
methodsread()
to read an image from a file anddata()
to get the image data. Add background and grayscale parameters toPhotoImage
methodwrite()
.gh-118225 [https://github.com/python/cpython/issues/118225]: Add the
PhotoImage
methodcopy_replace()
to copy a region from one image to other image, possibly with pixel zooming and/or subsampling. Add from_coords parameter toPhotoImage
methodscopy()
,zoom()
andsubsample()
. Add zoom and subsample parameters toPhotoImage
methodcopy()
.gh-118221 [https://github.com/python/cpython/issues/118221]: Fix a bug where
sqlite3.Connection.iterdump()
could fail if a customrow factory
was used. Patch by Erlend Aasland.gh-118013 [https://github.com/python/cpython/issues/118013]: Fix regression introduced in gh-103193 [https://github.com/python/cpython/issues/103193] that meant that calling
inspect.getattr_static()
on an instance would cause a strong reference to that instance's class to persist in an internal cache in theinspect
module. This caused unexpected memory consumption if the class was dynamically created, the class held strong references to other objects which took up a significant amount of memory, and the cache contained the sole strong reference to the class. The fix for the regression leads to a slowdown ingetattr_static()
, but the function should still be significantly faster than it was in Python 3.11. Patch by Alex Waygood.gh-118218 [https://github.com/python/cpython/issues/118218]: Speed up
itertools.pairwise()
in the common case by up to 1.8x.gh-117486 [https://github.com/python/cpython/issues/117486]: Improve the behavior of user-defined subclasses of
ast.AST
. Such classes will now require no changes in the usual case to conform with the behavior changes of theast
module in Python 3.13. Patch by Jelle Zijlstra.gh-90848 [https://github.com/python/cpython/issues/90848]: Fixed
unittest.mock.create_autospec()
to configure parent mock with keyword arguments.gh-118168 [https://github.com/python/cpython/issues/118168]: Fix incorrect argument substitution when
typing.Unpack
is used with the builtintuple
.typing.Unpack
now raisesTypeError
when used with certain invalid types. Patch by Jelle Zijlstra.gh-118131 [https://github.com/python/cpython/issues/118131]: Add commandline interface for the
random
module. Patch by Hugo van Kemenade.gh-118107 [https://github.com/python/cpython/issues/118107]: Fix
zipimport
reading of ZIP64 files with file entries that are too big or offset too far.gh-102511 [https://github.com/python/cpython/issues/102511]: Fix
os.path.normpath()
for UNC paths on Windows. Speed upos.path.splitroot()
with a native implementation.gh-117535 [https://github.com/python/cpython/issues/117535]: Change the unknown filename of
warnings
fromsys
to
to clarify that it's not a real filename.gh-114053 [https://github.com/python/cpython/issues/114053]: Fix erroneous
NameError
when callingtyping.get_type_hints()
on a class that made use of PEP 695 [https://peps.python.org/pep-0695/] type parameters in a module that hadfrom __future__ import annotations
at the top of the file. Patch by Alex Waygood.gh-116931 [https://github.com/python/cpython/issues/116931]: Add parameter fileobj check for
tarfile.TarFile.addfile()
gh-117995 [https://github.com/python/cpython/issues/117995]: Don't raise
DeprecationWarning
when a sequence of parameters is used to bind indexed, nameless placeholders. See also gh-100668 [https://github.com/python/cpython/issues/100668].gh-80361 [https://github.com/python/cpython/issues/80361]: Fix TypeError in
email.message.Message.get_payload()
when the charset is RFC 2231 [https://datatracker.ietf.org/doc/html/rfc2231.html] encoded.gh-86650 [https://github.com/python/cpython/issues/86650]: Fix IndexError when parse some emails with invalid MessageID (including one-off addresses generated by Microsoft Outlook).
gh-117691 [https://github.com/python/cpython/issues/117691]: Improve the error messages emitted by
tarfile
deprecation warnings relating to PEP 706. If afilter
argument is not provided toextract()
orextractall
, the deprecation warning now points to the line in the user's code where the relevant function was called. Patch by Alex Waygood.gh-115874 [https://github.com/python/cpython/issues/115874]: Fixed a possible segfault during garbage collection of
_asyncio.FutureIter
objects. Patch by Savannah Ostrowski.gh-115060 [https://github.com/python/cpython/issues/115060]: Speed up
pathlib.Path.glob()
by omitting an initialis_dir()
call. As a result of this change,glob()
can no longer raiseOSError
.gh-77102 [https://github.com/python/cpython/issues/77102]:
site
module now parses.pth
file with UTF-8 first, and locale encoding ifUnicodeDecodeError
happened. It supported only locale encoding before.gh-76785 [https://github.com/python/cpython/issues/76785]: We've exposed the low-level
_interpreters
module for the sake of the PyPI implementation of PEP 734 [https://peps.python.org/pep-0734/]. It was sometimes available as the_xxsubinterpreters
module and was formerly used only for testing. For the most part, it should be considered an internal module, like_thread
and_imp
. See https://discuss.python.org/t/pep-734-multiple-interpreters-in-the-stdlib/41147/26.gh-115060 [https://github.com/python/cpython/issues/115060]: Speed up
pathlib.Path.glob()
by not scanning directories for non-wildcard pattern segments.gh-117727 [https://github.com/python/cpython/issues/117727]: Speed up
pathlib.Path.iterdir()
by usingos.scandir()
internally.gh-117586 [https://github.com/python/cpython/issues/117586]: Speed up
pathlib.Path.walk()
by working with strings internally.gh-117722 [https://github.com/python/cpython/issues/117722]: Change the new multi-separator support in
asyncio.StreamReader.readuntil()
to only accept tuples of separators rather than arbitrary iterables.gh-117692 [https://github.com/python/cpython/issues/117692]: Fixes a bug when
doctest.DocTestFinder
was failing on wrappedbuiltin_function_or_method
.gh-117348 [https://github.com/python/cpython/issues/117348]: Largely restored import time performance of configparser by avoiding dataclasses.
gh-117641 [https://github.com/python/cpython/issues/117641]: Speedup
os.path.commonpath()
on Unix.gh-117663 [https://github.com/python/cpython/issues/117663]: Fix
simpleenum
to detect aliases when multiple arguments are present but only one is the member value.gh-117636 [https://github.com/python/cpython/issues/117636]: Speedup
os.path.join()
.gh-117618 [https://github.com/python/cpython/issues/117618]: Support
package.module
asfilename
forbreak
command ofpdb
gh-102247 [https://github.com/python/cpython/issues/102247]: the status codes enum with constants in http.HTTPStatus are updated to include the names from RFC9110. This RFC includes some HTTP statuses previously only used for WEBDAV and assigns more generic names to them.
The old constants are preserved for backwards compatibility.
gh-117607 [https://github.com/python/cpython/issues/117607]: Speedup
os.path.relpath()
.gh-117586 [https://github.com/python/cpython/issues/117586]: Speed up
pathlib.Path.glob()
by working with strings internally.gh-117225 [https://github.com/python/cpython/issues/117225]: Add colour to doctest output. Patch by Hugo van Kemenade.
gh-117566 [https://github.com/python/cpython/issues/117566]:
ipaddress.IPv6Address.is_loopback()
will now returnTrue
for IPv4-mapped loopback addresses, i.e. addresses in the::ffff:127.0.0.0/104
address space.gh-117546 [https://github.com/python/cpython/issues/117546]: Fix issue where
os.path.realpath()
stopped resolving symlinks after encountering a symlink loop on POSIX.gh-116720 [https://github.com/python/cpython/issues/116720]: Improved behavior of
asyncio.TaskGroup
when an external cancellation collides with an internal cancellation. For example, when two task groups are nested and both experience an exception in a child task simultaneously, it was possible that the outer task group would misbehave, because its internal cancellation was swallowed by the inner task group.
In the case where a task group is cancelled externally and also must raise an ExceptionGroup
, it will now call the parent task's cancel()
method. This ensures that a asyncio.CancelledError
will be raised at the next await
, so the cancellation is not lost.
这些更改的一个附加好处是现在任务组会保留取消操作计数 (asyncio.Task.cancelling()
)。
为了处理某些边界情况,现在 asyncio.Task.uncancel()
可以在取消操作计数达到零时重置未写入文档的 mustcancel
旗标。
gh-117516 [https://github.com/python/cpython/issues/117516]: Add
typing.TypeIs
, implementing PEP 742 [https://peps.python.org/pep-0742/]. Patch by Jelle Zijlstra.gh-117503 [https://github.com/python/cpython/issues/117503]: Fix support of nonASCII user names in bytes paths in
os.path.expanduser()
on Posix.gh-117394 [https://github.com/python/cpython/issues/117394]:
os.path.ismount()
is now 2-3 times faster if the user has permissions.gh-117313 [https://github.com/python/cpython/issues/117313]: Only treat
'\n'
,'\r'
and'\r\n'
as line separators in re-folding theemail
messages. Preserve control characters'\v'
,'\f'
,'\x1c'
,'\x1d'
and'\x1e'
and Unicode line separators'\x85'
,'\u2028'
and'\u2029'
as is.gh-117142 [https://github.com/python/cpython/issues/117142]: Convert
_ctypes
to multiphase initialisation ( PEP 489 [https://peps.python.org/pep-0489/]).gh-66543 [https://github.com/python/cpython/issues/66543]: Add the
mimetypes.guess_file_type()
function which works with file path. Passing file path instead of URL inguess_type()
is soft deprecated.gh-68583 [https://github.com/python/cpython/issues/68583]: webbrowser CLI: replace getopt with argparse, add long options. Patch by Hugo van Kemenade.
gh-116871 [https://github.com/python/cpython/issues/116871]: Name suggestions for
AttributeError
andImportError
now only include underscored names if the original name was underscored.gh-116023 [https://github.com/python/cpython/issues/116023]: Don't show empty fields (value
None
or[]
) inast.dump()
by default. Addshow_empty=False
parameter to optionally show them.gh-115961 [https://github.com/python/cpython/issues/115961]: Added
name
andmode
attributes for compressed and archived file-like objects in modulesbz2
,lzma
,tarfile
andzipfile
. The value of themode
attribute ofgzip.GzipFile
was changed from integer (1
or2
) to string ('rb'
or'wb'
). The value of themode
attribute of the readable file-like object returned byzipfile.ZipFile.open()
was changed from'r'
to'rb'
.gh-82062 [https://github.com/python/cpython/issues/82062]: Fix
inspect.signature()
to correctly handle parameter defaults on methods in extension modules that use names defined in the module namespace.gh-83856 [https://github.com/python/cpython/issues/83856]: Honor
atexit
for allmultiprocessing
start methodsgh-113081 [https://github.com/python/cpython/issues/113081]: Print colorized exception just like builtin traceback in
pdb
gh-112855 [https://github.com/python/cpython/issues/112855]: Speed up pickling of
pathlib.PurePath
objects. Patch by Barney Gale.gh-111744 [https://github.com/python/cpython/issues/111744]: Support opcode events in
bdb
gh-109617 [https://github.com/python/cpython/issues/109617]:
ncurses
: fixed a crash that could occur on macOS 13 or earlier when Python was built with Apple Xcode 15's SDK.gh-83151 [https://github.com/python/cpython/issues/83151]: Enabled arbitrary statements and evaluations in
pdb
shell to access the local variables of the current frame, which made it possible for multi-scope code like generators or nested function to work.gh-110209 [https://github.com/python/cpython/issues/110209]: Add
__class_getitem__()
totypes.GeneratorType
andtypes.CoroutineType
for type hinting purposes. Patch by James Hilton-Balfe.gh-108191 [https://github.com/python/cpython/issues/108191]: The
types.SimpleNamespace
now accepts an optional positional argument which specifies initial values of attributes as a dict or an iterable of key-value pairs.gh-62090 [https://github.com/python/cpython/issues/62090]: Fix assertion errors caused by whitespace in metavars or
SUPPRESS
-ed groups inargparse
by simplifying usage formatting. Patch by Ali Hamdan.gh-102402 [https://github.com/python/cpython/issues/102402]: Adjust
logging.LogRecord
to usetime.time_ns()
and fix minor bug related to floating-point math.gh-100242 [https://github.com/python/cpython/issues/100242]: Bring pure Python implementation
functools.partial._new_
more in line with the C-implementation by not just always checking for the presence of the attribute'func'
on the first argument ofpartial
. Instead, both the Python version and the C version perform anisinstance(func, partial)
check on the first argument ofpartial
.gh-99730 [https://github.com/python/cpython/issues/99730]: HEAD requests are no longer upgraded to GET request during redirects in urllib.
gh-66410 [https://github.com/python/cpython/issues/66410]: Setting the
tkinter
module globalwantobjects
to2
before creating theTk
object or call thewantobjects()
method of theTk
object with argument2
makes now arguments to callbacks registered in thetkinter
module to be passed as various Python objects (int
,float
,bytes
,tuple
), depending on their internal representation in Tcl, instead of alwaysstr
.tkinter.wantobjects
is now set to2
by default.bpo-40943 [https://bugs.python.org/issue?@action=redirect&bpo=40943]: Fix several IndexError when parse emails with truncated MessageID, address, routes, etc, e.g.
example@
.bpo-39324 [https://bugs.python.org/issue?@action=redirect&bpo=39324]: Add mime type mapping for .md <-> text/markdown
bpo-18108 [https://bugs.python.org/issue?@action=redirect&bpo=18108]:
shutil.chown()
now supports dir_fd and follow_symlinks keyword arguments.bpo-30988 [https://bugs.python.org/issue?@action=redirect&bpo=30988]: Fix parsing of emails with invalid address headers having a leading or trailing dot. Patch by tsufeki.
bpo-32839 [https://bugs.python.org/issue?@action=redirect&bpo=32839]: Add the
after_info()
method for Tkinter widgets.
文档
- gh-117928 [https://github.com/python/cpython/issues/117928]: The minimum Sphinx version required for the documentation is now 6.2.1.
构建
gh-118734 [https://github.com/python/cpython/issues/118734]: Fixes Windows build when invoked directly (not through the
build.bat
script) without specifying a value forUseTIER2
.gh-115119 [https://github.com/python/cpython/issues/115119]: The
configure
option--with-system-libmpdec
now defaults toyes
. The bundled copy oflibmpdecimal
will be removed in Python 3.15.gh-117845 [https://github.com/python/cpython/issues/117845]: Fix building against recent libedit versions by detecting readline hook signatures in configure.
gh-116622 [https://github.com/python/cpython/issues/116622]: A testbed project was added to run the test suite on Android.
gh-117645 [https://github.com/python/cpython/issues/117645]: Increase WASI stack size from 512 KiB to 8 MiB and the initial memory from 10 MiB to 20 MiB. Patch by Victor Stinner.
gh-115119 [https://github.com/python/cpython/issues/115119]: configure now uses pkg-config to detect
decimal
dependencies if the--with-system-libmpdec
option is given.
Windows
gh-115119 [https://github.com/python/cpython/issues/115119]: Update Windows installer to use libmpdecimal 4.0.0.
gh-118486 [https://github.com/python/cpython/issues/118486]:
os.mkdir()
now accepts mode of0o700
to restrict the new directory to the current user.gh-118347 [https://github.com/python/cpython/issues/118347]: Fixes launcher updates not being installed.
gh-118293 [https://github.com/python/cpython/issues/118293]: The
multiprocessing
module now passes theSTARTF_FORCEOFFFEEDBACK
flag when spawning processes to tell Windows not to change the mouse cursor.gh-115009 [https://github.com/python/cpython/issues/115009]: Update Windows installer to use SQLite 3.45.3.
gh-90329 [https://github.com/python/cpython/issues/90329]: Suppress the warning displayed on virtual environment creation when the requested and created paths differ only by a short (8.3 style) name. Warnings will continue to be shown if a junction or symlink in the path caused the venv to be created in a different location than originally requested.
gh-117786 [https://github.com/python/cpython/issues/117786]: Fixes virtual environments not correctly launching when created from a Store install.
macOS
gh-115119 [https://github.com/python/cpython/issues/115119]: Update macOS installer to use libmpdecimal 4.0.0.
gh-114099 [https://github.com/python/cpython/issues/114099]: iOS preprocessor symbol usage was made compatible with older macOS SDKs.
gh-115009 [https://github.com/python/cpython/issues/115009]: Update macOS installer to use SQLite 3.45.3.
gh-91629 [https://github.com/python/cpython/issues/91629]: Use
~/.config/fish/conf.d
configs and fish_add_path to setPATH
when installing for the Fish shell.
IDLE
- bpo-34774 [https://bugs.python.org/issue?@action=redirect&bpo=34774]: Use user-selected color theme for Help => IDLE Doc.
C API
gh-118124 [https://github.com/python/cpython/issues/118124]: Fix
Py_BUILD_ASSERT
andPy_BUILD_ASSERT_EXPR
for non-constant expressions: usestatic_assert()
on C11 and newer. Patch by Victor Stinner.gh-110850 [https://github.com/python/cpython/issues/110850]: Add "Raw" variant of PyTime functions
Patch by Victor Stinner.
gh-117987 [https://github.com/python/cpython/issues/117987]: Restore functions removed in Python 3.13 alpha 1:
Patch by Victor Stinner.
gh-117929 [https://github.com/python/cpython/issues/117929]: Restore removed
PyEval_InitThreads()
function. Patch by Victor Stinner.gh-117534 [https://github.com/python/cpython/issues/117534]: Improve validation logic in the C implementation of
datetime.datetime.fromisoformat()
to better handle invalid years. Patch by Vlad Efanov.gh-68114 [https://github.com/python/cpython/issues/68114]: Fixed skipitem()'s handling of the old 'w' and 'w#' formatters. These are no longer supported and now raise an exception if used.
gh-111997 [https://github.com/python/cpython/issues/111997]: Add a C-API for firing monitoring events.
Python 3.13.0 alpha 6
Release date: 2024-04-09
核心与内置函数
gh-117494 [https://github.com/python/cpython/issues/117494]: Refactored the instruction sequence data structure out of compile.c into instruction_sequence.c.
gh-116968 [https://github.com/python/cpython/issues/116968]: Introduce a unified 16-bit backoff counter type (
PyBackoffCounter
), shared between the Tier 1 adaptive specializer and the Tier 2 optimizer. The API used for adaptive specialization counters is changed but the behavior is (supposed to be) identical.
The behavior of the Tier 2 counters is changed:
There are no longer dynamic thresholds (we never varied these).
All counters now use the same exponential backoff.
The counter for
JUMP_BACKWARD
starts counting down from 16.The
temperature
in side exits starts counting down from 64.
gh-117431 [https://github.com/python/cpython/issues/117431]: Improve the performance of the following
bytes
andbytearray
methods by adapting them to theMETH_FASTCALL
calling convention:endswith()
startswith()
gh-117431 [https://github.com/python/cpython/issues/117431]: Improve the performance of the following
str
methods by adapting them to theMETH_FASTCALL
calling convention:gh-117411 [https://github.com/python/cpython/issues/117411]: Move
PyFutureFeatures
to an internal header and make it private.gh-109120 [https://github.com/python/cpython/issues/109120]: Added handle of incorrect star expressions, e.g
f(3, *)
. Patch by Grigoryev Semyongh-117266 [https://github.com/python/cpython/issues/117266]: Fix crashes for certain user-created subclasses of
ast.AST
. Such classes are now expected to set thefieldtypes
attribute.gh-99108 [https://github.com/python/cpython/issues/99108]: Updated the
hashlib
builtin HACL* project [https://github.com/hacl-star/hacl-star] C code from upstream that we use for many implementations when they are not present via OpenSSL in a given build. This also avoids the rare potential for a C symbol name one definition rule linking issue.gh-117108 [https://github.com/python/cpython/issues/117108]: Change the old space bit of objects in the young generation from 0 to gcstate->visited, so that any objects created during GC will have the old bit set correctly if they get moved into the old generation.
gh-117108 [https://github.com/python/cpython/issues/117108]: The cycle GC now chooses the size of increments based on the total heap size, instead of the rate of object creation. This ensures that it can keep up with growing heaps.
gh-116735 [https://github.com/python/cpython/issues/116735]: For
INSTRUMENTED_CALL_FUNCTION_EX
, setarg0
tosys.monitoring.MISSING
instead ofNone
forCALL
event.gh-113964 [https://github.com/python/cpython/issues/113964]: Starting new threads and process creation through
os.fork()
are now only prevented once all non-daemon threads exit.gh-116626 [https://github.com/python/cpython/issues/116626]: Ensure
INSTRUMENTED_CALL_FUNCTION_EX
always emitsCALL
gh-116554 [https://github.com/python/cpython/issues/116554]:
list.sort()
now exploits more cases of partial ordering, particularly those with long descending runs with sub-runs of equal values. Those are recognized as single runs now (previously, each block of repeated values caused a new run to be created).gh-114099 [https://github.com/python/cpython/issues/114099]: Added a Loader that can discover extension modules in an iOS-style Frameworks folder.
gh-115775 [https://github.com/python/cpython/issues/115775]: Compiler populates the new
__static_attributes__
field on a class with the names of attributes of this class which are accessed through self.X from any function in its body.gh-115776 [https://github.com/python/cpython/issues/115776]: The array of values, the
PyDictValues
struct is now embedded in the object during allocation. This provides better performance in the common case, and does not degrade as much when the object's__dict__
is materialized.gh-108362 [https://github.com/python/cpython/issues/108362]: Implement an incremental cyclic garbage collector. By collecting the old generation in increments, there is no need for a full heap scan. This can hugely reduce maximum pause time for programs with large heaps.
Reduce the number of generations from three to two. The old generation is split into two spaces, "visited" and "pending".
Collection happens in two steps:: An increment is formed from the young generation and a small part of the pending space. This increment is scanned and the survivors moved to the end of the visited space.
When the collecting space becomes empty, the two spaces are swapped.
gh-109870 [https://github.com/python/cpython/issues/109870]: Dataclasses now calls
exec()
once per dataclass, instead of once per method being added. This can speed up dataclass creation by up to 20%.gh-97901 [https://github.com/python/cpython/issues/97901]: Mime type
text/rtf
is now supported bymimetypes
.bpo-24612 [https://bugs.python.org/issue?@action=redirect&bpo=24612]: Improve the
SyntaxError
that happens when 'not' appears after an operator. Patch by Pablo Galindo
库
gh-117648 [https://github.com/python/cpython/issues/117648]: Improve performance of
os.path.join()
andos.path.expanduser()
.gh-117584 [https://github.com/python/cpython/issues/117584]: Raise
TypeError
for non-paths inposixpath.relpath()
.gh-117467 [https://github.com/python/cpython/issues/117467]: Preserve mailbox ownership when rewriting in
mailbox.mbox.flush()
. Patch by Tony Mountifield.gh-114848 [https://github.com/python/cpython/issues/114848]: Raise
FileNotFoundError
whengetcwd()
returns '(unreachable)', which can happen on Linux >= 2.6.36 with glibc < 2.27.gh-117459 [https://github.com/python/cpython/issues/117459]:
asyncio.asyncio.run_coroutine_threadsafe()
now keeps the traceback ofCancelledError
,TimeoutError
andInvalidStateError
which are raised in the coroutine.gh-117381 [https://github.com/python/cpython/issues/117381]: Fix error message for
ntpath.commonpath()
.gh-117337 [https://github.com/python/cpython/issues/117337]: Deprecate undocumented
glob.glob0()
andglob.glob1()
functions. Useglob.glob()
and pass a directory to its root_dir argument instead.gh-117349 [https://github.com/python/cpython/issues/117349]: Optimise several functions in
os.path
.gh-117348 [https://github.com/python/cpython/issues/117348]: Refactored
configparser.RawConfigParser._read()
to reduce cyclometric complexity and improve comprehensibility.gh-117335 [https://github.com/python/cpython/issues/117335]: Raise TypeError for non-sequences for
ntpath.commonpath()
.gh-66449 [https://github.com/python/cpython/issues/66449]:
configparser.ConfigParser
now accepts unnamed sections before named ones, if configured to do so.gh-88014 [https://github.com/python/cpython/issues/88014]: In documentation of
gzip.GzipFile
in module gzip, explain data type of optional constructor argument mtime, and recommendmtime = 0
for generating deterministic streams.gh-117310 [https://github.com/python/cpython/issues/117310]: Fixed an unlikely early & extra
Py_DECREF
triggered crash inssl
when creating a newssl.SSLContext
if CPython was built implausibly such that the default cipher list is empty or the SSL library it was linked against reports a failure from its CSSL_CTXsetcipher_list()
API.gh-117294 [https://github.com/python/cpython/issues/117294]: A
DocTestCase
now reports as skipped if all examples in the doctest are skipped.gh-98966 [https://github.com/python/cpython/issues/98966]: In
subprocess
, raise a more informative message whenstdout=STDOUT
.gh-117225 [https://github.com/python/cpython/issues/117225]: doctest: only print "and X failed" when non-zero, don't pluralise "1 items". Patch by Hugo van Kemenade.
gh-117205 [https://github.com/python/cpython/issues/117205]: Speed up
compileall.compile_dir()
by 20% when using multiprocessing by increasingchunksize
.gh-117178 [https://github.com/python/cpython/issues/117178]: Fix regression in lazy loading of self-referential modules, introduced in gh-114781 [https://github.com/python/cpython/issues/114781].
gh-112383 [https://github.com/python/cpython/issues/112383]: Fix
dis
module's handling ofENTER_EXECUTOR
instructions.gh-117182 [https://github.com/python/cpython/issues/117182]: Lazy-loading of modules that modify their own
__class__
no longer reverts the__class__
totypes.ModuleType
.gh-117084 [https://github.com/python/cpython/issues/117084]: Fix
zipfile
extraction for directory entries with the name containing backslashes on Windows.gh-117114 [https://github.com/python/cpython/issues/117114]: Make
os.path.isdevdrive()
available on all platforms. For those that do not offer Dev Drives, it will always returnFalse
.gh-117110 [https://github.com/python/cpython/issues/117110]: Fix a bug that prevents subclasses of
typing.Any
to be instantiated with arguments. Patch by Chris Fu.gh-109653 [https://github.com/python/cpython/issues/109653]: Deferred select imports in importlib.metadata and importlib.resources for a 14% speedup.
gh-70647 [https://github.com/python/cpython/issues/70647]: Start the deprecation period for the current behavior of
datetime.datetime.strptime()
andtime.strptime()
which always fails to parse a date string with aValueError
involving a day of month such asstrptime("02-29", "%m-%d")
when a year is not specified and the date happen to be February 29th. This should help avoid users finding new bugs every four years due to a natural mistaken assumption about the API when parsing partial date values.gh-116987 [https://github.com/python/cpython/issues/116987]: Fixed
inspect.findsource()
for class code objects.gh-114099 [https://github.com/python/cpython/issues/114099]: Modify standard library to allow for iOS platform differences.
gh-90872 [https://github.com/python/cpython/issues/90872]: On Windows,
subprocess.Popen.wait()
no longer callsWaitForSingleObject()
with a negative timeout: pass0
ms if the timeout is negative. Patch by Victor Stinner.gh-116957 [https://github.com/python/cpython/issues/116957]: configparser: Don't leave ConfigParser values in an invalid state (stored as a list instead of a str) after an earlier read raised DuplicateSectionError or DuplicateOptionError.
gh-115538 [https://github.com/python/cpython/issues/115538]:
_io.WindowsConsoleIO
now emit a warning if a boolean value is passed as a filedescriptor argument.gh-90095 [https://github.com/python/cpython/issues/90095]: Ignore empty lines and comments in
.pdbrc
gh-106531 [https://github.com/python/cpython/issues/106531]: Refreshed zipfile._path from zipp 3.18 [https://zipp.readthedocs.io/en/latest/history.html#v3-18-0], providing better compatibility for PyPy, better glob performance for deeply nested zipfiles, and providing internal access to
CompleteDirs.inject
for use in other tests (like importlib.resources).gh-63207 [https://github.com/python/cpython/issues/63207]: On Windows,
time.time()
now uses theGetSystemTimePreciseAsFileTime()
clock to have a resolution better than 1 us, instead of theGetSystemTimeAsFileTime()
clock which has a resolution of 15.6 ms. Patch by Victor Stinner.gh-116764 [https://github.com/python/cpython/issues/116764]: Restore support of
None
and other false values inurllib.parse
functionsparse_qs()
andparse_qsl()
. Also, they now raise a TypeError for non-zero integers and non-empty sequences.gh-116811 [https://github.com/python/cpython/issues/116811]: In
PathFinder.invalidate_caches
, delegate toMetadataPathFinder.invalidate_caches
.gh-116647 [https://github.com/python/cpython/issues/116647]: Fix recursive child in dataclasses
gh-113171 [https://github.com/python/cpython/issues/113171]: Fixed various false positives and false negatives in
ipaddress.IPv4Address.is_private
(see these docs for details)
Also in the corresponding ipaddress.IPv4Network
and ipaddress.IPv6Network
attributes.
gh-63283 [https://github.com/python/cpython/issues/63283]: In
encodings.idna
, any capitalization of the ACE prefix (xn--
) is now acceptable. Patch by Pepijn de Vos and Zackery Spytz.gh-71042 [https://github.com/python/cpython/issues/71042]: Add
platform.android_ver()
, which provides device and OS information on Android.gh-73468 [https://github.com/python/cpython/issues/73468]: Added new
math.fma()
function, wrapping C99'sfma()
operation: fused multiply-add function. Patch by Mark Dickinson and Victor Stinner.gh-116608 [https://github.com/python/cpython/issues/116608]: The
importlib.resources
functionsis_resource()
,open_binary()
,open_text()
,path()
,read_binary()
, andread_text()
are undeprecated, and support subdirectories via multiple positional arguments. Thecontents()
function also allows subdirectories, but remains deprecated.gh-116484 [https://github.com/python/cpython/issues/116484]: Change automatically generated
tkinter.Checkbutton
widget names to avoid collisions with automatically generatedtkinter.ttk.Checkbutton
widget names within the same parent widget.gh-114314 [https://github.com/python/cpython/issues/114314]: In
ctypes
, ctype data is now stored in type objects directly rather than in a dict subclass. This is an internal change that should not affect usage.gh-116401 [https://github.com/python/cpython/issues/116401]: Fix blocking
os.fwalk()
andshutil.rmtree()
on opening named pipe.gh-71052 [https://github.com/python/cpython/issues/71052]: Implement
ctypes.util.find_library()
on Android.gh-90535 [https://github.com/python/cpython/issues/90535]: Fix support of interval values > 1 in
logging.TimedRotatingFileHandler
forwhen='MIDNIGHT'
andwhen='Wx'
.gh-113308 [https://github.com/python/cpython/issues/113308]: Remove some internal protected parts from
uuid
:hasuuidgeneratetime_safe
,netbiosgetnode
,ipconfiggetnode
, andloadsystem_functions
. They were unused.gh-115627 [https://github.com/python/cpython/issues/115627]: Fix the
ssl
module error handling of connection terminate by peer. It now throws an OSError with the appropriate error code instead of an EOFError.gh-114847 [https://github.com/python/cpython/issues/114847]: Speed up
os.path.realpath()
on non-Windows platforms.gh-114271 [https://github.com/python/cpython/issues/114271]: Fix a race in
threading.Thread.join()
.
threading._MainThread
now always represents the main thread of the main interpreter.
PyThreadState.on_delete
and PyThreadState.on_delete_data
have been removed.
gh-113538 [https://github.com/python/cpython/issues/113538]: Add
asyncio.Server.close_clients()
andasyncio.Server.abort_clients()
methods which allow to more forcefully close an asyncio server.gh-85287 [https://github.com/python/cpython/issues/85287]: Changes Unicode codecs to return UnicodeEncodeError or UnicodeDecodeError, rather than just UnicodeError.
gh-113548 [https://github.com/python/cpython/issues/113548]:
pdb
now allows CLI arguments topdb -m
.gh-112948 [https://github.com/python/cpython/issues/112948]: Make completion of
pdb
similar to Python REPLgh-105866 [https://github.com/python/cpython/issues/105866]: Fixed
getslots
bug which caused error when defining dataclasses with slots and a weakref_slot.gh-96471 [https://github.com/python/cpython/issues/96471]: Add
asyncio.Queue
termination withshutdown()
method.gh-89739 [https://github.com/python/cpython/issues/89739]: The
zipimport
module can now read ZIP64 files.bpo-33533 [https://bugs.python.org/issue?@action=redirect&bpo=33533]:
asyncio.as_completed()
now returns an object that is both an asynchronous iterator and plain iterator. The new asynchronous iteration pattern allows for easier correlation between prior tasks and their completed results. This is a closer match toconcurrent.futures.as_completed()
's iteration pattern. Patch by Justin Arthur.bpo-27578 [https://bugs.python.org/issue?@action=redirect&bpo=27578]:
inspect.getsource()
(and related functions) work with empty module files, returning'\n'
(or reasonable equivalent) instead of raisingOSError
. Patch by Kernc.bpo-37141 [https://bugs.python.org/issue?@action=redirect&bpo=37141]: Accept an iterable of separators in
asyncio.StreamReader.readuntil()
, stopping when one of them is encountered.gh-66543 [https://github.com/python/cpython/issues/66543]: Make
mimetypes.guess_type()
properly parsing of URLs with only a host name, URLs containing fragment or query, and filenames with only a UNC sharepoint on Windows. Based on patch by Donghee Na.bpo-15010 [https://bugs.python.org/issue?@action=redirect&bpo=15010]:
unittest.TestLoader.discover()
now saves the original value ofunittest.TestLoader._top_level_dir
and restores it at the end of the call.
文档
gh-115977 [https://github.com/python/cpython/issues/115977]: Remove compatibility references to Emscripten.
gh-114099 [https://github.com/python/cpython/issues/114099]: Add an iOS platform guide, and flag modules not available on iOS.
gh-91565 [https://github.com/python/cpython/issues/91565]: Changes to documentation files and config outputs to reflect the new location for reporting bugs - i.e. GitHub rather than bugs.python.org.
测试
gh-83434 [https://github.com/python/cpython/issues/83434]: Disable JUnit XML output (
--junit-xml=FILE
command line option) in regrtest when hunting for reference leaks (-R
option). Patch by Victor Stinner.gh-117187 [https://github.com/python/cpython/issues/117187]: Fix XML tests for vanilla Expat <2.6.0.
gh-116333 [https://github.com/python/cpython/issues/116333]: Tests of TLS related things (error codes, etc) were updated to be more lenient about specific error message strings and behaviors as seen in the BoringSSL and AWS-LC forks of OpenSSL.
gh-117089 [https://github.com/python/cpython/issues/117089]: Consolidated tests for importlib.metadata in their own
metadata
package.gh-115979 [https://github.com/python/cpython/issues/115979]: Update test_importlib so that it passes under WASI SDK 21.
gh-112536 [https://github.com/python/cpython/issues/112536]: Add —tsan to test.regrtest for running TSAN tests in reasonable execution times. Patch by Donghee Na.
gh-116307 [https://github.com/python/cpython/issues/116307]: Added import helper
isolated_modules
asCleanImport
does not remove modules imported during the context. Use it in importlib.resources tests to avoid leavingmod
around to impede importlib.metadata tests.
构建
gh-114736 [https://github.com/python/cpython/issues/114736]: Have WASI builds use WASI SDK 21.
gh-115983 [https://github.com/python/cpython/issues/115983]: Skip building test modules that must be built as shared under WASI.
gh-71052 [https://github.com/python/cpython/issues/71052]: Add Android build script and instructions.
Windows
gh-117267 [https://github.com/python/cpython/issues/117267]: Ensure
DirEntry.stat().st_ctime
behaves consistently withos.stat()
during the deprecation period ofst_ctime
by containing the same value asst_birthtime
. After the deprecation period,st_ctime
will be the metadata change time (or unavailable throughDirEntry
), and onlyst_birthtime
will contain the creation time.gh-116195 [https://github.com/python/cpython/issues/116195]: Improves performance of
os.getppid()
by using an alternate system API when available. Contributed by vxiiduu.gh-88494 [https://github.com/python/cpython/issues/88494]: On Windows,
time.monotonic()
now uses theQueryPerformanceCounter()
clock to have a resolution better than 1 us, instead of theGetTickCount64()
clock which has a resolution of 15.6 ms. Patch by Victor Stinner.gh-116773 [https://github.com/python/cpython/issues/116773]: Fix instances of
<_overlapped.Overlapped object at 0xXXX> still has pending operation at deallocation, the process may crash
.gh-91227 [https://github.com/python/cpython/issues/91227]: Fix the asyncio ProactorEventLoop implementation so that sending a datagram to an address that is not listening does not prevent receiving any more datagrams.
gh-115119 [https://github.com/python/cpython/issues/115119]: Switched from vendored
libmpdecimal
code to a separately-hosted external package in thecpython-source-deps
repository when building the_decimal
module.
C API
gh-117642 [https://github.com/python/cpython/issues/117642]: Fix PEP 737 [https://peps.python.org/pep-0737/] implementation for
%#T
and%#N
.gh-87193 [https://github.com/python/cpython/issues/87193]:
PyBytesResize()
can now be called for bytes objects with reference count > 1, including 1-byte bytes objects. It creates a new bytes object and destroys the old one if it has reference count > 1.gh-117021 [https://github.com/python/cpython/issues/117021]: Fix integer overflow in
PyLong_AsPid()
on non-Windows 64-bit platforms.gh-115756 [https://github.com/python/cpython/issues/115756]:
PyCode_GetFirstFree()
is an ustable API now and has been renamed toPyUnstable_Code_GetFirstFree()
. (Contributed by Bogdan Romanyuk in gh-115781 [https://github.com/python/cpython/issues/115781])gh-116869 [https://github.com/python/cpython/issues/116869]: Add
test_cext
test: build a C extension to check if the Python C API emits C compiler warnings. Patch by Victor Stinner.gh-116869 [https://github.com/python/cpython/issues/116869]: Make the C API compatible with
-Werror=declaration-after-statement
compiler flag again. Patch by Victor Stinner.gh-116936 [https://github.com/python/cpython/issues/116936]: Add
PyType_GetModuleByDef()
to the limited C API. Patch by Victor Stinner.gh-116809 [https://github.com/python/cpython/issues/116809]: Restore removed private
PyErrChainExceptions1()
function. Patch by Victor Stinner.gh-115754 [https://github.com/python/cpython/issues/115754]: In the limited C API version 3.13, getting
Py_None
,Py_False
,Py_True
,Py_Ellipsis
andPy_NotImplemented
singletons is now implemented as function calls at the stable ABI level to hide implementation details. Getting these constants still return borrowed references. Patch by Victor Stinner.gh-115754 [https://github.com/python/cpython/issues/115754]: Add
Py_GetConstant()
andPy_GetConstantBorrowed()
functions to get constants. For example,Py_GetConstant(Py_CONSTANT_ZERO)
returns a strong reference to the constant zero. Patch by Victor Stinner.gh-111696 [https://github.com/python/cpython/issues/111696]: Add support for
%T
,%T#
,%N
and%N#
formats toPyUnicode_FromFormat()
: format the fully qualified name of an object type and of a type: callPyType_GetModuleName()
. See PEP 737 [https://peps.python.org/pep-0737/] for more information. Patch by Victor Stinner.gh-111696 [https://github.com/python/cpython/issues/111696]: Add
PyType_GetModuleName()
function to get the type's module name. Equivalent to getting thetype.__module__
attribute. Patch by Eric Snow and Victor Stinner.gh-111696 [https://github.com/python/cpython/issues/111696]: Add
PyType_GetFullyQualifiedName()
function to get the type's fully qualified name. Equivalent tof"{type.__module__}.{type.__qualname__}"
, ortype.__qualname__
iftype.__module__
is not a string or is equal to"builtins"
. Patch by Victor Stinner.gh-85283 [https://github.com/python/cpython/issues/85283]: The
fcntl
,grp
,pwd
,termios
,_statistics
and_testconsole
C extensions are now built with the limited C API. Patch by Victor Stinner.gh-111140 [https://github.com/python/cpython/issues/111140]: Add additional flags to
PyLong_AsNativeBytes()
andPyLong_FromNativeBytes()
to allow the caller to determine how to handle edge cases around values that fill the entire buffer.gh-113024 [https://github.com/python/cpython/issues/113024]: Add
PyObject_GenericHash()
function.
Python 3.13.0 alpha 5
Release date: 2024-03-12
安全性
gh-115398 [https://github.com/python/cpython/issues/115398]: Allow controlling Expat >=2.6.0 reparse deferral ( CVE 2023-52425 [https://www.cve.org/CVERecord?id=CVE-2023-52425]) by adding five new methods:
gh-114572 [https://github.com/python/cpython/issues/114572]:
ssl.SSLContext.cert_store_stats()
andssl.SSLContext.get_ca_certs()
now correctly lock access to the certificate store, when thessl.SSLContext
is shared across multiple threads.
核心与内置函数
gh-116604 [https://github.com/python/cpython/issues/116604]: Respect the status of the garbage collector when indirect calls are made via
PyErr_CheckSignals()
and the evaluation breaker. Patch by Pablo Galindogh-112087 [https://github.com/python/cpython/issues/112087]:
list
is now compatible with the implementation of PEP 703 [https://peps.python.org/pep-0703/].gh-116381 [https://github.com/python/cpython/issues/116381]: Add specialization for
CONTAINS_OP
.gh-116296 [https://github.com/python/cpython/issues/116296]: Fix possible refleak in
object.__reduce__()
internal error handling.gh-115823 [https://github.com/python/cpython/issues/115823]: Properly calculate error ranges in the parser when raising
SyntaxError
exceptions caused by invalid byte sequences. Patch by Pablo Galindogh-115778 [https://github.com/python/cpython/issues/115778]: Add
tierN
annotation for instruction definition in interpreter DSL.gh-115733 [https://github.com/python/cpython/issues/115733]: Fix crash when calling
next()
on exhausted list iterators.gh-115700 [https://github.com/python/cpython/issues/115700]: The regen-cases build stage now works on Windows.
gh-115347 [https://github.com/python/cpython/issues/115347]: Fix bug where docstring was replaced by a redundant NOP when Python is run with
-OO
.gh-115323 [https://github.com/python/cpython/issues/115323]: Make error message more meaningful for when
bytearray.extend()
is called with astr
object.gh-112175 [https://github.com/python/cpython/issues/112175]: Every
PyThreadState
now has its owneval_breaker
, allowing specific threads to be interrupted.gh-115154 [https://github.com/python/cpython/issues/115154]: Fix a bug that was causing the
tokenize.untokenize()
function to handle unicode named literals incorrectly. Patch by Pablo Galindogh-112433 [https://github.com/python/cpython/issues/112433]: Add ability to force alignment of
ctypes.Structure
by way of the newalign
attribute on the class.gh-104090 [https://github.com/python/cpython/issues/104090]: The multiprocessing resource tracker now exits with non-zero status code if a resource leak was detected. It still exits with status code 0 otherwise.
gh-105858 [https://github.com/python/cpython/issues/105858]: Improve the constructors for
ast
nodes. Arguments of list types now default to an empty list if omitted, and optional fields default toNone
. AST nodes now have an__annotations__
attribute with the expected types of their attributes. Passing unrecognized extra arguments to AST nodes is deprecated and will become an error in Python 3.15. Omitting a required argument to an AST node is deprecated and will become an error in Python 3.15. Patch by Jelle Zijlstra.gh-101860 [https://github.com/python/cpython/issues/101860]: Expose
__name__
attribute on property.gh-96497 [https://github.com/python/cpython/issues/96497]: Fix incorrect resolution of mangled class variables used in assignment expressions in comprehensions.
库
gh-116600 [https://github.com/python/cpython/issues/116600]: Fix
repr()
for globalFlag
members.gh-116349 [https://github.com/python/cpython/issues/116349]:
platform.java_ver()
is deprecated and will be removed in 3.15. It was largely untested, had a confusing API, and was only useful for Jython support.gh-116143 [https://github.com/python/cpython/issues/116143]: Fix a race in pydoc
startserver
, eliminating a window in whichstartserver
can return a thread that is "serving" but without adocserver
set.gh-116127 [https://github.com/python/cpython/issues/116127]:
typing
: implement PEP 705 [https://peps.python.org/pep-0705/] which addstyping.ReadOnly
support totyping.TypedDict
.gh-116325 [https://github.com/python/cpython/issues/116325]:
typing
: raiseSyntaxError
instead ofAttributeError
on forward references as empty strings.gh-115957 [https://github.com/python/cpython/issues/115957]: When
asyncio.TaskGroup.create_task
is called on an inactiveasyncio.TaskGroup
, the given coroutine will be closed (which prevents aRuntimeWarning
).gh-115978 [https://github.com/python/cpython/issues/115978]: Disable preadv(), readv(), pwritev(), and writev() on WASI.
Under wasmtime for WASI 0.2, these functions don't pass test_posix (https://github.com/bytecodealliance/wasmtime/issues/7830).
gh-88352 [https://github.com/python/cpython/issues/88352]: Fix the computation of the next rollover time in the
logging.TimedRotatingFileHandler
handler.computeRollover()
now always returns a timestamp larger than the specified time and works correctly during the DST change.doRollover()
no longer overwrite the already rolled over file, saving from data loss when run at midnight or during repeated time at the DST change.gh-87115 [https://github.com/python/cpython/issues/87115]: Set
__main__.__spec__
toNone
when running a script withpdb
gh-76511 [https://github.com/python/cpython/issues/76511]: Fix UnicodeEncodeError in
email.Message.as_string()
that results when a message that claims to be in the ascii character set actually has nonascii characters. Nonascii characters are now replaced with the U+FFFD replacement character, like in thereplace
error handler.gh-89547 [https://github.com/python/cpython/issues/89547]: Add support for nested typing special forms like Final[ClassVar[int]].
gh-65824 [https://github.com/python/cpython/issues/65824]: Improve the
less
prompt inpydoc
.gh-116040 [https://github.com/python/cpython/issues/116040]: [Enum] fix by-value calls when second value is falsey; e.g. Cardinal(1, 0)
gh-115821 [https://github.com/python/cpython/issues/115821]: [Enum] Improve error message when calling super().new() in custom new.
gh-85644 [https://github.com/python/cpython/issues/85644]: Use the
XDG_CURRENT_DESKTOP
environment variable inwebbrowser
to check desktop. Prefer it to the deprecatedGNOME_DESKTOP_SESSION_ID
for GNOME detection.gh-75988 [https://github.com/python/cpython/issues/75988]: Fixed
unittest.mock.create_autospec()
to pass the call through to the wrapped object to return the real result.gh-115881 [https://github.com/python/cpython/issues/115881]: Fix issue where
ast.parse()
would incorrectly flag conditional context managers (such aswith (x() if y else z()): …
) as invalid syntax iffeature_version=(3, 8)
was passed. This reverts changes to the grammar made as part of gh-94949 [https://github.com/python/cpython/issues/94949].gh-115886 [https://github.com/python/cpython/issues/115886]: Fix silent truncation of the name with an embedded null character in
multiprocessing.shared_memory.SharedMemory
.gh-115532 [https://github.com/python/cpython/issues/115532]: Add kernel density estimation to the statistics module.
gh-115714 [https://github.com/python/cpython/issues/115714]: On WASI, the
time
module no longer get process time usingtimes()
orCLOCK_PROCESS_CPUTIME_ID
, system API is that is unreliable and is likely to be removed from WASI. The affected clock functions fall back to callingclock()
.gh-115809 [https://github.com/python/cpython/issues/115809]: Improve algorithm for computing which rolled-over log files to delete in
logging.TimedRotatingFileHandler
. It is now reliable for handlers withoutnamer
and with arbitrary deterministicnamer
that leaves the datetime part in the file name unmodified.gh-74668 [https://github.com/python/cpython/issues/74668]:
urllib.parse
functionsparse_qs()
andparse_qsl()
now support bytes arguments containing raw and percent-encoded nonASCII data.gh-67044 [https://github.com/python/cpython/issues/67044]:
csv.writer()
now always quotes or escapes'\r'
and'\n'
, regardless of lineterminator value.gh-115712 [https://github.com/python/cpython/issues/115712]: Restore support of space delimiter with
skipinitialspace=True
incsv
.csv.writer()
now quotes empty fields if delimiter is a space and skipinitialspace is true and raises exception if quoting is not possible.gh-112364 [https://github.com/python/cpython/issues/112364]: Fixed
ast.unparse()
to handle format_spec with"
,'
or\
. Patched by Frank Hoffmann.gh-112997 [https://github.com/python/cpython/issues/112997]: Stop logging potentially sensitive callback arguments in
asyncio
unless debug mode is active.gh-114914 [https://github.com/python/cpython/issues/114914]: Fix an issue where an abandoned
StreamWriter
would not be garbage collected.gh-111358 [https://github.com/python/cpython/issues/111358]: Fix a bug in
asyncio.BaseEventLoop.shutdown_default_executor()
to ensure the timeout passed to the coroutine behaves as expected.gh-115618 [https://github.com/python/cpython/issues/115618]: Fix improper decreasing the reference count for
None
argument inproperty
methodsgetter()
,setter()
anddeleter()
.gh-112720 [https://github.com/python/cpython/issues/112720]: Refactor
dis.ArgResolver
to make it possible to subclass and change the way jump args are interpreted.gh-112006 [https://github.com/python/cpython/issues/112006]: Fix
inspect.unwrap()
for types with the__wrapper__
data descriptor. Fixinspect.Signature.from_callable()
for builtinsclassmethod()
andstaticmethod()
.gh-101293 [https://github.com/python/cpython/issues/101293]: Support callables with the
__call__()
method and types with_new_()
and__init__()
methods set to class methods, static methods, bound methods, partial functions, and other types of methods and descriptors ininspect.Signature.from_callable()
.gh-103092 [https://github.com/python/cpython/issues/103092]: Isolate
_lsprof
(apply PEP 687 [https://peps.python.org/pep-0687/]).gh-113942 [https://github.com/python/cpython/issues/113942]:
pydoc
no longer skips global functions implemented as builtin methods, such asMethodDescriptorType
andWrapperDescriptorType
.gh-115256 [https://github.com/python/cpython/issues/115256]: Added DeprecationWarning when accessing the tarfile attribute of TarInfo objects. The attribute is never used internally and is only attached to TarInfos when the tarfile is opened in write-mode, not read-mode. The attribute creates an unnecessary reference cycle which may cause corruption when not closing the handle after writing a tarfile.
gh-115197 [https://github.com/python/cpython/issues/115197]:
urllib.request
no longer resolves the hostname before checking it against the system's proxy bypass list on macOS and Windows.gh-113812 [https://github.com/python/cpython/issues/113812]:
DatagramTransport.sendto()
will now send zero-length datagrams if called with an empty bytes object. The transport flow control also now accounts for the datagram header when calculating the buffer size.gh-114763 [https://github.com/python/cpython/issues/114763]: Protect modules loaded with
importlib.util.LazyLoader
from race conditions when multiple threads try to access attributes before the loading is complete.gh-114709 [https://github.com/python/cpython/issues/114709]:
posixpath.commonpath()
now raises aValueError
exception when passed an empty iterable. Previously,IndexError
was raised.
posixpath.commonpath()
now raises a TypeError
exception when passed None
. Previously, ValueError
was raised.
gh-114610 [https://github.com/python/cpython/issues/114610]: Fix bug where
pathlib.PurePath.with_stem()
converted a non-empty path suffix to a stem when given an empty stem argument. It now raisesValueError
, just likepathlib.PurePath.with_suffix()
does when called on a path with an empty stem, given a non-empty suffix argument.gh-107361 [https://github.com/python/cpython/issues/107361]: Add
ssl.VERIFY_X509_PARTIAL_CHAIN
andVERIFY_X509_STRICT
to the default SSL context created withssl.create_default_context()
.gh-112281 [https://github.com/python/cpython/issues/112281]: Allow creating union of types for
typing.Annotated
with unhashable metadata.gh-111775 [https://github.com/python/cpython/issues/111775]: Fix
importlib.resources.simple.ResourceHandle.open()
for text mode, added missedstream
argument.gh-90095 [https://github.com/python/cpython/issues/90095]: Make .pdbrc and -c work with any valid pdb commands.
gh-107625 [https://github.com/python/cpython/issues/107625]: Raise
configparser.ParsingError
fromread()
andread_file()
methods ofconfigparser.ConfigParser
if a key without a corresponding value is continued (that is, followed by an indented line).gh-107155 [https://github.com/python/cpython/issues/107155]: Fix incorrect output of
help(x)
wherex
is alambda
function, which has an__annotations__
dictionary attribute with a"return"
key.gh-57141 [https://github.com/python/cpython/issues/57141]: Add option for non-shallow comparisons to
filecmp.dircmp
likefilecmp.cmp()
. Original patch by Steven Ward. Enhanced by Tobias Rautenkranzgh-69990 [https://github.com/python/cpython/issues/69990]:
Profile.print_stats()
has been improved to accept multiple sort arguments. Patched by Chiu-Hsiang Hsu and Furkan Onder.gh-104061 [https://github.com/python/cpython/issues/104061]: Add
socket.SO_BINDTOIFINDEX
constant.gh-60346 [https://github.com/python/cpython/issues/60346]: Fix ArgumentParser inconsistent with parse_known_args.
gh-102389 [https://github.com/python/cpython/issues/102389]: Add
windows_31j
to aliases forcp932
codecgh-72249 [https://github.com/python/cpython/issues/72249]:
functools.partial
has been improved to include the module name. Patched by Furkan Onder and Anilyka Barry.s of :func:
repr()gh-100985 [https://github.com/python/cpython/issues/100985]: Update HTTPSConnection to consistently wrap IPv6 Addresses when using a proxy.
gh-100884 [https://github.com/python/cpython/issues/100884]: email: fix misfolding of comma in address-lists over multiple lines in combination with unicode encoding.
gh-95782 [https://github.com/python/cpython/issues/95782]: Fix
io.BufferedReader.tell()
,io.BufferedReader.seek()
,_pyio.BufferedReader.tell()
,io.BufferedRandom.tell()
,io.BufferedRandom.seek()
and_pyio.BufferedRandom.tell()
being able to return negative offsets.gh-96310 [https://github.com/python/cpython/issues/96310]: Fix a traceback in
argparse
when all options in a mutually exclusive group are suppressed.gh-93205 [https://github.com/python/cpython/issues/93205]: Fixed a bug in
logging.handlers.TimedRotatingFileHandler
where multiple rotating handler instances pointing to files with the same name but different extensions would conflict and not delete the correct files.bpo-31116 [https://bugs.python.org/issue?@action=redirect&bpo=31116]: Add Z85 encoding to
base64
.bpo-44865 [https://bugs.python.org/issue?@action=redirect&bpo=44865]: Add missing call to localization function in
argparse
.bpo-43952 [https://bugs.python.org/issue?@action=redirect&bpo=43952]: Fix
multiprocessing.connection.Listener.accept()
to accept empty bytes as authkey. Not accepting empty bytes as key causes it to hang indefinitely.bpo-42125 [https://bugs.python.org/issue?@action=redirect&bpo=42125]: linecache: get module name from
__spec__
if available. This allows getting source code for the__main__
module when a custom loader is used.bpo-41122 [https://bugs.python.org/issue?@action=redirect&bpo=41122]: Failing to pass arguments properly to
functools.singledispatchmethod()
now throws a TypeError instead of hitting an index out of bounds internally.bpo-40818 [https://bugs.python.org/issue?@action=redirect&bpo=40818]: The asyncio REPL now runs
sys.__interactivehook__
on startup. The default implementation ofsys.__interactivehook__
provides autocompletion to the asyncio REPL. Patch contributed by Rémi Lapeyre.bpo-33775 [https://bugs.python.org/issue?@action=redirect&bpo=33775]: Add 'default' and 'version' help text for localization in argparse.
文档
gh-115399 [https://github.com/python/cpython/issues/115399]: Document CVE 2023-52425 [https://www.cve.org/CVERecord?id=CVE-2023-52425] of Expat <2.6.0 under "XML vulnerabilities".
gh-109653 [https://github.com/python/cpython/issues/109653]: Improve import time of
uuid
on Linux.
测试
gh-71052 [https://github.com/python/cpython/issues/71052]: Add test exclusions to support running the test suite on Android.
gh-71052 [https://github.com/python/cpython/issues/71052]: Enable
test_concurrent_futures
on platforms that support threading but not multiprocessing.gh-115796 [https://github.com/python/cpython/issues/115796]: Make 'testinternalcapi.assemblecode_object' construct the exception table for the code object.
gh-115720 [https://github.com/python/cpython/issues/115720]: Leak tests (
-R
,--huntrleaks
) now show a summary of the number of leaks found in each iteration.gh-115122 [https://github.com/python/cpython/issues/115122]: Add
--bisect
option to regrtest test runner: run failed tests withtest.bisect_cmd
to identify failing tests. Patch by Victor Stinner.gh-115596 [https://github.com/python/cpython/issues/115596]: Fix
ProgramPriorityTests
intest_os
permanently changing the process priority.gh-115556 [https://github.com/python/cpython/issues/115556]: On Windows, commas passed in arguments to
Tools\buildbot\test.bat
andPCbuild\rt.bat
are now properly handled.gh-115420 [https://github.com/python/cpython/issues/115420]: Fix translation of exception handler targets by
testinternalcapi.optimizecfg
.gh-115376 [https://github.com/python/cpython/issues/115376]: Fix segfault in
testinternalcapi.compilercodegen
on bad input.
构建
gh-116313 [https://github.com/python/cpython/issues/116313]: Get WASI builds to work under wasmtime 18 w/ WASI 0.2/preview2 primitives.
gh-71052 [https://github.com/python/cpython/issues/71052]: Change Android's
sys.platform
from"linux"
to"android"
.gh-116117 [https://github.com/python/cpython/issues/116117]: Backport
libb2
's PR #42 to fix compiling CPython on 32-bit Windows withclang-cl
.gh-71052 [https://github.com/python/cpython/issues/71052]: Fix several Android build issues
gh-114099 [https://github.com/python/cpython/issues/114099]: A testbed project was added to run the test suite on iOS.
gh-115350 [https://github.com/python/cpython/issues/115350]: Fix building ctypes module with -DWIN32_LEAN_AND_MEAN defined
gh-111225 [https://github.com/python/cpython/issues/111225]: Link extension modules against libpython on Android.
gh-115737 [https://github.com/python/cpython/issues/115737]: The install name for libPython is now correctly set for non-framework macOS builds.
gh-114099 [https://github.com/python/cpython/issues/114099]: Makefile targets were added to support compiling an iOS-compatible framework build.
Windows
gh-116012 [https://github.com/python/cpython/issues/116012]: Ensure the value of
GetLastError()
is preserved across GIL operations.gh-115582 [https://github.com/python/cpython/issues/115582]: Building extensions intended for free-threaded builds of CPython now require compiling with
/DPy_GIL_DISABLED
manually when using a regular install. This is expected to change in future releases.gh-115554 [https://github.com/python/cpython/issues/115554]: The installer now has more strict rules about updating the 适用于Windows的Python启动器. In general, most users only have a single launcher installed and will see no difference. When multiple launchers have been installed, the option to install the launcher is disabled until all but one have been removed. Downgrading the launcher (which was never allowed) is now more obviously blocked.
gh-115543 [https://github.com/python/cpython/issues/115543]: 适用于Windows的Python启动器 can now detect Python 3.13 when installed from the Microsoft Store, and will install Python 3.12 by default when
PYLAUNCHER_ALLOW_INSTALL
is set.
macOS
- gh-116145 [https://github.com/python/cpython/issues/116145]: Update macOS installer to Tcl/Tk 8.6.14.
IDLE
- gh-88516 [https://github.com/python/cpython/issues/88516]: On macOS show a proxy icon in the title bar of editor windows to match platform behaviour.
工具/示例
gh-100176 [https://github.com/python/cpython/issues/100176]: Remove outdated Tools/{io,cc,string}bench
bpo-45101 [https://bugs.python.org/issue?@action=redirect&bpo=45101]: Add consistency in usage message IO between 2 versions of python-config.
C API
gh-114626 [https://github.com/python/cpython/issues/114626]: Add again
_PyCFunctionFastWithKeywords
name, removed in Python 3.13 alpha 4 by mistake. Keep the old private_PyCFunctionFastWithKeywords
name (Python 3.7) as an alias to the new public namePyCFunctionFastWithKeywords
(Python 3.13a4). Patch by Victor Stinner.gh-111418 [https://github.com/python/cpython/issues/111418]: Add
PyHASH_MODULUS
,PyHASH_BITS
,PyHASH_INF
andPyHASH_IMAG
C macros. Patch by Sergey B Kirpichev.
Python 3.13.0 alpha 4
Release date: 2024-02-15