文档
gh-111699 [https://github.com/python/cpython/issues/111699]: Relocate
smtpd
deprecation notice to its own section rather than underlocale
in What's New in Python 3.12 documentgh-110746 [https://github.com/python/cpython/issues/110746]: Improved markup for valid options/values for methods ttk.treeview.column and ttk.treeview.heading, and for Layouts.
gh-95649 [https://github.com/python/cpython/issues/95649]: Document that the
asyncio
module contains code taken from v0.16.0 of the uvloop project [https://github.com/MagicStack/uvloop/tree/v0.16.0], as well as the required MIT licensing information.
测试
gh-111798 [https://github.com/python/cpython/issues/111798]: Disable
test_super_deep()
fromtest_call
under pydebug builds on WASI; the stack depth is too small to make the test useful.gh-111801 [https://github.com/python/cpython/issues/111801]: Lower the recursion limit in
test_isinstance
fortest_infinitely_many_bases()
. This prevents a stack overflow on a pydebug build of WASI.gh-111802 [https://github.com/python/cpython/issues/111802]: Specify a low recursion depth for
test_bad_getattr()
intest.pickletester
to avoid exhausting the stack under a pydebug build for WASI.gh-44626 [https://github.com/python/cpython/issues/44626]: Fix
os.path.isabs()
incorrectly returningTrue
when given a path that starts with exactly one (back)slash on Windows.
Fix pathlib.PureWindowsPath.is_absolute()
incorrectly returning False
for some paths beginning with two (back)slashes.
gh-113633 [https://github.com/python/cpython/issues/113633]: Use module state for the _testcapi extension module.
gh-109980 [https://github.com/python/cpython/issues/109980]: Fix
test_tarfile_vs_tar
intest_shutil
for macOS, where system tar can include more information in the archive thanshutil.make_archive
.gh-112769 [https://github.com/python/cpython/issues/112769]: The tests now correctly compare zlib version when
zlib.ZLIB_RUNTIME_VERSION
contains non-integer suffixes. For example zlib-ng defines the version as1.3.0.zlib-ng
.gh-112334 [https://github.com/python/cpython/issues/112334]: Adds a regression test to verify that
vfork()
is used when expected bysubprocess
on vfork enabled POSIX systems (Linux).gh-108927 [https://github.com/python/cpython/issues/108927]: Fixed order dependence in running tests in the same process when a test that has submodules (e.g. test_importlib) follows a test that imports its submodule (e.g. test_importlib.util) and precedes a test (e.g. test_unittest or test_compileall) that uses that submodule.
bpo-40648 [https://bugs.python.org/issue?@action=redirect&bpo=40648]: Test modes that file can get with chmod() on Windows.
构建
gh-114013 [https://github.com/python/cpython/issues/114013]: Fix
Tools/wasm/wasi.py
to not include the path topython.wasm
as part ofHOSTRUNNER
. The environment variable is meant to specify how to run the WASI host only, havingpython.wasm
and relevant flags appended to theHOSTRUNNER
. This fixesmake test
work.gh-113258 [https://github.com/python/cpython/issues/113258]: Changed the Windows build to write out generated frozen modules into the build tree instead of the source tree.
gh-112305 [https://github.com/python/cpython/issues/112305]: Fixed the
check-clean-src
step performed on out of tree builds to detect errant$(srcdir)/Python/frozen_modules/*.h
files and recommend appropriate source tree cleanup steps to get a working build again.gh-112536 [https://github.com/python/cpython/issues/112536]: Add support for thread sanitizer (TSAN)
gh-112867 [https://github.com/python/cpython/issues/112867]: Fix the build for the case that WITH_PYMALLOC_RADIX_TREE=0 set.
gh-103065 [https://github.com/python/cpython/issues/103065]: Introduce
Tools/wasm/wasi.py
to simplify doing a WASI build.bpo-11102 [https://bugs.python.org/issue?@action=redirect&bpo=11102]: The
os.major()
,os.makedev()
, andos.minor()
functions are now available on HP-UX v3.bpo-36351 [https://bugs.python.org/issue?@action=redirect&bpo=36351]: Do not set ipv6type when cross-compiling.
Windows
gh-114096 [https://github.com/python/cpython/issues/114096]: Process privileges that are activated for creating directory junctions are now restored afterwards, avoiding behaviour changes in other parts of the program.
gh-111877 [https://github.com/python/cpython/issues/111877]:
os.stat()
calls were returning incorrect time values for files that could not be accessed directly.gh-111973 [https://github.com/python/cpython/issues/111973]: Update Windows installer to use SQLite 3.44.2.
gh-113009 [https://github.com/python/cpython/issues/113009]:
multiprocessing
: On Windows, fix a race condition inProcess.terminate()
: no longer set thereturncode
attribute to always callWaitForSingleObject()
inProcess.wait()
. Previously, sometimes the process was still running afterTerminateProcess()
even ifGetExitCodeProcess()
is notSTILL_ACTIVE
. Patch by Victor Stinner.gh-86179 [https://github.com/python/cpython/issues/86179]: Fixes path calculations when launching Python on Windows through a symlink.
gh-71383 [https://github.com/python/cpython/issues/71383]: Update Tcl/Tk in Windows installer to 8.6.13 with a patch to suppress incorrect ThemeChanged warnings.
gh-111650 [https://github.com/python/cpython/issues/111650]: Ensures the
Py_GIL_DISABLED
preprocessor variable is defined inpyconfig.h
so that extension modules written in C are able to use it.gh-112278 [https://github.com/python/cpython/issues/112278]: Reduce the time cost for some functions in
platform
on Windows if current user has no permission to the WMI.gh-73427 [https://github.com/python/cpython/issues/73427]: Deprecate
sys._enablelegacywindowsfsencoding()
. UsePYTHONLEGACYWINDOWSFSENCODING
instead. Patch by Inada Naoki.gh-87868 [https://github.com/python/cpython/issues/87868]: Correctly sort and remove duplicate environment variables in
_winapi.CreateProcess()
.bpo-37308 [https://bugs.python.org/issue?@action=redirect&bpo=37308]: Fix mojibake in
mmap.mmap
when using a nonASCII tagname argument on Windows.
macOS
gh-113666 [https://github.com/python/cpython/issues/113666]: Add the following constants to module
stat
:UF_SETTABLE
,UF_TRACKED
,UF_DATAVAULT
,SF_SUPPORTED
,SF_SETTABLE
,SF_SYNTHETIC
,SF_RESTRICTED
,SF_FIRMLINK
andSF_DATALESS
. The valuesUF_SETTABLE
,SF_SUPPORTED
,SF_SETTABLE
andSF_SYNTHETIC
are only available on macOS.gh-113536 [https://github.com/python/cpython/issues/113536]:
os.waitid()
is now available on macOSgh-110459 [https://github.com/python/cpython/issues/110459]: Running
configure … --with-openssl-rpath=X/Y/Z
no longer fails to detect OpenSSL on macOS.gh-74573 [https://github.com/python/cpython/issues/74573]: Document that
dbm.ndbm
can silently corrupt DBM files on updates when exceeding undocumented platform limits, and can crash (segmentation fault) when reading such a corrupted file. (FB8919203)gh-65701 [https://github.com/python/cpython/issues/65701]: The freeze tool doesn't work with framework builds of Python. Document this and bail out early when running the tool with such a build.
gh-87277 [https://github.com/python/cpython/issues/87277]: webbrowser: Don't look for X11 browsers on macOS. Those are generally not used and probing for them can result in starting XQuartz even if it isn't used otherwise.
gh-111973 [https://github.com/python/cpython/issues/111973]: Update macOS installer to use SQLite 3.44.2.
gh-108269 [https://github.com/python/cpython/issues/108269]: Set
CFBundleAllowMixedLocalizations
to true in the Info.plist for the framework, embedded Python.app and IDLE.app with framework installs on macOS. This allows applications to pick up the user's preferred locale when that's different from english.gh-102362 [https://github.com/python/cpython/issues/102362]: Make sure the result of
sysconfig.get_plaform()
includes at least a major and minor versions, even ifMACOSX_DEPLOYMENT_TARGET
is set to only a major version during build to match the format expected by pip.gh-110017 [https://github.com/python/cpython/issues/110017]: Disable a signal handling stress test on macOS due to a bug in macOS (FB13453490).
gh-110820 [https://github.com/python/cpython/issues/110820]: Make sure the preprocessor definitions for
ALIGNOF_MAX_ALIGN_T
,SIZEOF_LONG_DOUBLE
andHAVE_GCC_ASM_FOR_X64
are correct for Universal 2 builds on macOS.gh-109981 [https://github.com/python/cpython/issues/109981]: Use
devfd
on macOS to determine the number of open files intest.support.os_helper.fd_count
to avoid a crash with "guarded" file descriptors when probing for open files.
IDLE
gh-72284 [https://github.com/python/cpython/issues/72284]: Improve the lists of features, editor key bindings, and shell key bingings in the IDLE doc.
gh-113903 [https://github.com/python/cpython/issues/113903]: Fix rare failure of test.test_idle, in test_configdialog.
gh-113729 [https://github.com/python/cpython/issues/113729]: Fix the "Help -> IDLE Doc" menu bug in 3.11.7 and 3.12.1.
gh-113269 [https://github.com/python/cpython/issues/113269]: Fix test_editor hang on macOS Catalina.
gh-112898 [https://github.com/python/cpython/issues/112898]: Fix processing unsaved files when quitting IDLE on macOS.
bpo-13586 [https://bugs.python.org/issue?@action=redirect&bpo=13586]: Enter the selected text when opening the "Replace" dialog.
C API
gh-106560 [https://github.com/python/cpython/issues/106560]: Fix redundant declarations in the public C API. Declare PyBool_Type, PyLong_Type and PySys_Audit() only once. Patch by Victor Stinner.
gh-112438 [https://github.com/python/cpython/issues/112438]: Fix support of format units "es", "et", "es#", and "et#" in nested tuples in
PyArg_ParseTuple()
-like functions.gh-111545 [https://github.com/python/cpython/issues/111545]: Add
Py_HashPointer()
function to hash a pointer. Patch by Victor Stinner.gh-65210 [https://github.com/python/cpython/issues/65210]: Change the declaration of the keywords parameter of
PyArg_ParseTupleAndKeywords()
andPyArg_VaParseTupleAndKeywords()
for better compatibility with C++.
Python 3.13.0 alpha 2
Release date: 2023-11-22
核心与内置函数
gh-112243 [https://github.com/python/cpython/issues/112243]: Don't include comments in fstring debug expressions. Patch by Pablo Galindo
gh-112287 [https://github.com/python/cpython/issues/112287]: Slightly optimize the Tier 2 (uop) interpreter by only loading
oparg
andoperand
when needed. Also double the trace size limit again, to 512 this time.gh-112266 [https://github.com/python/cpython/issues/112266]: Change docstrings of
__dict__
and__weakref__
.gh-111807 [https://github.com/python/cpython/issues/111807]: Lower the max parser stack depth to 1000 under WASI debug builds.
gh-111798 [https://github.com/python/cpython/issues/111798]: When Python is built in debug mode, set the C recursion limit to 500 instead of 1500. A debug build is likely built with low optimization level which implies higher stack memory usage than a release build. Patch by Victor Stinner.
gh-106529 [https://github.com/python/cpython/issues/106529]: Enable translating unspecialized
FOR_ITER
to Tier 2.gh-111916 [https://github.com/python/cpython/issues/111916]: Make hashlib related modules threadsafe without the GIL
gh-81137 [https://github.com/python/cpython/issues/81137]: Deprecate assignment to a function's
__code__
field when the new code object is of a mismatched type (e.g., from a generator to a plain function).gh-79932 [https://github.com/python/cpython/issues/79932]: Raise exception if
frame.clear()
is called on a suspended frame.gh-81925 [https://github.com/python/cpython/issues/81925]: Implement native thread ids for GNU KFreeBSD.
gh-111843 [https://github.com/python/cpython/issues/111843]: Use exponential backoff to reduce the number of failed tier 2 optimization attempts by over 99%.
gh-110829 [https://github.com/python/cpython/issues/110829]: Joining a thread now ensures the underlying OS thread has exited. This is required for safer fork() in multithreaded processes.
gh-109369 [https://github.com/python/cpython/issues/109369]: Make sure that tier 2 traces are deoptimized if the code is instrumented
gh-111772 [https://github.com/python/cpython/issues/111772]: Specialize slot loads and stores for PyT_OBJECT as well as Py_T_OBJECT_EX
gh-111666 [https://github.com/python/cpython/issues/111666]: Speed up
BaseExceptionGroup.derive()
,BaseExceptionGroup.subgroup()
, andBaseExceptionGroup.split()
by changing how they parse passed arguments.gh-111654 [https://github.com/python/cpython/issues/111654]: Fix runtime crash when some error happens in opcode
LOAD_FROM_DICT_OR_DEREF
.gh-111623 [https://github.com/python/cpython/issues/111623]: Add support for sharing tuples between interpreters using the cross-interpreter API. Patch by Anthony Shaw.
gh-111354 [https://github.com/python/cpython/issues/111354]: The oparg of
YIELD_VALUE
is now1
if the instruction is part of a yieldfrom or await, and0
otherwise.
The SUSPENDED frame state is now split into SUSPENDED
and SUSPENDED_YIELD_FROM
. This simplifies the code in PyGenyf
.
- gh-111520 [https://github.com/python/cpython/issues/111520]: Merge the Tier 1 (bytecode) and Tier 2 (microops) interpreters together, moving the Tier 2 interpreter loop and switch into
PyEvalEvalFrameDefault()
inPython/ceval.c
. ThePython/executor.c
file is gone. Also theTIER_ONE
andTIER_TWO
macros are now handled by the code generator.
Beware! This changes the environment variables to enable microops and their debugging to PYTHON_UOPS
and PYTHON_LLTRACE
.
gh-109181 [https://github.com/python/cpython/issues/109181]: Speed up
Traceback
object creation by lazily compute the line number. Patch by Pablo Galindogh-111420 [https://github.com/python/cpython/issues/111420]: Allow type comments in parenthesized
with
statementsgh-111438 [https://github.com/python/cpython/issues/111438]: Add support for sharing floats between interpreters using the cross-interpreter API. Patch by Anthony Shaw.
gh-111435 [https://github.com/python/cpython/issues/111435]: Add support for sharing of
True
andFalse
between interpreters using the cross-interpreter API. Patch by Anthony Shaw.gh-102388 [https://github.com/python/cpython/issues/102388]: Fix a bug where
iso2022_jp_3
andiso2022_jp_2004
codecs read out of boundsgh-111366 [https://github.com/python/cpython/issues/111366]: Fix an issue in the
codeop
that was causingSyntaxError
exceptions raised in the presence of invalid syntax to not contain precise error messages. Patch by Pablo Galindogh-111380 [https://github.com/python/cpython/issues/111380]: Fix a bug that was causing
SyntaxWarning
to appear twice when parsing if invalid syntax is encountered later. Patch by Pablo galindogh-111374 [https://github.com/python/cpython/issues/111374]: Added a new environment variable
PYTHON_FROZEN_MODULES
. It determines whether or not frozen modules are ignored by the import machinery, equivalent of the-X frozen_modules
commandline option.gh-111354 [https://github.com/python/cpython/issues/111354]: Remove
oparg
fromYIELD_VALUE
. Changeoparg
ofRESUME
to include information about the except-depth. These changes make it possible to simplify the code in generator close.gh-94438 [https://github.com/python/cpython/issues/94438]: Fix a regression that prevented jumping across
is None
andis not None
when debugging. Patch by Savannah Ostrowski.gh-67224 [https://github.com/python/cpython/issues/67224]: Show source lines in tracebacks when using the
-c
option when running Python. Patch by Pablo Galindogh-111123 [https://github.com/python/cpython/issues/111123]: Fix a bug where a
global
declaration in anexcept
block is rejected when the global is used in theelse
block.gh-110938 [https://github.com/python/cpython/issues/110938]: Fix error messages for indented blocks with functions and classes with generic type parameters. Patch by Pablo Galindo
gh-109214 [https://github.com/python/cpython/issues/109214]: Remove unnecessary instruction pointer updates before returning from frames.
gh-110912 [https://github.com/python/cpython/issues/110912]: Correctly display the traceback for
MemoryError
exceptions using thetraceback
module. Patch by Pablo Galindogh-109894 [https://github.com/python/cpython/issues/109894]: Fixed crash due to improperly initialized static
MemoryError
in subinterpreter.gh-110892 [https://github.com/python/cpython/issues/110892]: Return
NULL
forPyTrace_RETURN
events caused by an exceptiongh-110864 [https://github.com/python/cpython/issues/110864]: Fix argument parsing by
PyArgUnpackKeywordsWithVararg
for functions defining pos-or-keyword, vararg, and kw-only parameters.gh-109094 [https://github.com/python/cpython/issues/109094]: Replace
prev_instr
on the interpreter frame byinstr_ptr
which points to the beginning of the instruction that is currently executing (or will execute once the frame resumes).gh-110805 [https://github.com/python/cpython/issues/110805]: Allow the repl to show source code and complete tracebacks. Patch by Pablo Galindo
gh-110722 [https://github.com/python/cpython/issues/110722]: Add
PYTHON_PRESITE=package.module
to import a module early in the interpreter lifecycle beforesite.py
is executed. Python needs to be built in debug mode for this option to exist.gh-110481 [https://github.com/python/cpython/issues/110481]: Implement biased reference counting in
--disable-gil
builds.gh-110543 [https://github.com/python/cpython/issues/110543]: Fix regression in Python 3.12 where
types.CodeType.replace()
would produce a broken code object if called on a module or class code object that contains a comprehension. Patch by Jelle Zijlstra.gh-89519 [https://github.com/python/cpython/issues/89519]: Removed chained
classmethod
descriptors (introduced in bpo-19072 [https://bugs.python.org/issue?@action=redirect&bpo=19072]). This can no longer be used to wrap other descriptors such asproperty
. The core design of this feature was flawed and caused a number of downstream problems. To "pass-through" aclassmethod
, consider using the__wrapped__
attribute that was added in Python 3.10.gh-103615 [https://github.com/python/cpython/issues/103615]: Use local events for opcode tracing
bpo-46657 [https://bugs.python.org/issue?@action=redirect&bpo=46657]: Add mimalloc memory allocator support.
gh-106718 [https://github.com/python/cpython/issues/106718]: When PyConfig.stdlib_dir is explicitly set, it's now respected and won't be overridden by PyConfig.home.
gh-106905 [https://github.com/python/cpython/issues/106905]: Fix incorrect SystemError about AST constructor recursion depth mismatch.
gh-100445 [https://github.com/python/cpython/issues/100445]: Improve error message for unterminated strings with escapes.
bpo-45759 [https://bugs.python.org/issue?@action=redirect&bpo=45759]: Improved error messages for
elif
/else
statements not matching any valid statements. Patch by Jeremiah Vivian.
库
gh-111942 [https://github.com/python/cpython/issues/111942]: Fix SystemError in the TextIOWrapper constructor with non-encodable "errors" argument in non-debug mode.
gh-111995 [https://github.com/python/cpython/issues/111995]: Added the
NI_IDN
constant to thesocket
module when present in C at build time for use withsocket.getnameinfo()
.gh-109538 [https://github.com/python/cpython/issues/109538]: Issue warning message instead of having
RuntimeError
be displayed when event loop has already been closed atStreamWriter.__del__()
.gh-111942 [https://github.com/python/cpython/issues/111942]: Fix crashes in
io.TextIOWrapper.reconfigure()
when pass invalid arguments, e.g. non-string encoding.gh-111460 [https://github.com/python/cpython/issues/111460]:
curses
: restore wide character support (includingcurses.unget_wch()
andget_wch()
) on macOS, which was unavailable due to a regression in Python 3.12.gh-103791 [https://github.com/python/cpython/issues/103791]:
contextlib.suppress
now supports suppressing exceptions raised as part of aBaseExceptionGroup
, in addition to the recent support forExceptionGroup
.gh-111835 [https://github.com/python/cpython/issues/111835]: The
mmap.mmap
class now has anseekable()
method that can be used when a seekable file-like object is required. Theseek()
method now returns the new absolute position. Patch by Donghee Na.gh-111804 [https://github.com/python/cpython/issues/111804]: Remove posix.fallocate() under WASI as the underlying posix_fallocate() is not available in WASI preview2.
gh-111841 [https://github.com/python/cpython/issues/111841]: Fix truncating arguments on an embedded null character in
os.putenv()
andos.unsetenv()
on Windows.gh-111768 [https://github.com/python/cpython/issues/111768]:
wsgiref.util.is_hop_by_hop()
is now exposed correctly in__all__
.gh-80731 [https://github.com/python/cpython/issues/80731]: Avoid executing the default function in
cmd.Cmd
in an except blockgh-111541 [https://github.com/python/cpython/issues/111541]: Fix
doctest
forSyntaxError
not-builtin subclasses.gh-111719 [https://github.com/python/cpython/issues/111719]: Add extra argument validation for
alias
command inpdb
gh-111482 [https://github.com/python/cpython/issues/111482]:
time
: Maketime.clock_gettime()
andtime.clock_gettime_ns()
functions up to 2x faster by faster calling convention. Patch by Victor Stinner.gh-110894 [https://github.com/python/cpython/issues/110894]: Call loop exception handler for exceptions in
client_connected_cb
ofasyncio.start_server()
so that applications can handle it. Patch by Kumar Aditya.gh-111531 [https://github.com/python/cpython/issues/111531]: Fix reference leaks in
bind_class()
andbind_all()
methods oftkinter
widgets.gh-111246 [https://github.com/python/cpython/issues/111246]:
asyncio.loop.create_unix_server()
will now automatically remove the Unix socket when the server is closed.gh-111356 [https://github.com/python/cpython/issues/111356]: Added
io.text_encoding()
,io.DEFAULT_BUFFER_SIZE
, andio.IncrementalNewlineDecoder
toio.__all__
.gh-66425 [https://github.com/python/cpython/issues/66425]: Remove the code to set the REMOTE_HOST header from wsgiref module, as it is unreachable. This header is used for performance reasons, which is not necessary in the wsgiref module.
gh-111429 [https://github.com/python/cpython/issues/111429]: Speed up
pathlib.PurePath.relative_to()
andis_relative_to()
.gh-111342 [https://github.com/python/cpython/issues/111342]: Fixed typo in
math.sumprod()
.gh-68166 [https://github.com/python/cpython/issues/68166]: Remove mention of not supported "vsapi" element type in
tkinter.ttk.Style.element_create()
. Add tests forelement_create()
and otherttk.Style
methods. Add examples forelement_create()
in the documentation.gh-111388 [https://github.com/python/cpython/issues/111388]: Add
show_group
parameter totraceback.format_exception_only()
, which allows to formatExceptionGroup
instances.gh-79033 [https://github.com/python/cpython/issues/79033]: Another attempt at fixing
asyncio.Server.wait_closed()
. It now blocks until both conditions are true: the server is closed, and there are no more active connections. (This means that in some cases where in 3.12.0 this function would incorrectly have returned immediately, it will now block; in particular, when there are no active connections but the server hasn't been closed yet.)gh-111259 [https://github.com/python/cpython/issues/111259]: Optimize recursive wildcards in
pathlib
.gh-111295 [https://github.com/python/cpython/issues/111295]: Fix
time
not checking for errors when initializing.gh-111253 [https://github.com/python/cpython/issues/111253]: Add error checking during
_socket
module init.gh-111251 [https://github.com/python/cpython/issues/111251]: Fix
_blake2
not checking for errors when initializing.gh-111233 [https://github.com/python/cpython/issues/111233]: Fix
select
not checking for errors when initializing.gh-111230 [https://github.com/python/cpython/issues/111230]: Fix
ssl
not checking for errors when initializing.gh-111174 [https://github.com/python/cpython/issues/111174]: Fix crash in
io.BytesIO.getbuffer()
called repeatedly for empty BytesIO.gh-111187 [https://github.com/python/cpython/issues/111187]: Postpone removal version for locale.getdefaultlocale() to Python 3.15.
gh-111159 [https://github.com/python/cpython/issues/111159]: Fix
doctest
output comparison for exceptions with notes.gh-110910 [https://github.com/python/cpython/issues/110910]: Fix invalid state handling in
asyncio.TaskGroup
andasyncio.Timeout
. They now raise proper RuntimeError if they are improperly used and are left in consistent state after this.gh-111092 [https://github.com/python/cpython/issues/111092]: Make turtledemo run without default root enabled.
gh-110944 [https://github.com/python/cpython/issues/110944]: Support alias and convenience vars for
pdb
completiongh-110745 [https://github.com/python/cpython/issues/110745]: Added newline parameter to
pathlib.Path.read_text()
. Patch by Junya Okabe.gh-84583 [https://github.com/python/cpython/issues/84583]: Make
pdb
enter post-mortem mode even forSyntaxError
gh-80675 [https://github.com/python/cpython/issues/80675]: Set
f_trace_lines = True
on all frames uponpdb.set_trace()
gh-110771 [https://github.com/python/cpython/issues/110771]: Expose the setup and cleanup portions of
asyncio.run_forever()
as the standalone methodsasyncio.run_forever_setup()
andasyncio.run_forever_cleanup()
. This allows for tighter integration with GUI event loops.gh-110774 [https://github.com/python/cpython/issues/110774]: Support setting the
asyncio.Runner
loop_factory kwarg inunittest.IsolatedAsyncioTestCase
gh-110392 [https://github.com/python/cpython/issues/110392]: Fix
tty.setraw()
andtty.setcbreak()
: previously they returned partially modified list of the original tty attributes.tty.cfmakeraw()
andtty.cfmakecbreak()
now make a copy of the list of special characters before modifying it.gh-59013 [https://github.com/python/cpython/issues/59013]: Make line number of function breakpoint more precise in
pdb
gh-88434 [https://github.com/python/cpython/issues/88434]: Emit deprecation warning for non-integer numbers in
gettext
functions and methods that consider plural forms even if the translation was not found.gh-110395 [https://github.com/python/cpython/issues/110395]: Ensure that
select.kqueue()
objects correctly appear as closed in forked children, to prevent operations on an invalid file descriptor.gh-110196 [https://github.com/python/cpython/issues/110196]: Add
__reduce__
method toIPv6Address
in order to keepscope_id
gh-109747 [https://github.com/python/cpython/issues/109747]: Improve errors for unsupported lookbehind patterns. Now re.error is raised instead of OverflowError or RuntimeError for too large width of lookbehind pattern.
gh-109466 [https://github.com/python/cpython/issues/109466]: Add the
ipaddress.IPv4Address.ipv6_mapped
property, which returns the IPv4-mapped IPv6 address.gh-85098 [https://github.com/python/cpython/issues/85098]: Implement the CLI of the
symtable
module and improve the repr ofSymbol
.gh-108791 [https://github.com/python/cpython/issues/108791]: Improved error handling in
pdb
command line interface, making it produce more concise error messages.gh-105931 [https://github.com/python/cpython/issues/105931]: Change
compileall
to only strip the stripdir prefix from the full path recorded in the compiled.pyc
file, when the prefix matches the start of the full path in its entirety. When the prefix does not match, no stripping is performed and a warning to this effect is displayed.
Previously all path components of the stripdir prefix that matched the full path were removed, while those that did not match were left alone (including ones interspersed between matching components).
gh-107431 [https://github.com/python/cpython/issues/107431]: Make the
DictProxy
andListProxy
types inmultiprocessing.managers
Generic Alias Types for[]
use in typing contexts.gh-72904 [https://github.com/python/cpython/issues/72904]: Add
glob.translate()
. This function converts a pathname with shell-style wildcards to a regular expression.gh-90026 [https://github.com/python/cpython/issues/90026]: Define
USE_XATTRS
on Cygwin so that XATTR-related functions in theos
module become available.gh-90890 [https://github.com/python/cpython/issues/90890]: New methods
mailbox.Maildir.get_info()
,mailbox.Maildir.set_info()
,mailbox.Maildir.get_flags()
,mailbox.Maildir.set_flags()
,mailbox.Maildir.add_flag()
,mailbox.Maildir.remove_flag()
. These methods speed up accessing a message's info and/or flags and are useful when it is not necessary to access the message's contents, as when iterating over a Maildir to find messages with specific flags.gh-102956 [https://github.com/python/cpython/issues/102956]: Fix returning of empty byte strings after seek in zipfile module
gh-102895 [https://github.com/python/cpython/issues/102895]: Added a parameter
local_exit
forcode.interact()
to preventexit()
andquit
from closingsys.stdin
and raiseSystemExit
.gh-97928 [https://github.com/python/cpython/issues/97928]: Change the behavior of
tkinter.Text.count()
. It now always returns an integer if one or less counting options are specified. Previously it could return a single count as a 1-tuple, an integer (only if option"update"
was specified) orNone
if no items found. The result is now the same ifwantobjects
is set to0
.gh-96954 [https://github.com/python/cpython/issues/96954]: Switch the storage of the unicode codepoint names to use a different data-structure, a directed acyclic word graph [https://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton]. This makes the unicodedata shared library about 440 KiB smaller. Contributed by Carl Friedrich Bolz-Tereick using code from the PyPy project.
gh-73561 [https://github.com/python/cpython/issues/73561]: Omit the interface scope from an IPv6 address when used as Host header by
http.client
.gh-86826 [https://github.com/python/cpython/issues/86826]:
zipinfo
now supports the full range of values in the TZ string determined by RFC 8536 and detects all invalid formats. Both Python and C implementations now raise exceptions of the same type on invalid data.
测试
gh-111808 [https://github.com/python/cpython/issues/111808]: Make the default value of
test.support.infinite_recursion()
to be conditional based on whether optimizations were used when compiling the interpreter. This helps with platforms like WASI whose stack size is greatly restricted in debug builds.gh-110722 [https://github.com/python/cpython/issues/110722]: Gathering line coverage of standard libraries within the regression test suite is now precise, as well as much faster. Patch by Łukasz Langa.
gh-110367 [https://github.com/python/cpython/issues/110367]: Make regrtest
--verbose3
option compatible with--huntrleaks -jN
options. The./python -m test -j1 -R 3:3 --verbose3
command now works as expected. Patch by Victor Stinner.gh-111165 [https://github.com/python/cpython/issues/111165]: Remove no longer used functions
run_unittest()
andrun_doctest()
from thetest.support
module.gh-110932 [https://github.com/python/cpython/issues/110932]: Fix regrtest if the
SOURCE_DATE_EPOCH
environment variable is defined: use the variable value as the random seed. Patch by Victor Stinner.gh-110995 [https://github.com/python/cpython/issues/110995]: test_gdb: Fix detection of gdb built without Python scripting support. Patch by Victor Stinner.
gh-110918 [https://github.com/python/cpython/issues/110918]: Test case matching patterns specified by options
--match
,--ignore
,--matchfile
and--ignorefile
are now tested in the order of specification, and the last match determines whether the test case be run or ignored.gh-108747 [https://github.com/python/cpython/issues/108747]: Add unit test for
usercustomize
andsitecustomize
hooks fromsite
.
构建
gh-96954 [https://github.com/python/cpython/issues/96954]: Make
make regen-unicodedata
work for out-of-tree builds of CPython.gh-112088 [https://github.com/python/cpython/issues/112088]: Add
Tools/build/regen-configure.sh
script to regenerate theconfigure
with an Ubuntu container image. Thequay.io/tiran/cpython_autoconf:271
container image (tiran/cpython_autoconf [https://github.com/tiran/cpython_autoconf]) is no longer used. Patch by Victor Stinner.gh-111046 [https://github.com/python/cpython/issues/111046]: For wasi-threads, memory is now exported to fix compatibility issues with some wasm runtimes.
gh-110828 [https://github.com/python/cpython/issues/110828]: AIX 32bit needs
-latomic
to build the_testcapi
extension module.gh-85283 [https://github.com/python/cpython/issues/85283]: The
errno
,md5
,resource
,winsound
,_ctypes_test
,_multiprocessing.posixshmem
,_scproxy
,_stat
,_testimportmultiple
and_uuid
C extensions are now built with the limited C API. Patch by Victor Stinner.
Windows
gh-111856 [https://github.com/python/cpython/issues/111856]: Fixes
fstat()
on file systems that do not support file ID requests. This includes FAT32 and exFAT.gh-111293 [https://github.com/python/cpython/issues/111293]: Fix
os.DirEntry.inode
dropping higher 64 bits of a file id on some filesystems on Windows.gh-110913 [https://github.com/python/cpython/issues/110913]: WindowsConsoleIO now correctly chunks large buffers without splitting up UTF-8 sequences.
macOS
gh-59703 [https://github.com/python/cpython/issues/59703]: For macOS framework builds, in
getpath.c
use the systemdladdr
function to find the path to the shared library rather than depending on deprecated macOS APIs.gh-110950 [https://github.com/python/cpython/issues/110950]: Update macOS installer to include an upstream Tcl/Tk fix for the
Secure coding is not enabled for restorable state!
warning encountered in Tkinter on macOS 14 Sonoma.gh-111015 [https://github.com/python/cpython/issues/111015]: Ensure that IDLE.app and Python Launcher.app are installed with appropriate permissions on macOS builds.
gh-71383 [https://github.com/python/cpython/issues/71383]: Update macOS installer to include an upstream Tcl/Tk fix for the
ttk::ThemeChanged
error encountered in Tkinter.gh-92603 [https://github.com/python/cpython/issues/92603]: Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first
tkinter.Tk()
instance is destroyed.