更新日志
Python 下一版
发布日期: XXXX-XX-XX
库
gh-129646 [https://github.com/python/cpython/issues/129646]: 更新
locale
模块中的语言区域别名映射以匹配最新的 X Org 语言区域别名映射并支持 Glibc 2.41 中的新增语言区域。gh-128772 [https://github.com/python/cpython/issues/128772]: 针对
__module__
属性等于None
的方法修正pydoc
。gh-128657 [https://github.com/python/cpython/issues/128657]: Fix possible extra reference when using objects returned by
hashlib.sha256()
under free threading.
IDLE
- gh-129873 [https://github.com/python/cpython/issues/129873]: Simplify displaying the IDLE doc by only copying the text section of idle.html to idlelib/help.html. Patch by Stan Ulbrych.
核心与内置函数
gh-129732 [https://github.com/python/cpython/issues/129732]: 修复自由线程构建版
Pyqsbr_reserve
中的竞争问题。gh-129643 [https://github.com/python/cpython/issues/129643]: Fix thread safety of
PyList_Insert()
in free-threading builds.gh-129668 [https://github.com/python/cpython/issues/129668]: Fix race condition when raising
MemoryError
in the free threaded build.gh-129643 [https://github.com/python/cpython/issues/129643]: Fix thread safety of
PyList_SetItem()
in free-threading builds. Patch by Kumar Aditya.
C API
- gh-129533 [https://github.com/python/cpython/issues/129533]: Update
PyGC_Enable()
,PyGC_Disable()
,PyGC_IsEnabled()
to use atomic operation for threadsafety at free-threading build. Patch by Donghee Na.
构建
- gh-129660 [https://github.com/python/cpython/issues/129660]: Drop
test_embed
from PGO training, whose contribution in recent versions is considered to be ignorable.
Python 3.13.2 final
Release date: 2025-02-04
macOS
- gh-127592 [https://github.com/python/cpython/issues/127592]: 当最小 macOS 版本早于 10.12 时禁用统一 Apple System Log API。
Windows
- gh-127353 [https://github.com/python/cpython/issues/127353]: 允许在 Windows 上使用环境变量强制设置颜色输出。 由 Andrey Efremov 编写补丁。
工具/示例
gh-129248 [https://github.com/python/cpython/issues/129248]: iOS 测试运行器现在会从测试套件的每行输出中去除日志记录前缀。
gh-128152 [https://github.com/python/cpython/issues/128152]: 修正了 Argument Clinic 的 C 预处理器解析器试图解析 C 注释里的预处理器指令的程序错误。 由 Erlend Aasland 编写补丁。
测试
gh-127906 [https://github.com/python/cpython/issues/127906]: 在 test_cppext 中测试受限 C API。 由 Victor Stinner 编写补丁。
gh-127637 [https://github.com/python/cpython/issues/127637]: 增加针对
dis
命令行界面的测试。 由 Bénédikt Tran 编写补丁。gh-126925 [https://github.com/python/cpython/issues/126925]: 现在 iOS 测试结果在测试执行期间流式输出,且已弃用的 xcresulttool 不再被使用。
安全性
gh-105704 [https://github.com/python/cpython/issues/105704]: 当使用
urllib.parse.urlsplit()
和urllib.parse.urlparse()
时主机解析将不会拒绝包含方括号 ([
和]
) 的主机名。 根据 `RFC 3986 第 3.2.2 节 <https://www.rfc-editor.org/rfc/rfc3986#section-3.2.2>`__方括号仅适用于 IPv6 和 IPvFuture 主机。gh-127655 [https://github.com/python/cpython/issues/127655]: 修正了
asyncio.selector_events._SelectorSocketTransport
传输当使用asyncio.WriteTransport.writelines()
时不在缓冲区到达高水位时暂停为协议写入的问题。gh-126108 [https://github.com/python/cpython/issues/126108]: 修正了
PySys_AddWarnOptionUnicode()
中的一个可能的NULL
指针解引用。gh-80222 [https://github.com/python/cpython/issues/80222]: Fix bug in the folding of quoted strings when flattening an email message using a modern email policy. Previously when a quoted string was folded so that it spanned more than one line, the surrounding quotes and internal escapes would be omitted. This could theoretically be used to spoof header lines using a carefully constructed quoted string if the resulting rendered email was transmitted or reparsed.
gh-119511 [https://github.com/python/cpython/issues/119511]: Fix a potential denial of service in the
imaplib
module. When connecting to a malicious server, it could cause an arbitrary amount of memory to be allocated. On many systems this is harmless as unused virtual memory is only a mapping, but if this hit a virtual address size limit it could lead to aMemoryError
or other process crash. On unusual systems or builds where all allocated memory is touched and backed by actual ram or storage it could've consumed resources doing so until similarly crashing.
库
gh-129502 [https://github.com/python/cpython/issues/129502]: Unlikely errors in preparing arguments for
ctypes
callback are now handled in the same way as errors raised in the callback of in converting the result of the callback — usingsys.unraisablehook()
instead ofsys.excepthook()
and not settingsys.last_exc
and other variables.gh-129403 [https://github.com/python/cpython/issues/129403]: 修正了用于
asyncio.Barrier
和threading.Barrier
的ValueError
消息。gh-129409 [https://github.com/python/cpython/issues/129409]: 修复了
csv
模块中当写入大于 2GB 的数据字段时的整数溢出。gh-118761 [https://github.com/python/cpython/issues/118761]: 通过惰性导入
locale
和signal
提升了subprocess
的导入速度。 由 Taneli Hukkinen 编写补丁。gh-129346 [https://github.com/python/cpython/issues/129346]: 在
sqlite3
中,处理当创建用户自定义 SQL 函数时的内存不足问题。gh-129061 [https://github.com/python/cpython/issues/129061]: Fix FORCE_COLOR and NO_COLOR when empty strings. Patch by Hugo van Kemenade.
gh-128550 [https://github.com/python/cpython/issues/128550]: Removed an incorrect optimization relating to eager tasks in
asyncio.TaskGroup
that resulted in cancellations being missed.gh-128991 [https://github.com/python/cpython/issues/128991]: Release the enter frame reference within
bdb
callbackgh-128978 [https://github.com/python/cpython/issues/128978]: Fix a
NameError
insysconfig.expand_makefile_vars()
. Patch by Bénédikt Tran.gh-128961 [https://github.com/python/cpython/issues/128961]: Fix a crash when setting state on an exhausted
array.array
iterator.gh-128894 [https://github.com/python/cpython/issues/128894]: Fix
traceback.TracebackException._format_syntax_error
not to fail on exceptions with custom metadata.gh-128916 [https://github.com/python/cpython/issues/128916]: Do not attempt to set
SO_REUSEPORT
on sockets of address families other thanAF_INET
andAF_INET6
, as it is meaningless with these address families, and the call with fail with Linux kernel 6.12.9 and newer.gh-128679 [https://github.com/python/cpython/issues/128679]: Fix
tracemalloc.stop()
race condition. Fixtracemalloc
to support callingtracemalloc.stop()
in one thread, while another thread is tracing memory allocations. Patch by Victor Stinner.gh-128636 [https://github.com/python/cpython/issues/128636]: 修复当
os.environ
被无效值覆盖时的 PyREPL 错误。gh-128562 [https://github.com/python/cpython/issues/128562]: 修正了当控件类名称是以数字结尾时在生成的
tkinter
控件名称中可能出现的冲突。gh-128498 [https://github.com/python/cpython/issues/128498]: 颜色检测信息默认发往 stdout isatty 而非 stderr。 由 Hugo van Kemenade 编写补丁。
gh-128552 [https://github.com/python/cpython/issues/128552]: 修正了由于
asyncio.loop.create_task()
和asyncio.TaskGroup.create_task()
在其为主动型时持有对所创建任务的引用而导致的循环垃圾。gh-128479 [https://github.com/python/cpython/issues/128479]: Fix
asyncio.staggered.staggered_race()
leaking tasks and issuing an unhandled exception.gh-128400 [https://github.com/python/cpython/issues/128400]: 修复了在 自由线程 构建版上其他线程激活的情况下使用
faulthandler.dump_traceback()
时的崩溃问题。gh-88834 [https://github.com/python/cpython/issues/88834]: 统一了
typing.Union
和types.UnionType
的实例检查方式:现在Union
将针对其形参使用实例检查而不是子类检查。gh-128302 [https://github.com/python/cpython/issues/128302]: 修正了
xml.dom.xmlbuilder.DOMEntityResolver.resolveEntity()
,它是在 Python 3.0 过渡期中被破坏的。gh-128302 [https://github.com/python/cpython/issues/128302]: 允许
xml.dom.xmlbuilder.DOMParser.parse()
正确地处理仅设置了systemId
属性的xml.dom.xmlbuilder.DOMInputSource
实例。gh-112064 [https://github.com/python/cpython/issues/112064]: Fix incorrect handling of negative read sizes in
HTTPResponse.read
. Patch by Yury Manushkin.gh-58956 [https://github.com/python/cpython/issues/58956]: Fixed a frame reference leak in
bdb
.gh-128131 [https://github.com/python/cpython/issues/128131]: Completely support random access of uncompressed unencrypted readonly zip files obtained by
ZipFile.open
.gh-112328 [https://github.com/python/cpython/issues/112328]: 现在
enum.EnumDict
的使用不再依赖于私有 private API。gh-127975 [https://github.com/python/cpython/issues/127975]: Avoid reusing quote types in
ast.unparse()
if not needed.gh-128062 [https://github.com/python/cpython/issues/128062]: 将
turtledemo
菜单栏的字体恢复为默认值并在正确的位置上显示快捷键。gh-128014 [https://github.com/python/cpython/issues/128014]: 通过将
default=''
传给tkinter
方法wm_iconbitmap()
修复了重设默认窗口图标问题。gh-115514 [https://github.com/python/cpython/issues/115514]: Fix exceptions and incomplete writes after
asyncio._SelectorTransport
is closed before writes are completed.gh-41872 [https://github.com/python/cpython/issues/41872]: 修正了在
pydoc
中自文件中快速提取模块文档字符串的功能。 现在它支持具有单引用、转义序列、原始字符串字面值以及其他 Python 语法的文档字符串。gh-127060 [https://github.com/python/cpython/issues/127060]: 将 TERM 环境变量设为 "dumb" 以在 IDLE 中禁用彩色回溯信息,因为 IDLE 无法解读 ANSI 转义序列。 由 Victor Stinner 编写补丁。
gh-126742 [https://github.com/python/cpython/issues/126742]: 在
ctypes
和dbm.gnu
函数中分别修正了对 dlerror(3)) [https://manpages.debian.org/dlerror(3)] 和 gdbm_strerror) [https://manpages.debian.org/gdbm(3)] 所报告的本地化错误消息的支持。 由 Bénédikt Tran 编写补丁。gh-127873 [https://github.com/python/cpython/issues/127873]: When
-E
is set, only ignorePYTHON_COLORS
and notFORCE_COLOR
/NO_COLOR
/TERM
when colourising output. Patch by Hugo van Kemenade.gh-127870 [https://github.com/python/cpython/issues/127870]: 检测在 ctypes
asparameter_
处理中的递归调用。 由 Victor Stinner 编写补丁。gh-127847 [https://github.com/python/cpython/issues/127847]: 修复了在由
zipfile.ZipFile.open()
返回的未压缩、未加密的 zip 文件上执行交错定位和读取时的位置问题。gh-127732 [https://github.com/python/cpython/issues/127732]: 现在
platform
模块能正确地检测 Windows Server 2025。gh-126821 [https://github.com/python/cpython/issues/126821]: 在解释器配置期间 macOS 和 iOS app 现在能选择将 stdout 和 stderr 重定向到系统日志。
gh-93312 [https://github.com/python/cpython/issues/93312]: 包括
以获取os.PIDFD_NONBLOCK
常量。 由 Victor Stinner 编写补丁。gh-83662 [https://github.com/python/cpython/issues/83662]: 为
functools.partial()
的 Python 实现增加了缺失的__class_getitem__
方法,以使其与 C 版本相兼容。 这主要影响其他 Python 实现如 PyPy 和 GraalPy,因为 CPython 通常会使用相应函数的 C 实现。gh-127586 [https://github.com/python/cpython/issues/127586]: 现在当通过 spawn 或 forkserver 创建进程时
multiprocessing.pool.Pool
会正确地恢复父线程被阻塞的信号处理器。gh-98188 [https://github.com/python/cpython/issues/98188]: 修复了在
email.message.Message.get_payload()
中当 Content Transfer Encoding 机制包含末尾空格或额外冗余文本时数据无法被解码的问题。 由 Hui Liu 编写补丁。gh-127257 [https://github.com/python/cpython/issues/127257]: 在
ssl
中,OpenSSL 报告使用ERR_LIB_SYS
的系统调用失败现在将作为OSError
被引发。gh-127096 [https://github.com/python/cpython/issues/127096]: Do not recreate unnamed section on every read in
configparser.ConfigParser
. Patch by Andrey Efremov.gh-127196 [https://github.com/python/cpython/issues/127196]: 修复了在
_interpreters
模块中当具有无效编码格式的键的字典被传给某些函数时的崩溃问题。gh-126775 [https://github.com/python/cpython/issues/126775]: 使得
linecache.checkcache()
保证线程安全和 GC 重进入安全。gh-126332 [https://github.com/python/cpython/issues/126332]: Fix _pyrepl crash when entering a double CTRL-Z on an overflowing line.
gh-126225 [https://github.com/python/cpython/issues/126225]:
getopt
和optparse
不再被标记为已弃用。 存在合法的理由优先使用这些模块而不是argparse
,这些模块均没有从标准库中被移除的风险。 对于这三个模块,argparse
仍然是推荐的默认选择,除非optparse
模块文档的开头部分所提及的事项之一需要被纳入考量。gh-125553 [https://github.com/python/cpython/issues/125553]: Fix round-trip invariance for backslash continuations in
tokenize.untokenize()
.gh-123987 [https://github.com/python/cpython/issues/123987]: Fixed issue in NamespaceReader where a non-path item in a namespace path, such as a sentinel added by an editable installer, would break resource loading.
gh-123401 [https://github.com/python/cpython/issues/123401]: 现在
http.cookies
模块支持解释过时的 RFC 850 [https://datatracker.ietf.org/doc/html/rfc850.html] 日期格式,以符合 RFC 9110 [https://datatracker.ietf.org/doc/html/rfc9110.html] 的要求。 由 Nano Zheng 编写补丁。gh-122431 [https://github.com/python/cpython/issues/122431]: 现在当为
readline.append_history_file()
给出负值时将会引发ValueError
。gh-119257 [https://github.com/python/cpython/issues/119257]: Show tab completions menu below the current line, which results in less janky behaviour, and fixes a cursor movement bug. Patch by Daniel Hollas
文档
gh-125722 [https://github.com/python/cpython/issues/125722]: Require Sphinx 8.1.3 or later to build the Python documentation. Patch by Adam Turner.
gh-67206 [https://github.com/python/cpython/issues/67206]: 记录了
string.printable
在 POSIX 下的不可打印字符。 特别地,string.printable.isprintable()
将返回False
。 由 Bénédikt Tran 编写补丁。
核心与内置函数
gh-129345 [https://github.com/python/cpython/issues/129345]: Fix null pointer dereference in
syslog.openlog()
when an audit hook raises an exception.gh-129093 [https://github.com/python/cpython/issues/129093]: Fix fstrings such as
f'{expr=}'
sometimes not displaying the full expression when the expression contains!=
.gh-124363 [https://github.com/python/cpython/issues/124363]: Treat debug expressions in fstring as raw strings. Patch by Pablo Galindo
gh-128799 [https://github.com/python/cpython/issues/128799]: Add frame of
except*
to traceback when it wraps a naked exception.gh-128078 [https://github.com/python/cpython/issues/128078]: 修正了当附带默认的元组值使用
anext()
时导致的SystemError
。 由 Bénédikt Tran 编写补丁。gh-128717 [https://github.com/python/cpython/issues/128717]: 修复了在 free threaded 构建版上其他线程激活的情况下设置递归上限时的崩溃问题。
gh-128330 [https://github.com/python/cpython/issues/128330]: Restore terminal control characters on REPL exit.
gh-128079 [https://github.com/python/cpython/issues/128079]: 修复了一个由于
except*
不能正确地检查ExceptionGroup
的split()
函数的返回值,导致在某些情况下发生崩溃的程序错误。 现在当split()
返回无效对象时,except*
将引发一个TypeError
并原来所引发的ExceptionGroup
对象与其进行串连。gh-128030 [https://github.com/python/cpython/issues/128030]: 避免当从非模块对象导入不存在的符号时由于在非模块对象上调用
PyModule_GetFilenameObject
所导致的错误。gh-127903 [https://github.com/python/cpython/issues/127903]:
Objects/unicodeobject.c
: fix a crash on DEBUG builds incopycharacters
when there is nothing to copy.gh-127599 [https://github.com/python/cpython/issues/127599]: Fix statistics for increments of object reference counts (in particular, when a reference count was increased by more than 1 in a single operation).
gh-127651 [https://github.com/python/cpython/issues/127651]: When raising
ImportError
for missing symbols infrom
imports, use__file__
in the error message if__spec__.origin
is not a locationgh-127582 [https://github.com/python/cpython/issues/127582]: Fix non-thread-safe object resurrection when calling finalizers and watcher callbacks in the free threading build.
gh-127434 [https://github.com/python/cpython/issues/127434]: The iOS compiler shims can now accept arguments with spaces.
gh-127536 [https://github.com/python/cpython/issues/127536]: Add missing locks around some list assignment operations in the free threading build.
gh-126862 [https://github.com/python/cpython/issues/126862]: Fix a possible overflow when a class inherits from an absurd number of superclasses. Reported by Valery Fedorenko. Patch by Bénédikt Tran.
gh-127349 [https://github.com/python/cpython/issues/127349]: Fixed the error when resizing terminal in Python REPL. Patch by Semyon Moroz.
gh-126076 [https://github.com/python/cpython/issues/126076]: Relocated objects such as
tuple
,bytes
andstr
objects are properly tracked bytracemalloc
and its associated hooks. Patch by Pablo Galindo.
C API
- gh-127791 [https://github.com/python/cpython/issues/127791]: Fix loss of callbacks after more than one call to
PyUnstable_AtExit()
.
构建
gh-129539 [https://github.com/python/cpython/issues/129539]: Don't redefine
EX_OK
when the system has thesysexits.h
header.gh-128472 [https://github.com/python/cpython/issues/128472]: Skip BOLT optimization of functions using computed gotos, fixing errors on build with LLVM 19.
gh-123925 [https://github.com/python/cpython/issues/123925]: Fix building the
curses
module on platforms with libncurses but without libncursesw.gh-128321 [https://github.com/python/cpython/issues/128321]: Set
LIBS
instead ofLDFLAGS
when checking ifsqlite3
library functions are available. This fixes the ordering of linked libraries during checks, which was incorrect when using a statically linkedlibsqlite3
.gh-127865 [https://github.com/python/cpython/issues/127865]: Fix build failure on systems without thread-locals support.
Python 3.13.1 正式版
发布日期: 2024-12-03
macOS
- gh-124448 [https://github.com/python/cpython/issues/124448]: Update bundled Tcl/Tk in macOS installer to 8.6.15.
Windows
gh-126911 [https://github.com/python/cpython/issues/126911]: Update credits command output.
gh-118973 [https://github.com/python/cpython/issues/118973]: Ensures the experimental free-threaded install includes the
_tkinter
module. The optional Tcl/Tk component must also be installed in order for the module to work.gh-126497 [https://github.com/python/cpython/issues/126497]: Fixes venv failure due to missing redirector executables in experimental free-threaded installs.
gh-126074 [https://github.com/python/cpython/issues/126074]: Removed unnecessary DLLs from Windows embeddable package
gh-125315 [https://github.com/python/cpython/issues/125315]: Avoid crashing in
platform
due to slow WMI calls on some Windows machines.gh-126084 [https://github.com/python/cpython/issues/126084]: Fix venvwlauncher to launch pythonw instead of python so no extra console window is created.
gh-125842 [https://github.com/python/cpython/issues/125842]: Fix a
SystemError
whensys.exit()
is called with0xffffffff
on Windows.gh-125550 [https://github.com/python/cpython/issues/125550]: 开启 适用于Windows的Python启动器 对来自 Windows Store 的 Python 3.14 安装版的检测。
gh-124448 [https://github.com/python/cpython/issues/124448]: 将捆绑的 Tcl/Tk 更新至 8.6.15。
工具/示例
gh-126807 [https://github.com/python/cpython/issues/126807]: Fix extraction warnings in pygettext.py caused by mistaking function definitions for function calls.
gh-126167 [https://github.com/python/cpython/issues/126167]: The iOS testbed was modified so that it can be used by third-party projects for testing purposes.
测试
gh-126909 [https://github.com/python/cpython/issues/126909]: Fix test_os extended attribute tests to work on filesystems with 1 KiB xattr size limit.
gh-125041 [https://github.com/python/cpython/issues/125041]: Re-enable skipped tests for
zlib
on the s390x architecture: only skip checks of the compressed bytes, which can be different between zlib's software implementation and the hardware-accelerated implementation.gh-124295 [https://github.com/python/cpython/issues/124295]: Add translation tests to the
argparse
module.
安全性
gh-126623 [https://github.com/python/cpython/issues/126623]: Upgrade libexpat to 2.6.4
gh-125140 [https://github.com/python/cpython/issues/125140]: Remove the current directory from
sys.path
when using PyREPL.gh-122792 [https://github.com/python/cpython/issues/122792]: Changed IPv4-mapped
ipaddress.IPv6Address
to consistently use the mapped IPv4 address value for deciding properties. Properties which have their behavior fixed areis_multicast
,is_reserved
,is_link_local
,is_global
, andis_unspecified
.
库
gh-127321 [https://github.com/python/cpython/issues/127321]:
pdb.set_trace()
will not stop at an opcode that does not have an associated line number anymore.gh-127303 [https://github.com/python/cpython/issues/127303]: Publicly expose
EXACT_TOKEN_TYPES
intoken.__all__
.gh-123967 [https://github.com/python/cpython/issues/123967]: Fix faulthandler for trampoline frames. If the topmost frame is a trampoline frame, skip it. Patch by Victor Stinner.
gh-127182 [https://github.com/python/cpython/issues/127182]: Fix
io.StringIO.__setstate__()
crash, whenNone
was passed as the first value.gh-127217 [https://github.com/python/cpython/issues/127217]: Fix
urllib.request.pathname2url()
for paths starting with multiple slashes on Posix.gh-127035 [https://github.com/python/cpython/issues/127035]: Fix
shutil.which
on Windows. Now it looks at direct match if and only if the command ends with a PATHEXT extension or X_OK is not in mode. Support extensionless files if "." is in PATHEXT. Support PATHEXT extensions that end with a dot.gh-122273 [https://github.com/python/cpython/issues/122273]: Support PyREPL history on Windows. Patch by devdanzin and Victor Stinner.
gh-127078 [https://github.com/python/cpython/issues/127078]: Fix issue where
urllib.request.url2pathname()
failed to discard an extra slash before a UNC drive in the URL path on Windows.gh-126766 [https://github.com/python/cpython/issues/126766]: Fix issue where
urllib.request.url2pathname()
failed to discard any 'localhost' authority present in the URL.gh-127065 [https://github.com/python/cpython/issues/127065]: Fix crash when calling a
operator.methodcaller()
instance from multiple threads in the free threading build.gh-126997 [https://github.com/python/cpython/issues/126997]: Fix support of STRING and GLOBAL opcodes with nonASCII arguments in
pickletools
.pickletools.dis()
now outputs nonASCII bytes in STRING, BINSTRING and SHORT_BINSTRING arguments as escaped (\xXX
).gh-126316 [https://github.com/python/cpython/issues/126316]:
grp
: Makegrp.getgrall()
threadsafe by adding a mutex. Patch by Victor Stinner.gh-126618 [https://github.com/python/cpython/issues/126618]: Fix the representation of
itertools.count
objects when the count value issys.maxsize
.gh-85168 [https://github.com/python/cpython/issues/85168]: Fix issue where
urllib.request.url2pathname()
andpathname2url()
always used UTF-8 when quoting and unquoting file URIs. They now use the filesystem encoding and error handler.gh-67877 [https://github.com/python/cpython/issues/67877]: Fix memory leaks when
regular expression
matching terminates abruptly, either because of a signal or because memory allocation fails.gh-126789 [https://github.com/python/cpython/issues/126789]: Fixed the values of
sysconfig.getconfigvars()
,sysconfig.get_paths()
, and their siblings when thesite
initialization happens aftersysconfig
has built a cache forsysconfig.getconfigvars()
.gh-126188 [https://github.com/python/cpython/issues/126188]: Update bundled pip to 24.3.1
gh-126780 [https://github.com/python/cpython/issues/126780]: Fix
os.path.normpath()
for drive-relative paths on Windows.gh-126766 [https://github.com/python/cpython/issues/126766]: Fix issue where
urllib.request.url2pathname()
failed to discard two leading slashes introducing an empty authority section.gh-126727 [https://github.com/python/cpython/issues/126727]:
locale.nl_langinfo(locale.ERA)
now returns multiple era description segments separated by semicolons. Previously it only returned the first segment on platforms with Glibc.gh-126699 [https://github.com/python/cpython/issues/126699]: Allow
collections.abc.AsyncIterator
to be a base for Protocols.gh-126654 [https://github.com/python/cpython/issues/126654]: Fix crash when non-dict was passed to several functions in
_interpreters
module.gh-104745 [https://github.com/python/cpython/issues/104745]: Limit starting a patcher (from
unittest.mock.patch()
orunittest.mock.patch.object()
) more than once without stopping itgh-126595 [https://github.com/python/cpython/issues/126595]: Fix a crash when instantiating
itertools.count
with an initial count ofsys.maxsize
on debug builds. Patch by Bénédikt Tran.gh-120423 [https://github.com/python/cpython/issues/120423]: Fix issue where
urllib.request.pathname2url()
mishandled Windows paths with embedded forward slashes.gh-126565 [https://github.com/python/cpython/issues/126565]: Improve performances of
zipfile.Path.open()
for non-reading modes.gh-126505 [https://github.com/python/cpython/issues/126505]: Fix bugs in compiling case-insensitive
regular expressions
with character classes containing non-BMP characters: uppercase non-BMP character did was ignored and the ASCII flag was ignored when matching a character range whose upper bound is beyond the BMP region.gh-117378 [https://github.com/python/cpython/issues/117378]: Fixed the
multiprocessing
"forkserver"
start method forkserver process to correctly inherit the parent'ssys.path
during the importing ofmultiprocessing.set_forkserver_preload()
modules in the same manner assys.path
is configured in workers before executing work items.
This bug caused some forkserver module preloading to silently fail to preload. This manifested as a performance degration in child processes when the sys.path
was required due to additional repeated work in every worker.
It could also have a side effect of ""
remaining in sys.path
during forkserver preload imports instead of the absolute path from os.getcwd()
at multiprocessing import time used in the worker sys.path
.
The sys.path
differences between phases in the child process could potentially have caused preload to import incorrect things from the wrong location. We are unaware of that actually having happened in practice.
gh-125679 [https://github.com/python/cpython/issues/125679]: The
multiprocessing.Lock
andmultiprocessing.RLock
repr
values no longer say "unknown" on macOS.gh-126476 [https://github.com/python/cpython/issues/126476]: Raise
calendar.IllegalMonthError
(now a subclass ofIndexError
) forcalendar.month()
when the input month is not correct.gh-126489 [https://github.com/python/cpython/issues/126489]: The Python implementation of
pickle
no longer callspickle.Pickler.persistent_id()
for the result ofpersistent_id()
.gh-126313 [https://github.com/python/cpython/issues/126313]: Fix an issue in
curses.napms()
whencurses.initscr()
has not yet been called. Patch by Bénédikt Tran.gh-126303 [https://github.com/python/cpython/issues/126303]: Fix pickling and copying of
os.sched_param
objects.gh-126138 [https://github.com/python/cpython/issues/126138]: Fix a use-after-free crash on
asyncio.Task
objects whose underlying coroutine yields an object that implements an evil__getattribute__()
. Patch by Nico Posada.gh-126220 [https://github.com/python/cpython/issues/126220]: Fix crash in
cProfile.Profile
and_lsprof.Profiler
when their callbacks were directly called with 0 arguments.gh-126212 [https://github.com/python/cpython/issues/126212]: Fix issue where
urllib.request.pathname2url()
andurl2pathname()
removed slashes from Windows DOS drive paths and URLs.gh-126223 [https://github.com/python/cpython/issues/126223]: Raise a
UnicodeEncodeError
instead of aSystemError
upon calling_interpreters.create()
with an invalid Unicode character.gh-126205 [https://github.com/python/cpython/issues/126205]: Fix issue where
urllib.request.pathname2url()
generated URLs beginning with four slashes (rather than two) when given a Windows UNC path.gh-126105 [https://github.com/python/cpython/issues/126105]: Fix a crash in
ast
when theast.AST._fields
attribute is deleted.gh-126106 [https://github.com/python/cpython/issues/126106]: Fixes a possible
NULL
pointer dereference inssl
.gh-126080 [https://github.com/python/cpython/issues/126080]: Fix a use-after-free crash on
asyncio.Task
objects for which the underlying event loop implements an evil__getattribute__()
. Reported by Nico-Posada. Patch by Bénédikt Tran.gh-126083 [https://github.com/python/cpython/issues/126083]: Fixed a reference leak in
asyncio.Task
objects when reinitializing the same object with a non-None
context. Patch by Nico Posada.gh-125984 [https://github.com/python/cpython/issues/125984]: Fix use-after-free crashes on
asyncio.Future
objects for which the underlying event loop implements an evil__getattribute__()
. Reported by Nico-Posada. Patch by Bénédikt Tran.gh-125969 [https://github.com/python/cpython/issues/125969]: Fix an out-of-bounds crash when an evil
asyncio.loop.call_soon()
mutates the length of the internal callbacks list. Patch by Bénédikt Tran.gh-125966 [https://github.com/python/cpython/issues/125966]: Fix a use-after-free crash in
asyncio.Future.remove_done_callback()
. Patch by Bénédikt Tran.gh-125789 [https://github.com/python/cpython/issues/125789]: Fix possible crash when mutating list of callbacks returned by
asyncio.Future._callbacks
. It now always returns a new copy in C implementation_asyncio
. Patch by Kumar Aditya.gh-124452 [https://github.com/python/cpython/issues/124452]: Fix an issue in
email.policy.EmailPolicy.header_source_parse()
andemail.policy.Compat32.header_source_parse()
that introduced spurious leading whitespaces into header values when the header includes a newline character after the header name delimiter (:
) and before the value.gh-125884 [https://github.com/python/cpython/issues/125884]: Fixed the bug for
pdb
where it can't set breakpoints on functions with certain annotations.gh-125355 [https://github.com/python/cpython/issues/125355]: Fix several bugs in
argparse.ArgumentParser.parse_intermixed_args()
.The parser no longer changes temporarily during parsing.
Default values are not processed twice.
Required mutually exclusive groups containing positional arguments are now supported.
The missing arguments report now includes the names of all required optional and positional arguments.
Unknown options can be intermixed with positional arguments in parse_known_intermixed_args().
gh-125666 [https://github.com/python/cpython/issues/125666]: Avoid the exiting the interpreter if a null byte is given as input in the new REPL.
gh-125710 [https://github.com/python/cpython/issues/125710]: [Enum] fix hashable<->nonhashable comparisons for member values
gh-125631 [https://github.com/python/cpython/issues/125631]: Restore ability to set
persistent_id
andpersistent_load
attributes of instances of thePickler
andUnpickler
classes in thepickle
module.gh-125378 [https://github.com/python/cpython/issues/125378]: Fixed the bug in
pdb
where after a multiline command, an empty line repeats the first line of the multiline command, instead of the full command.gh-125682 [https://github.com/python/cpython/issues/125682]: Reject nonASCII digits in the Python implementation of
json.loads()
conforming to the JSON specification.gh-125660 [https://github.com/python/cpython/issues/125660]: Reject invalid unicode escapes for Python implementation of
json.loads()
.gh-125259 [https://github.com/python/cpython/issues/125259]: Fix the notes removal logic for errors thrown in enum initialization.
gh-125590 [https://github.com/python/cpython/issues/125590]: Allow
FrameLocalsProxy
to delete and pop if the key is not a fast variable.gh-125519 [https://github.com/python/cpython/issues/125519]: Improve traceback if
importlib.reload()
is called with an object that is not a module. Patch by Alex Waygood.gh-125451 [https://github.com/python/cpython/issues/125451]: Fix deadlock when
concurrent.futures.ProcessPoolExecutor
shuts down concurrently with an error when feeding a job to a worker process.gh-125422 [https://github.com/python/cpython/issues/125422]: Fixed the bug where
pdb
andbdb
can step into the bottom caller frame.gh-100141 [https://github.com/python/cpython/issues/100141]: Fixed the bug where
pdb
will be stuck in an infinite loop when debugging an empty file.gh-125115 [https://github.com/python/cpython/issues/125115]: Fixed a bug in
pdb
where arguments starting with-
can't be passed to the debugged script.gh-53203 [https://github.com/python/cpython/issues/53203]: Fix
time.strptime()
for%c
,%x
and%X
formats in many locales that use nonASCII digits, like Persian, Burmese, Odia and Shan.gh-125398 [https://github.com/python/cpython/issues/125398]: Fix the conversion of the
VIRTUAL_ENV
path in the activate script invenv
when running in Git Bash for Windows.gh-125316 [https://github.com/python/cpython/issues/125316]: Fix using
functools.partial()
asenum.Enum
member. A FutureWarning with suggestion to useenum.member()
is now emitted when thepartial
instance is used as an enum member.gh-125245 [https://github.com/python/cpython/issues/125245]: Fix race condition when importing
collections.abc
, which could incorrectly return an empty module.gh-125243 [https://github.com/python/cpython/issues/125243]: Fix data race when creating
zoneinfo.ZoneInfo
objects in the free threading build.gh-125254 [https://github.com/python/cpython/issues/125254]: Fix a bug where ArgumentError includes the incorrect ambiguous option in
argparse
.gh-125235 [https://github.com/python/cpython/issues/125235]: Keep
tkinter
TCL paths in venv pointing to base installation on Windows.gh-61011 [https://github.com/python/cpython/issues/61011]: Fix inheritance of nested mutually exclusive groups from parent parser in
argparse.ArgumentParser
. Previously, all nested mutually exclusive groups lost their connection to the group containing them and were displayed as belonging directly to the parser.gh-52551 [https://github.com/python/cpython/issues/52551]: Fix encoding issues in
time.strftime()
, thestrftime()
method of thedatetime
classesdatetime
,date
andtime
and formatting of these classes. Characters not encodable in the current locale are now acceptable in the format string. Surrogate pairs and sequence of surrogatescape-encoded bytes are no longer recombinated. Embedded null character no longer terminates the format string.gh-125118 [https://github.com/python/cpython/issues/125118]: Don't copy arbitrary values to _Bool in the
struct
module.gh-125069 [https://github.com/python/cpython/issues/125069]: Fix an issue where providing a
pathlib.PurePath
object as an initializer argument to a secondPurePath
object with a differentparser
resulted in arguments to the former object's initializer being joined by the latter object's parser.gh-125096 [https://github.com/python/cpython/issues/125096]: If the
PYTHON_BASIC_REPL
environment variable is set, thesite
module no longer imports the_pyrepl
module. Moreover, thesite
module now respects-E
and-I
command line options: ignorePYTHON_BASIC_REPL
in this case. Patch by Victor Stinner.gh-124969 [https://github.com/python/cpython/issues/124969]: Fix
locale.nl_langinfo(locale.ALT_DIGITS)
on platforms with glibc. Now it returns a string consisting of up to 100 semicolon-separated symbols (an empty string in most locales) on all Posix platforms. Previously it only returned the first symbol or an empty string.gh-124960 [https://github.com/python/cpython/issues/124960]: Fix support for the
barryasFLUFL
future flag in the new REPL.gh-124984 [https://github.com/python/cpython/issues/124984]: Fixed thread safety in
ssl
in the free-threaded build. OpenSSL operations are now protected by a perobject lock.gh-124958 [https://github.com/python/cpython/issues/124958]: Fix refcycles in exceptions raised from
asyncio.TaskGroup
and the python implementation ofasyncio.Future
gh-53203 [https://github.com/python/cpython/issues/53203]: Fix
time.strptime()
for%c
and%x
formats in many locales: Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish, Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol, Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi, Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese.gh-124917 [https://github.com/python/cpython/issues/124917]: Allow calling
os.path.exists()
andos.path.lexists()
with keyword arguments on Windows. Fixes a regression in 3.13.0.gh-124653 [https://github.com/python/cpython/issues/124653]: Fix detection of the minimal Queue API needed by the
logging
module. Patch by Bénédikt Tran.gh-124858 [https://github.com/python/cpython/issues/124858]: Fix reference cycles left in tracebacks in
asyncio.open_connection()
when used withhappy_eyeballs_delay
gh-124390 [https://github.com/python/cpython/issues/124390]: Fixed
AssertionError
when usingasyncio.staggered.staggered_race()
withasyncio.eager_task_factory
.gh-124651 [https://github.com/python/cpython/issues/124651]: Properly quote template strings in
venv
activation scripts.gh-116850 [https://github.com/python/cpython/issues/116850]: Fix
argparse
for namespaces with not directly writable dict (e.g. classes).gh-58573 [https://github.com/python/cpython/issues/58573]: Fix conflicts between abbreviated long options in the parent parser and subparsers in
argparse
.gh-124594 [https://github.com/python/cpython/issues/124594]: All
asyncio
REPL prompts run in the samecontext
. Contributed by Bartosz Sławecki.gh-61181 [https://github.com/python/cpython/issues/61181]: Fix support of choices with string value in
argparse
. Substrings of the specified string no longer considered valid values.gh-80259 [https://github.com/python/cpython/issues/80259]: Fix
argparse
support of positional arguments withnargs='?'
,default=argparse.SUPPRESS
and specifiedtype
.gh-120378 [https://github.com/python/cpython/issues/120378]: Fix a crash related to an integer overflow in
curses.resizeterm()
andcurses.resize_term()
.gh-123884 [https://github.com/python/cpython/issues/123884]: Fixed bug in itertools.tee() handling of other tee inputs (a tee in a tee). The output now has the promised n independent new iterators. Formerly, the first iterator was identical (not independent) to the input iterator. This would sometimes give surprising results.
gh-58956 [https://github.com/python/cpython/issues/58956]: Fixed a bug in
pdb
where sometimes the breakpoint won't trigger if it was set on a function which is already in the call stack.gh-124345 [https://github.com/python/cpython/issues/124345]:
argparse
vim supports abbreviated single-dash long options separated by=
from its value.gh-104860 [https://github.com/python/cpython/issues/104860]: Fix disallowing abbreviation of single-dash long options in
argparse
withallow_abbrev=False
.gh-63143 [https://github.com/python/cpython/issues/63143]: Fix parsing mutually exclusive arguments in
argparse
. Arguments with the value identical to the default value (e.g. booleans, small integers, empty or 1-character strings) are no longer considered "not present".gh-72795 [https://github.com/python/cpython/issues/72795]: Positional arguments with nargs equal to
'*'
orargparse.REMAINDER
are no longer required. This allows to use positional argument withnargs='*'
and withoutdefault
in mutually exclusive group and improves error message about required arguments.gh-59317 [https://github.com/python/cpython/issues/59317]: Fix parsing positional argument with nargs equal to
'?'
or'*'
if it is preceded by an option and another positional argument.gh-53780 [https://github.com/python/cpython/issues/53780]:
argparse
now ignores the first"--"
(double dash) between an option and command.gh-124217 [https://github.com/python/cpython/issues/124217]: Add RFC 9637 reserved IPv6 block
3fff::/20
inipaddress
module.gh-81691 [https://github.com/python/cpython/issues/81691]: Fix handling of multiple
"--"
(double dashes) inargparse
. Only the first one has now been removed, all subsequent ones are now taken literally.gh-123978 [https://github.com/python/cpython/issues/123978]: Remove broken
time.thread_time()
andtime.thread_time_ns()
on NetBSD.gh-124008 [https://github.com/python/cpython/issues/124008]: Fix possible crash (in debug build), incorrect output or returning incorrect value from raw binary
write()
when writing to console on Windows.gh-123935 [https://github.com/python/cpython/issues/123935]: Fix parent slots detection for dataclasses that inherit from classes with
__dictoffset__
.gh-122765 [https://github.com/python/cpython/issues/122765]: Fix unbalanced quote errors occurring when activate.csh in
venv
was sourced with a custom prompt containing unpaired quotes or newlines.gh-123370 [https://github.com/python/cpython/issues/123370]: Fix the canvas not clearing after running turtledemo clock.
gh-116810 [https://github.com/python/cpython/issues/116810]: Resolve a memory leak introduced in CPython 3.10's
ssl
when thessl.SSLSocket.session
property was accessed. Speeds up read and write access to said property by no longer unnecessarily cloning session objects via serialization.gh-120754 [https://github.com/python/cpython/issues/120754]: Update unbounded
read
calls inzipfile
to specify an explicitsize
putting a limit on how much data they may read. This also updates handling around ZIP max comment size to match the standard instead of reading comments that are one byte too long.gh-70764 [https://github.com/python/cpython/issues/70764]: Fixed an issue where
inspect.getclosurevars()
would incorrectly classify an attribute name as a global variable when the name exists both as an attribute name and a global variable.gh-118289 [https://github.com/python/cpython/issues/118289]:
posixpath.realpath()
now raisesNotADirectoryError
when strict mode is enabled and a non-directory path with a trailing slash is supplied.gh-119826 [https://github.com/python/cpython/issues/119826]: Always return an absolute path for
os.path.abspath()
on Windows.gh-117766 [https://github.com/python/cpython/issues/117766]: Always use
str()
to printchoices
inargparse
.gh-101955 [https://github.com/python/cpython/issues/101955]: Fix SystemError when match regular expression pattern containing some combination of possessive quantifier, alternative and capture group.
gh-88110 [https://github.com/python/cpython/issues/88110]: Fixed
multiprocessing.Process
reporting a.exitcode
of 1 even on success when using the"fork"
start method while using aconcurrent.futures.ThreadPoolExecutor
.gh-71936 [https://github.com/python/cpython/issues/71936]: Fix a race condition in
multiprocessing.pool.Pool
.bpo-46128 [https://bugs.python.org/issue?@action=redirect&bpo=46128]: Strip
unittest.IsolatedAsyncioTestCase
stack frames from reported stacktraces.bpo-14074 [https://bugs.python.org/issue?@action=redirect&bpo=14074]: Fix
argparse
metavar processing to allow positional arguments to have a tuple metavar.
IDLE
- gh-122392 [https://github.com/python/cpython/issues/122392]: Increase currently inadequate vertical spacing for the IDLE browsers (path, module, and stack) on high-resolution monitors.
文档
gh-126622 [https://github.com/python/cpython/issues/126622]: Added stub pages for removed modules explaining their removal, where to find replacements, and linking to the last Python version that supported them. Contributed by Ned Batchelder.
gh-125277 [https://github.com/python/cpython/issues/125277]: Require Sphinx 7.2.6 or later to build the Python documentation. Patch by Adam Turner.
gh-124872 [https://github.com/python/cpython/issues/124872]: Added definitions for context, current context, and context management protocol, updated related definitions to be consistent, and expanded the documentation for
contextvars.Context
.gh-125018 [https://github.com/python/cpython/issues/125018]: The
importlib.metadata
documentation now includes semantic cross-reference targets for the significant documented APIs. This means intersphinx references likeimportlib.metadata.version()
will now work as expected.gh-70870 [https://github.com/python/cpython/issues/70870]: Clarified the dual usage of the term "free variable" (both the formal meaning of any reference to names defined outside the local scope, and the narrower pragmatic meaning of nonlocal variables named in
co_freevars
).gh-121277 [https://github.com/python/cpython/issues/121277]: Writers of CPython's documentation can now use
next
as the version for theversionchanged
,versionadded
,deprecated
directives.gh-60712 [https://github.com/python/cpython/issues/60712]: Include the
object
type in the lists of documented types. Change by Furkan Onder and Martin Panter.bpo-34008 [https://bugs.python.org/issue?@action=redirect&bpo=34008]: The
Py_Main()
documentation moved from the "Very High Level API" section to the "Initialization and Finalization" section.
Also make it explicit that we expect Py_Main
to typically be called instead of Py_Initialize
rather than after it (since Py_Main
makes its own call to Py_Initialize
). Document that calling both is supported but is version dependent on which settings will be applied correctly.
核心与内置函数
gh-113841 [https://github.com/python/cpython/issues/113841]: Fix possible undefined behavior division by zero in
complex
'sPyc_pow()
.gh-127020 [https://github.com/python/cpython/issues/127020]: Fix a crash in the free threading build when
PyCode_GetCode()
,PyCode_GetVarnames()
,PyCode_GetCellvars()
, orPyCode_GetFreevars()
were called from multiple threads at the same time.gh-126980 [https://github.com/python/cpython/issues/126980]: Fix
__buffer__()
ofbytearray
crashing whenREAD
orWRITE
are passed as flags.gh-126881 [https://github.com/python/cpython/issues/126881]: Fix crash in finalization of dtoa state. Patch by Kumar Aditya.
gh-126341 [https://github.com/python/cpython/issues/126341]: Now
ValueError
is raised instead ofSystemError
when trying to iterate over a releasedmemoryview
object.gh-126688 [https://github.com/python/cpython/issues/126688]: Fix a crash when calling
os.fork()
on some operating systems, including SerenityOS.gh-126066 [https://github.com/python/cpython/issues/126066]: Fix
importlib
to not write an incomplete .pyc files when a ulimit or some other operating system mechanism is preventing the write to go through fully.gh-126312 [https://github.com/python/cpython/issues/126312]: Fix crash during garbage collection on an object frozen by
gc.freeze()
on the free-threaded build.gh-126139 [https://github.com/python/cpython/issues/126139]: Provide better error location when attempting to use a future statement with an unknown future feature.
gh-126018 [https://github.com/python/cpython/issues/126018]: Fix a crash in
sys.audit()
when passing a non-string as first argument and Python was compiled in debug mode.gh-125942 [https://github.com/python/cpython/issues/125942]: On Android, the
errors
setting ofsys.stdout
was changed fromsurrogateescape
tobackslashreplace
.gh-125859 [https://github.com/python/cpython/issues/125859]: Fix a crash in the free threading build when
gc.get_objects()
orgc.get_referrers()
is called during an in-progress garbage collection.gh-125703 [https://github.com/python/cpython/issues/125703]: Correctly honour
tracemalloc
hooks in specializedPy_DECREF
paths. Patch by Pablo Galindogh-125593 [https://github.com/python/cpython/issues/125593]: Use color to highlight error locations in traceback from exception group
gh-125444 [https://github.com/python/cpython/issues/125444]: Fix illegal instruction for older Arm architectures. Patch by Diego Russo, testing by Ross Burton.
gh-124375 [https://github.com/python/cpython/issues/124375]: Fix a crash in the free threading build when the GC runs concurrently with a new thread starting.
gh-125221 [https://github.com/python/cpython/issues/125221]: Fix possible race condition when calling
__reduce_ex__()
for the first time in the free threading build.gh-125038 [https://github.com/python/cpython/issues/125038]: Fix crash when iterating over a generator expression after direct changes on
gi_frame.f_locals
. Patch by Mikhail Efimov.gh-123378 [https://github.com/python/cpython/issues/123378]: Fix a crash in the
__str__()
method ofUnicodeError
objects when theUnicodeError.start
andUnicodeError.end
values are invalid or out-of-range. Patch by Bénédikt Tran.gh-116510 [https://github.com/python/cpython/issues/116510]: Fix a crash caused by immortal interned strings being shared between subinterpreters that use basic single-phase init. In that case, the string can be used by an interpreter that outlives the interpreter that created and interned it. For interpreters that share obmalloc state, also share the interned dict with the main interpreter.
gh-122878 [https://github.com/python/cpython/issues/122878]: Use the
pager
binary, if available (e.g. on Debian and derivatives), to display REPLhelp()
.gh-124188 [https://github.com/python/cpython/issues/124188]: Fix reading and decoding a line from the source file witn non-UTF-8 encoding for syntax errors raised in the compiler.
gh-123930 [https://github.com/python/cpython/issues/123930]: Improve the error message when a script shadowing a module from the standard library causes
ImportError
to be raised during a "from" import. Similarly, improve the error message when a script shadowing a third party module attempts to "from" import an attribute from that third party module while still initialising.gh-122907 [https://github.com/python/cpython/issues/122907]: Building with
HAVE_DYNAMIC_LOADING
now works as well as it did in 3.12. Existing deficiences will be addressed separately. (See https://github.com/python/cpython/issues/122950.)gh-118950 [https://github.com/python/cpython/issues/118950]: Fix bug where SSLProtocol.connection_lost wasn't getting called when OSError was thrown on writing to socket.
gh-113570 [https://github.com/python/cpython/issues/113570]: Fixed a bug in
reprlib.repr
where it incorrectly called the repr method on shadowed Python builtin types.gh-109746 [https://github.com/python/cpython/issues/109746]: If
thread.startnew_thread()
fails to start a new thread, it deletes its state from interpreter and thus avoids its repeated cleanup on finalization.
C API
gh-126554 [https://github.com/python/cpython/issues/126554]: Fix error handling in
ctypes.CDLL
objects which could result in a crash in rare situations.gh-125608 [https://github.com/python/cpython/issues/125608]: Fix a bug where dictionary watchers (e.g.,
PyDict_Watch()
) on an object's attribute dictionary (__dict__
) were not triggered when the object's attributes were modified.bpo-34008 [https://bugs.python.org/issue?@action=redirect&bpo=34008]: Added
Py_IsInitialized
to the list of APIs that are safe to call before the interpreter is initialized, and updated the embedding tests to cover it.
构建
gh-123877 [https://github.com/python/cpython/issues/123877]: Set
wasm32-wasip1
as the WASI target. The oldwasm32-wasi
target is deprecated so it can be used for an eventual WASI 1.0.gh-89640 [https://github.com/python/cpython/issues/89640]: Hardcode float word ordering as little endian on WASM.
gh-125940 [https://github.com/python/cpython/issues/125940]: The Android build now supports 16 KB page sizes [https://developer.android.com/guide/practices/pagesizes].
gh-89640 [https://github.com/python/cpython/issues/89640]: Improve detection of float word ordering on Linux when link-time optimizations are enabled.
gh-125269 [https://github.com/python/cpython/issues/125269]: Fix detection of whether
-latomic
is needed when cross-compiling CPython using the configure script.gh-121634 [https://github.com/python/cpython/issues/121634]: Allow for specifying the target compile triple for WASI.
gh-122578 [https://github.com/python/cpython/issues/122578]: Use WASI SDK 24 for testing.
gh-115382 [https://github.com/python/cpython/issues/115382]: Fix cross compile failures when the host and target SOABIs match.
Python 3.13.0 final
Release date: 2024-10-07
核心与内置函数
gh-125008 [https://github.com/python/cpython/issues/125008]: Fix
tokenize.untokenize()
producing invalid syntax for double braces preceded by certain escape characters.gh-124871 [https://github.com/python/cpython/issues/124871]: Fix compiler bug (in some versions of 3.13) where an assertion fails during reachability analysis.
Python 3.13.0 release candidate 3
Release date: 2024-10-01
macOS
- gh-123797 [https://github.com/python/cpython/issues/123797]: Check for runtime availability of
ptsname_r
function on macos.
Windows
gh-124609 [https://github.com/python/cpython/issues/124609]: Fix
PyThreadId
for Windows builds using MinGW. Patch by Tony Roberts.gh-124254 [https://github.com/python/cpython/issues/124254]: Ensures experimental free-threaded binaries remain installed when updating.
gh-123915 [https://github.com/python/cpython/issues/123915]: Ensure that
Tools\msi\buildrelease.bat
uses different directories for AMD64 and ARM64 builds.
测试
- gh-124378 [https://github.com/python/cpython/issues/124378]: Updated
test_ttk
to pass with Tcl/Tk 8.6.15.
库
gh-124538 [https://github.com/python/cpython/issues/124538]: Fixed crash when using
gc.get_referents()
on a capsule object.gh-124498 [https://github.com/python/cpython/issues/124498]: Fix
typing.TypeAliasType
not to be generic, whentype_params
is an empty tuple.gh-123017 [https://github.com/python/cpython/issues/123017]: Due to unreliable results on some devices,
time.strftime()
no longer accepts negative years on Android.gh-123014 [https://github.com/python/cpython/issues/123014]:
os.pidfd_open()
andsignal.pidfd_send_signal()
are now unavailable when building against Android API levels older than 31, since the underlying system calls may cause a crash.gh-124248 [https://github.com/python/cpython/issues/124248]: Fixed potential crash when using
struct
to process zero-width 'Pascal string' fields (0p
).gh-87041 [https://github.com/python/cpython/issues/87041]: Fix a bug in
argparse
where lengthy subparser argument help is incorrectly indented.gh-124212 [https://github.com/python/cpython/issues/124212]: Fix invalid variable in
venv
handling of failed symlink on Windowsgh-124171 [https://github.com/python/cpython/issues/124171]: Add workaround for broken
fmod()
implementations on Windows, that loose zero sign (e.g.fmod(-10, 1)
returns0.0
). Patch by Sergey B Kirpichev.gh-123934 [https://github.com/python/cpython/issues/123934]: Fix
unittest.mock.MagicMock
reseting magic methods return values after.reset_mock(return_value=True)
was called.gh-123968 [https://github.com/python/cpython/issues/123968]: Fix the commandline interface for the
random
module to select floats between 0 and N, not 1 and N.gh-123892 [https://github.com/python/cpython/issues/123892]: Add
"_wmi"
tosys.stdlib_module_names
. Patch by Victor Stinner.gh-123339 [https://github.com/python/cpython/issues/123339]: Fix
inspect.getsource()
for classes incollections.abc
anddecimal
(for pure Python implementation) modules.inspect.getcomments()
now raises OSError instead of IndexError if the__firstlineno__
value for a class is out of bound.gh-121735 [https://github.com/python/cpython/issues/121735]: When working with zip archives, importlib.resources now properly honors module-adjacent references (e.g.
files(pkg.mod)
and not justfiles(pkg)
).gh-122145 [https://github.com/python/cpython/issues/122145]: Fix an issue when reporting tracebacks corresponding to Python code emitting an empty AST body. Patch by Nikita Sobolev and Bénédikt Tran.
gh-119004 [https://github.com/python/cpython/issues/119004]: Fix a crash in OrderedDict.eq when operands are mutated during the check. Patch by Bénédikt Tran.
bpo-44864 [https://bugs.python.org/issue?@action=redirect&bpo=44864]: Do not translate user-provided strings in
argparse.ArgumentParser
.
IDLE
gh-112938 [https://github.com/python/cpython/issues/112938]: Fix uninteruptable hang when Shell gets rapid continuous output.
gh-120104 [https://github.com/python/cpython/issues/120104]: Fix padding in config and search dialog windows in IDLE.
文档
gh-124720 [https://github.com/python/cpython/issues/124720]: Update "Using Python on a Mac" section of the "Python Setup and Usage" document and include information on installing free-threading support.
gh-116622 [https://github.com/python/cpython/issues/116622]: Add an Android platform guide, and flag modules not available on Android.
核心与内置函数
gh-124567 [https://github.com/python/cpython/issues/124567]: Revert the incremental GC (in 3.13), since it's not clear the benefits outweigh the costs at this point.
gh-124642 [https://github.com/python/cpython/issues/124642]: Fixed scalability issue in free-threaded builds for lock-free reads from dictionaries in multithreaded scenarios
gh-116510 [https://github.com/python/cpython/issues/116510]: Fix a bug that can cause a crash when subinterpreters use "basic" single-phase extension modules. Shared objects could refer to PyGC_Head nodes that had been freed as part of interpreter cleanup.
gh-124547 [https://github.com/python/cpython/issues/124547]: When deallocating an object with inline values whose
__dict__
is still live: if memory allocation for the inline values fails, clear the dictionary. Prevents an interpreter crash.gh-124513 [https://github.com/python/cpython/issues/124513]: Fix a crash in FrameLocalsProxy constructor: check the number of arguments. Patch by Victor Stinner.
gh-124442 [https://github.com/python/cpython/issues/124442]: Fix nondeterminism in compilation by sorting the value of
__static_attributes__
. Patch by kp2pml30.gh-123856 [https://github.com/python/cpython/issues/123856]: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search
gh-65961 [https://github.com/python/cpython/issues/65961]: Document the deprecation of setting and using
__package__
and__cached__
.gh-124027 [https://github.com/python/cpython/issues/124027]: Support
,
, and
keys in the Python REPL when$TERM
is set tovt100
.gh-77894 [https://github.com/python/cpython/issues/77894]: Fix possible crash in the garbage collector when it tries to break a reference loop containing a
memoryview
object. Now amemoryview
object can only be cleared if there are no buffers that refer it.gh-123339 [https://github.com/python/cpython/issues/123339]: Setting the
__module__
attribute for a class now removes the__firstlineno__
item from the type's dict, so they will no longer be inconsistent.
C API
gh-124160 [https://github.com/python/cpython/issues/124160]: Fix crash when importing modules containing state and single-phase initialization in a subinterpreter.
gh-123880 [https://github.com/python/cpython/issues/123880]: Fixed a bug that prevented circular imports of extension modules that use single-phase initialization.
构建
gh-124487 [https://github.com/python/cpython/issues/124487]: Windows builds now use Windows 8.1 as their API baseline (installation already required Windows 8.1).
gh-124043 [https://github.com/python/cpython/issues/124043]: Building using
--with-trace-refs
is (temporarily) disallowed when the GIL is disabled.
Python 3.13.0 release candidate 2
Release date: 2024-09-06
macOS
- gh-123418 [https://github.com/python/cpython/issues/123418]: Updated macOS installer build to use OpenSSL 3.0.15.
Windows
gh-123418 [https://github.com/python/cpython/issues/123418]: Updated Windows build to use OpenSSL 3.0.15.
gh-122573 [https://github.com/python/cpython/issues/122573]: The Windows build of CPython now requires 3.10 or newer.
gh-100256 [https://github.com/python/cpython/issues/100256]:
mimetypes
no longer fails when it encounters an inaccessible registry key.gh-79846 [https://github.com/python/cpython/issues/79846]: Makes
ssl.create_default_context()
ignore invalid certificates in the Windows certificate store
工具/示例
- gh-123418 [https://github.com/python/cpython/issues/123418]: Update GitHub CI workflows to use OpenSSL 3.0.15 and multissltests to use 3.0.15, 3.1.7, and 3.2.3.
测试
gh-119727 [https://github.com/python/cpython/issues/119727]: Add
--single-process
command line option to Python test runner (regrtest). Patch by Victor Stinner.gh-101525 [https://github.com/python/cpython/issues/101525]: Skip
test_gdb
if the binary is relocated by BOLT. Patch by Donghee Na.
安全性
gh-123678 [https://github.com/python/cpython/issues/123678]: Upgrade libexpat to 2.6.3
gh-121285 [https://github.com/python/cpython/issues/121285]: Remove backtracking from tarfile header parsing for
hdrcharset
, PAX, and GNU sparse headers.
库
gh-123657 [https://github.com/python/cpython/issues/123657]: Fix crash and memory leak in
decimal.getcontext()
. It crashed when using a thread-local context by--with-decimal-contextvar=no
.gh-123448 [https://github.com/python/cpython/issues/123448]: Fixed memory leak of
typing.NoDefault
by moving it to the static types array.gh-123409 [https://github.com/python/cpython/issues/123409]: Fix
ipaddress.IPv6Address.reverse_pointer
output according to RFC 3596, §2.5 [https://datatracker.ietf.org/doc/html/rfc3596.html#section-2.5]. Patch by Bénédikt Tran.gh-123270 [https://github.com/python/cpython/issues/123270]: Applied a more surgical fix for malformed payloads in
zipfile.Path
causing infinite loops (gh-122905 [https://github.com/python/cpython/issues/122905]) without breaking contents using legitimate characters.gh-123228 [https://github.com/python/cpython/issues/123228]: Fix return type for
pyrepl.readline.ReadlineWrapper.get_line_buffer()
to bestr()
. Patch by Sergey B Kirpichev.gh-123240 [https://github.com/python/cpython/issues/123240]: Raise audit events for the
input()
in the new REPL.gh-123243 [https://github.com/python/cpython/issues/123243]: Fix memory leak in
_decimal
.gh-122546 [https://github.com/python/cpython/issues/122546]: Consistently use same file name for different exceptions in the new repl. Patch by Sergey B Kirpichev.
gh-123213 [https://github.com/python/cpython/issues/123213]:
xml.etree.ElementTree.Element.extend()
andElement
assignment no longer hide the internal exception if an erronous generator is passed. Patch by Bar Harel.gh-85110 [https://github.com/python/cpython/issues/85110]: Preserve relative path in URL without netloc in
urllib.parse.urlunsplit()
andurllib.parse.urlunparse()
.gh-123067 [https://github.com/python/cpython/issues/123067]: Fix quadratic complexity in parsing
"
-quoted cookie values with backslashes byhttp.cookies
.gh-122981 [https://github.com/python/cpython/issues/122981]: Fix
inspect.getsource()
for generated classes with Python base classes (e.g. enums).gh-122903 [https://github.com/python/cpython/issues/122903]:
zipfile.Path.glob
now correctly matches directories instead of silently omitting them.gh-122905 [https://github.com/python/cpython/issues/122905]:
zipfile.Path
objects now sanitize names from the zipfile.gh-122695 [https://github.com/python/cpython/issues/122695]: Fixed double-free when using
gc.get_referents()
with a freedasyncio.Future
iterator.gh-116263 [https://github.com/python/cpython/issues/116263]:
logging.handlers.RotatingFileHandler
no longer rolls over empty log files.gh-105376 [https://github.com/python/cpython/issues/105376]: Restore the deprecated
logging
warn()
method. It was removed in Python 3.13 alpha 1. Keep the deprecatedwarn()
method in Python 3.13. Patch by Victor Stinner.gh-122744 [https://github.com/python/cpython/issues/122744]: Bump the version of pip bundled in ensurepip to version 24.2.
gh-118814 [https://github.com/python/cpython/issues/118814]: Fix the
typing.TypeVar
constructor when name is passed by keyword.gh-122478 [https://github.com/python/cpython/issues/122478]: Remove internal frames from tracebacks shown in
code.InteractiveInterpreter
with non-defaultsys.excepthook()
. Save correct tracebacks insys.last_traceback
and update__traceback__
attribute ofsys.last_value
andsys.last_exc
.gh-116622 [https://github.com/python/cpython/issues/116622]: On Android, the
FICLONE
andFICLONERANGE
constants are no longer exposed byfcntl
, as these ioctls are blocked by SELinux.gh-82378 [https://github.com/python/cpython/issues/82378]: Make sure that the new REPL interprets
sys.tracebacklimit
in the same way that the classic REPL did.gh-122334 [https://github.com/python/cpython/issues/122334]: Fix crash when importing
ssl
after the main interpreter restarts.gh-87320 [https://github.com/python/cpython/issues/87320]: In
code.InteractiveInterpreter
, handle exceptions caused by calling a non-defaultsys.excepthook()
. Before, the exception bubbled up to the caller, ending the REPL.gh-121650 [https://github.com/python/cpython/issues/121650]:
email
headers with embedded newlines are now quoted on output. Thegenerator
will now refuse to serialize (write) headers that are unsafely folded or delimited; seeverify_generated_headers
. (Contributed by Bas Bloemsaat and Petr Viktorin in gh-121650 [https://github.com/python/cpython/issues/121650].)gh-121723 [https://github.com/python/cpython/issues/121723]: Make
logging.config.dictConfig()
accept any object implementing the Queue public API. See the queue configuration section for details. Patch by Bénédikt Tran.gh-122081 [https://github.com/python/cpython/issues/122081]: Fix a crash in the
decimal.IEEEContext()
optional function available via theEXTRA_FUNCTIONALITY
configuration flag.gh-121804 [https://github.com/python/cpython/issues/121804]: Correctly show error locations, when
SyntaxError
raised in new repl. Patch by Sergey B Kirpichev.gh-121151 [https://github.com/python/cpython/issues/121151]: Fix wrapping of long usage text of arguments inside a mutually exclusive group in
argparse
.gh-108172 [https://github.com/python/cpython/issues/108172]:
webbrowser
honors OS preferred browser on Linux when its desktop entry name contains the text of a known browser name.gh-109109 [https://github.com/python/cpython/issues/109109]: You can now get the raw TLS certificate chains from TLS connections via
ssl.SSLSocket.get_verified_chain()
andssl.SSLSocket.get_unverified_chain()
methods.
Contributed by Mateusz Nowak.
IDLE
- gh-120083 [https://github.com/python/cpython/issues/120083]: Add explicit black IDLE Hovertip foreground color needed for recent macOS. Fixes Sonoma showing unreadable white on pale yellow. Patch by John Riggles.
核心与内置函数
gh-120221 [https://github.com/python/cpython/issues/120221]: asyncio REPL is now again properly recognizing KeyboardInterrupts. Display of exceptions raised in secondary threads is fixed.
gh-119310 [https://github.com/python/cpython/issues/119310]: Allow the new interactive shell to read history files written with the editline library that use unicode-escaped entries. Patch by aorcajo and Łukasz Langa.
gh-123572 [https://github.com/python/cpython/issues/123572]: Fix key mappings for various F-keys in Windows for the new REPL. Patch by devdanzin
gh-119034 [https://github.com/python/cpython/issues/119034]: Change
and
keys of the Python REPL to history search forward/backward. Patch by Victor Stinner.gh-123545 [https://github.com/python/cpython/issues/123545]: Fix a double decref in rare cases on experimental JIT builds.
gh-123484 [https://github.com/python/cpython/issues/123484]: Fix
PyDebugOffsets
for long objects to be relative to the start of the object rather than the start of a subobject.gh-123344 [https://github.com/python/cpython/issues/123344]: Add AST optimizations for type parameter defaults.
gh-123321 [https://github.com/python/cpython/issues/123321]: Prevent Parser/myreadline race condition from segfaulting on multithreaded use. Patch by Bar Harel and Amit Wienner.
gh-123177 [https://github.com/python/cpython/issues/123177]: Fix a bug causing stray prompts to appear in the middle of wrapped lines in the new REPL.
gh-122982 [https://github.com/python/cpython/issues/122982]: Extend the deprecation period for bool inversion (
~
) by two years.gh-123275 [https://github.com/python/cpython/issues/123275]: Support
-X gil=1
andPYTHON_GIL=1
on non-free-threaded builds.gh-123177 [https://github.com/python/cpython/issues/123177]: Deactivate line wrap in the Apple Terminal via a ANSI escape code. Patch by Pablo Galindo
gh-123229 [https://github.com/python/cpython/issues/123229]: Fix valgrind warning by initializing the fstring buffers to 0 in the tokenizer. Patch by Pablo Galindo
gh-122298 [https://github.com/python/cpython/issues/122298]: Restore printout of GC stats when
gc.set_debug(gc.DEBUG_STATS)
is called. This featue was accidentally removed when implementing incremental GC.gh-121804 [https://github.com/python/cpython/issues/121804]: Correctly show error locations when a
SyntaxError
is raised in the basic REPL. Patch by Sergey B Kirpichev.gh-123142 [https://github.com/python/cpython/issues/123142]: Fix too-wide source location in exception tracebacks coming from broken iterables in comprehensions.
gh-123048 [https://github.com/python/cpython/issues/123048]: Fix a bug where pattern matching code could emit a
JUMP_FORWARD
with no source location.gh-123123 [https://github.com/python/cpython/issues/123123]: Fix displaying
SyntaxError
exceptions covering multiple lines. Patch by Pablo Galindogh-123083 [https://github.com/python/cpython/issues/123083]: Fix a potential use-after-free in
STORE_ATTR_WITH_HINT
.gh-123022 [https://github.com/python/cpython/issues/123022]: Fix crash in free-threaded build when calling
Py_Initialize()
from a non-main thread.gh-122888 [https://github.com/python/cpython/issues/122888]: Fix crash on certain calls to
str()
with positional arguments of the wrong type. Patch by Jelle Zijlstra.gh-116622 [https://github.com/python/cpython/issues/116622]: Fix Android stdout and stderr messages being truncated or lost.
gh-122527 [https://github.com/python/cpython/issues/122527]: Fix a crash that occurred when a
PyStructSequence
was deallocated after its type's dictionary was cleared by the GC. The type'stp_basicsize
now accounts for non-sequence fields that aren't included in thePy_SIZE
of the sequence.gh-122445 [https://github.com/python/cpython/issues/122445]: Add only fields which are modified via self.* to
__static_attributes__
.gh-98442 [https://github.com/python/cpython/issues/98442]: Fix too wide source locations of the cleanup instructions of a with statement.
gh-93691 [https://github.com/python/cpython/issues/93691]: Fix source locations of instructions generated for with statements.
gh-120097 [https://github.com/python/cpython/issues/120097]:
FrameLocalsProxy
now subclassescollections.abc.Mapping
and can be matched as a mapping inmatch
statements
C API
- gh-122728 [https://github.com/python/cpython/issues/122728]: Fix
PyEval_GetLocals()
to avoidSystemError
("bad argument to internal function"). Patch by Victor Stinner.
构建
gh-123418 [https://github.com/python/cpython/issues/123418]: Updated Android build to use OpenSSL 3.0.15.
gh-123297 [https://github.com/python/cpython/issues/123297]: Propagate the value of
LDFLAGS
toLDCXXSHARED
insysconfig
. Patch by Pablo Galindogh-116622 [https://github.com/python/cpython/issues/116622]: Rename build variable
MODULE_LDFLAGS
back toLIBPYTHON
, as it's used by package build systems (e.g. Meson).gh-118943 [https://github.com/python/cpython/issues/118943]: Fix an issue where the experimental JIT could be built several times by the
make regen-all
target, leading to possible race conditions on heavily parallelized builds.gh-118943 [https://github.com/python/cpython/issues/118943]: Fix a possible race condition affecting parallel builds configured with
--enable-experimental-jit
, in whichFileNotFoundError
could be caused by another process already movingjit_stencils.h.new
tojit_stencils.h
.
Python 3.13.0 release candidate 1
Release date: 2024-07-31
测试
gh-59022 [https://github.com/python/cpython/issues/59022]: Add tests for
pkgutil.extend_path()
. Patch by Andreas Stocker.gh-99242 [https://github.com/python/cpython/issues/99242]:
os.getloadavg()
may throwOSError
when running regression tests under certain conditions (e.g. chroot). This error is now caught and ignored, since reporting load average is optional.
安全性
- gh-122133 [https://github.com/python/cpython/issues/122133]: Authenticate the socket connection for the
socket.socketpair()
fallback on platforms whereAF_UNIX
is not available like Windows.
Patch by Gregory P. Smith <greg@krypto.org> and Seth Larson <seth@python.org>. Reported by Ellie <el@horse64.org>
- gh-121957 [https://github.com/python/cpython/issues/121957]: Fixed missing audit events around interactive use of Python, now also properly firing for
python -i
, as well as forpython -m asyncio
. The events in question arecpython.run_stdin
andcpython.run_startup
.