安全性
- bpo-42967 [https://bugs.python.org/issue?@action=redirect&bpo=42967]: Fix web cache poisoning vulnerability by defaulting the query args separator to
&
, and allowing the user to choose a custom separator.
核心与内置函数
bpo-43321 [https://bugs.python.org/issue?@action=redirect&bpo=43321]: Fix
SystemError
raised whenPyArg_Parse*()
is used with#
but withoutPY_SSIZE_T_CLEAN
defined.bpo-36346 [https://bugs.python.org/issue?@action=redirect&bpo=36346]:
PyArg_Parse*()
functions now emitsDeprecationWarning
whenu
orZ
format is used. See PEP 623 [https://peps.python.org/pep-0623/] for detail.bpo-43277 [https://bugs.python.org/issue?@action=redirect&bpo=43277]: Add a new
PySet_CheckExact()
function to the C-API to check if an object is an instance ofset
but not an instance of a subtype. Patch by Pablo Galindo.bpo-42990 [https://bugs.python.org/issue?@action=redirect&bpo=42990]: The
types.FunctionType
constructor now inherits the current builtins if the globals dictionary has no"__builtins__"
key, rather than using{"None": None}
as builtins: same behavior aseval()
andexec()
functions. Defining a function withdef function(…): …
in Python is not affected, globals cannot be overridden with this syntax: it also inherits the current builtins. Patch by Victor Stinner.bpo-42990 [https://bugs.python.org/issue?@action=redirect&bpo=42990]: Functions have a new
__builtins__
attribute which is used to look for builtin symbols when a function is executed, instead of looking into__globals__['__builtins__']
. Patch by Mark Shannon and Victor Stinner.bpo-43149 [https://bugs.python.org/issue?@action=redirect&bpo=43149]: Improve the error message in the parser for exception groups without parentheses. Patch by Pablo Galindo.
bpo-43121 [https://bugs.python.org/issue?@action=redirect&bpo=43121]: Fixed an incorrect
SyntaxError
message for missing comma in literals. Patch by Pablo Galindo.bpo-42819 [https://bugs.python.org/issue?@action=redirect&bpo=42819]:
readline
: Explicitly disable bracketed paste in the interactive interpreter, even if it's set in the inputrc, is enabled by default (eg GNU Readline 8.1), or a user callsreadline.read_init_file()
. The Python REPL has not implemented bracketed paste support. Also, bracketed mode writes the"\x1b[?2004h"
escape sequence into stdout which causes test failures in applications that don't support it. It can still be explicitly enabled by callingreadline.parse_and_bind("set enable-bracketed-paste on")
. Patch by Dustin Rodrigues.bpo-42808 [https://bugs.python.org/issue?@action=redirect&bpo=42808]: Simple calls to
type(object)
are now faster due to thevectorcall
calling convention. Patch by Dennis Sweeney.bpo-42217 [https://bugs.python.org/issue?@action=redirect&bpo=42217]: Make the compiler merges same co_code and co_linetable objects in a module like already did for co_consts.
bpo-41972 [https://bugs.python.org/issue?@action=redirect&bpo=41972]: Substring search functions such as
str1 in str2
andstr2.find(str1)
now sometimes use the "Two-Way" string comparison algorithm to avoid quadratic behavior on long strings.bpo-42128 [https://bugs.python.org/issue?@action=redirect&bpo=42128]: Implement PEP 634 [https://peps.python.org/pep-0634/] (structural pattern matching). Patch by Brandt Bucher.
bpo-40692 [https://bugs.python.org/issue?@action=redirect&bpo=40692]: In the
concurrent.futures.ProcessPoolExecutor
, validate thatmultiprocess.synchronize()
is available on a given platform and rely on that check in theconcurrent.futures
test suite so we can run tests that are unrelated toProcessPoolExecutor
on those platforms.bpo-38302 [https://bugs.python.org/issue?@action=redirect&bpo=38302]: If
object.__ipow__()
returnsNotImplemented
, the operator will correctly fall back toobject.__pow__()
andobject.__rpow__()
as expected.
库
bpo-43316 [https://bugs.python.org/issue?@action=redirect&bpo=43316]: The
python -m gzip
command line application now properly fails when detecting an unsupported extension. It exits with a non-zero exit code and prints an error message to stderr.bpo-43317 [https://bugs.python.org/issue?@action=redirect&bpo=43317]: Set the chunk size for the
gzip
module main function to io.DEFAULT_BUFFER_SIZE. This is slightly faster than the 1024 bytes constant that was used previously.bpo-43146 [https://bugs.python.org/issue?@action=redirect&bpo=43146]: Handle None in single-arg versions of
print_exception()
andformat_exception()
.bpo-43260 [https://bugs.python.org/issue?@action=redirect&bpo=43260]: Fix TextIOWrapper can not flush internal buffer forever after very large text is written.
bpo-43258 [https://bugs.python.org/issue?@action=redirect&bpo=43258]: Prevent needless allocation of
sqlite3
aggregate function context when no rows match an aggregate query. Patch by Erlend E. Aasland.bpo-43251 [https://bugs.python.org/issue?@action=redirect&bpo=43251]: Improve
sqlite3
error handling:sqlite3_column_name()
failures now result inMemoryError
. Patch by Erlend E. Aasland.bpo-40956 [https://bugs.python.org/issue?@action=redirect&bpo=40956]: Fix segfault in
sqlite3.Connection.backup()
if no argument was provided. The regression was introduced by PR 23838. Patch by Erlend E. Aasland.bpo-43172 [https://bugs.python.org/issue?@action=redirect&bpo=43172]: The readline module now passes its tests when built directly against libedit. Existing irreconcilable API differences remain in
readline.get_begidx()
andreadline.get_endidx()
behavior based on libreadline vs libedit use.bpo-43163 [https://bugs.python.org/issue?@action=redirect&bpo=43163]: Fix a bug in
codeop
that was causing it to not ask for more input when multiline snippets have unclosed parentheses. Patch by Pablo Galindobpo-43162 [https://bugs.python.org/issue?@action=redirect&bpo=43162]: deprecate unsupported ability to access enum members as attributes of other enum members
bpo-43146 [https://bugs.python.org/issue?@action=redirect&bpo=43146]: Fix recent regression in None argument handling in
traceback
module functions.bpo-43102 [https://bugs.python.org/issue?@action=redirect&bpo=43102]: The namedtuple new method had its builtins set to None instead of an actual dictionary. This created problems for introspection tools.
bpo-43106 [https://bugs.python.org/issue?@action=redirect&bpo=43106]: Added
O_EVTONLY
,O_FSYNC
,O_SYMLINK
andO_NOFOLLOW_ANY
for macOS. Patch by Donghee Na.bpo-42960 [https://bugs.python.org/issue?@action=redirect&bpo=42960]: Adds
resource.RLIMIT_KQUEUES
constant from FreeBSD to theresource
module.bpo-42151 [https://bugs.python.org/issue?@action=redirect&bpo=42151]: Make the pure Python implementation of
xml.etree.ElementTree
behave the same as the C implementation (_elementree
) regarding default attribute values (by not settingspecified_attributes=1
).bpo-29753 [https://bugs.python.org/issue?@action=redirect&bpo=29753]: In ctypes, now packed bitfields are calculated properly and the first item of packed bitfields is now shrank correctly.
文档
bpo-27646 [https://bugs.python.org/issue?@action=redirect&bpo=27646]: Clarify that 'yield from
' works with any iterable, not just iterators. bpo-36346 [https://bugs.python.org/issue?@action=redirect&bpo=36346]: Update some deprecated unicode APIs which are documented as "will be removed in 4.0" to "3.12". See PEP 623 [https://peps.python.org/pep-0623/] for detail.
测试
- bpo-43288 [https://bugs.python.org/issue?@action=redirect&bpo=43288]: Fix test_importlib to correctly skip Unicode file tests if the filesystem does not support them.
构建
bpo-43174 [https://bugs.python.org/issue?@action=redirect&bpo=43174]: Windows build now uses
/utf-8
compiler option.bpo-43103 [https://bugs.python.org/issue?@action=redirect&bpo=43103]: Add a new configure
--without-static-libpython
option to not build thelibpythonMAJOR.MINOR.a
static library and not install thepython.o
object file.bpo-13501 [https://bugs.python.org/issue?@action=redirect&bpo=13501]: The configure script can now use libedit instead of readline with the command line option
--with-readline=editline
.bpo-42603 [https://bugs.python.org/issue?@action=redirect&bpo=42603]: Make configure script use pkg-config to detect the location of Tcl/Tk headers and libraries, used to build tkinter.
On macOS, a Tcl/Tk configuration provided by pkg-config will be preferred over Tcl/Tk frameworks installed in {System,}Library/Frameworks
. If both exist and the latter is preferred, the appropriate --with-tcltk-*
configuration options need to be explicitly set.
- bpo-39448 [https://bugs.python.org/issue?@action=redirect&bpo=39448]: Add the "regen-frozen" makefile target that regenerates the code for the frozen
__hello__
module.
Windows
- bpo-43155 [https://bugs.python.org/issue?@action=redirect&bpo=43155]:
PyCMethod_New()
is now present inpython3.lib
.
macOS
- bpo-41837 [https://bugs.python.org/issue?@action=redirect&bpo=41837]: Update macOS installer build to use OpenSSL 1.1.1j.
IDLE
- bpo-43283 [https://bugs.python.org/issue?@action=redirect&bpo=43283]: Document why printing to IDLE's Shell is often slower than printing to a system terminal and that it can be made faster by pre-formatting a single string before printing.
C API
bpo-43278 [https://bugs.python.org/issue?@action=redirect&bpo=43278]: Always put compiler and system information on the first line of the REPL welcome message.
bpo-43270 [https://bugs.python.org/issue?@action=redirect&bpo=43270]: Remove the private
PyErrOCCURRED()
macro: use the publicPyErr_Occurred()
function instead.bpo-35134 [https://bugs.python.org/issue?@action=redirect&bpo=35134]: Move odictobject.h, parser_interface.h, picklebufobject.h, pydebug.h, and pyfpe.h into the cpython/ directory. They must not be included directly, as they are already included by Python.h: Include Files.
bpo-35134 [https://bugs.python.org/issue?@action=redirect&bpo=35134]: Move pyarena.h, pyctype.h, and pytime.h into the cpython/ directory. They must not be included directly, as they are already included by Python.h: Include Files.
bpo-40170 [https://bugs.python.org/issue?@action=redirect&bpo=40170]:
PyExceptionClass_Name()
is now always declared as a function, in order to hide implementation details. The macro accessedPyTypeObject.tp_name
directly. Patch by Erlend E. Aasland.bpo-43239 [https://bugs.python.org/issue?@action=redirect&bpo=43239]: The
PyCFunction_New()
function is now exported in the ABI when compiled with-fvisibility=hidden
.bpo-40170 [https://bugs.python.org/issue?@action=redirect&bpo=40170]:
PyIter_Check()
is now always declared as a function, in order to hide implementation details. The macro accessedPyTypeObject.tp_iternext
directly. Patch by Erlend E. Aasland.bpo-40170 [https://bugs.python.org/issue?@action=redirect&bpo=40170]: Convert
PyDescr_IsData()
macro to a function to hide implementation details: The macro accessedPyTypeObject.tp_descr_set
directly. Patch by Erlend E. Aasland.bpo-43181 [https://bugs.python.org/issue?@action=redirect&bpo=43181]: Convert
PyObject_TypeCheck()
macro to a static inline function. Patch by Erlend E. Aasland.
Python 3.10.0 alpha 5
发布日期: 2021-02-02
安全性
- bpo-42938 [https://bugs.python.org/issue?@action=redirect&bpo=42938]: Avoid static buffers when computing the repr of
ctypes.c_double
andctypes.c_longdouble
values.
核心与内置函数
bpo-42990 [https://bugs.python.org/issue?@action=redirect&bpo=42990]: Refactor the
PyEval_
family of functions.An new function
PyEvalVector
is added to simplify calls to Python from C.PyEvalEvalCodeWithName
is removedPyEval_EvalCodeEx
is retained as part of the API, but is not used internally
bpo-38631 [https://bugs.python.org/issue?@action=redirect&bpo=38631]: Replace
Py_FatalError()
calls in the compiler with regularSystemError
exceptions. Patch by Victor Stinner.bpo-42997 [https://bugs.python.org/issue?@action=redirect&bpo=42997]: Improve error message for missing ":" before blocks. Patch by Pablo Galindo.
bpo-43017 [https://bugs.python.org/issue?@action=redirect&bpo=43017]: Improve error message in the parser when using un-parenthesised tuples in comprehensions. Patch by Pablo Galindo.
bpo-42986 [https://bugs.python.org/issue?@action=redirect&bpo=42986]: Fix parser crash when reporting syntax errors in fstring with newlines. Patch by Pablo Galindo.
bpo-40176 [https://bugs.python.org/issue?@action=redirect&bpo=40176]: Syntax errors for unterminated string literals now point to the start of the string instead of reporting EOF/EOL.
bpo-42927 [https://bugs.python.org/issue?@action=redirect&bpo=42927]: The inline cache for
LOAD_ATTR
now also optimizes access to attributes defined by__slots__
. This makes reading such attribute up to 30% faster.bpo-42864 [https://bugs.python.org/issue?@action=redirect&bpo=42864]: Improve error messages in the parser when parentheses are not closed. Patch by Pablo Galindo.
bpo-42924 [https://bugs.python.org/issue?@action=redirect&bpo=42924]: Fix
bytearray
repetition incorrectly copying data from the start of the buffer, even if the data is offset within the buffer (e.g. after reassigning a slice at the start of thebytearray
to a shorter byte string).bpo-42882 [https://bugs.python.org/issue?@action=redirect&bpo=42882]: Fix the
PyUnicodeFromId()
function (PyIDENTIFIER(var) API) whenPy_Initialize()
/Py_Finalize()
is called multiple times: preservePyRuntime.unicodeids.next_index
value.bpo-42827 [https://bugs.python.org/issue?@action=redirect&bpo=42827]: Fix a crash when working out the error line of a
SyntaxError
in some multiline expressions.bpo-42823 [https://bugs.python.org/issue?@action=redirect&bpo=42823]: frame.f_lineno is correct even if frame.f_trace is set to True
bpo-37324 [https://bugs.python.org/issue?@action=redirect&bpo=37324]: Remove deprecated aliases to 容器抽象基类 from the
collections
module.bpo-41994 [https://bugs.python.org/issue?@action=redirect&bpo=41994]: Fixed possible leak in
import
whensys.modules
is not adict
.bpo-27772 [https://bugs.python.org/issue?@action=redirect&bpo=27772]: In string formatting, preceding the width field by
'0'
no longer affects the default alignment for strings.
库
bpo-43108 [https://bugs.python.org/issue?@action=redirect&bpo=43108]: Fixed a reference leak in the
curses
module. Patch by Pablo Galindobpo-43077 [https://bugs.python.org/issue?@action=redirect&bpo=43077]: Update the bundled pip to 21.0.1 and setuptools to 52.0.0.
bpo-41282 [https://bugs.python.org/issue?@action=redirect&bpo=41282]: Deprecate
distutils
in documentation and add warning on import.bpo-43014 [https://bugs.python.org/issue?@action=redirect&bpo=43014]: Improve performance of
tokenize
by 20-30%. Patch by Anthony Sottile.bpo-42323 [https://bugs.python.org/issue?@action=redirect&bpo=42323]: Fix
math.nextafter()
for NaN on AIX.bpo-42955 [https://bugs.python.org/issue?@action=redirect&bpo=42955]: Add
sys.stdlib_module_names
, containing the list of the standard library module names. Patch by Victor Stinner.bpo-42944 [https://bugs.python.org/issue?@action=redirect&bpo=42944]: Fix
random.Random.sample
whencounts
argument is notNone
.bpo-42934 [https://bugs.python.org/issue?@action=redirect&bpo=42934]: Use
TracebackException
's newcompact
param inTestResult
to reduce time and memory consumed by traceback formatting.bpo-42931 [https://bugs.python.org/issue?@action=redirect&bpo=42931]: Add
randbytes()
torandom.__all__
.bpo-38250 [https://bugs.python.org/issue?@action=redirect&bpo=38250]: [Enum] Flags consisting of a single bit are now considered canonical, and will be the only flags returned from listing and iterating over a Flag class or a Flag member. Multi-bit flags are considered aliases; they will be returned from lookups and operations that result in their value. Iteration for both Flag and Flag members is in definition order.
bpo-42877 [https://bugs.python.org/issue?@action=redirect&bpo=42877]: Added the
compact
parameter to the constructor oftraceback.TracebackException
to reduce time and memory for use cases that only need to callTracebackException.format()
andTracebackException.format_exception_only()
.bpo-42923 [https://bugs.python.org/issue?@action=redirect&bpo=42923]: The
Py_FatalError()
function and thefaulthandler
module now dump the list of extension modules on a fatal error.bpo-42848 [https://bugs.python.org/issue?@action=redirect&bpo=42848]: Removed recursion from
TracebackException
to allow it to handle long exception chains.bpo-42901 [https://bugs.python.org/issue?@action=redirect&bpo=42901]: [Enum] move member creation from
EnumMeta._new_
toprotomember._setname__
, allowing members to be created and visible in__init_subclass__
.bpo-42780 [https://bugs.python.org/issue?@action=redirect&bpo=42780]: Fix os.set_inheritable() for O_PATH file descriptors on Linux.
bpo-42866 [https://bugs.python.org/issue?@action=redirect&bpo=42866]: Fix a reference leak in the
getcodec()
function of CJK codecs. Patch by Victor Stinner.bpo-42846 [https://bugs.python.org/issue?@action=redirect&bpo=42846]: Convert the 6 CJK codec extension modules (codecscn, codecshk, codecsiso2022, codecsjp, codecskr and codecstw) to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]). Patch by Victor Stinner.
bpo-42851 [https://bugs.python.org/issue?@action=redirect&bpo=42851]: remove init_subclass support for Enum members
bpo-42834 [https://bugs.python.org/issue?@action=redirect&bpo=42834]: Make internal caches of the
_json
module compatible with subinterpreters.bpo-41748 [https://bugs.python.org/issue?@action=redirect&bpo=41748]: Fix HTMLParser parsing rules for element attributes containing commas with spaces. Patch by Karl Dubost.
bpo-40810 [https://bugs.python.org/issue?@action=redirect&bpo=40810]: Require SQLite 3.7.15 or newer. Patch by Erlend E. Aasland.
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Convert the _multibytecodec extension module (CJK codecs) to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]). Patch by Erlend E. Aasland.
bpo-42802 [https://bugs.python.org/issue?@action=redirect&bpo=42802]: The distutils
bdist_wininst
command deprecated in Python 3.8 has been removed. The distutilsbdist_wheel
command is now recommended to distribute binary packages on Windows.bpo-24464 [https://bugs.python.org/issue?@action=redirect&bpo=24464]: The undocumented builtin function
sqlite3.enable_shared_cache
is now deprecated, scheduled for removal in Python 3.12. Its use is strongly discouraged by the SQLite3 documentation. Patch by Erlend E. Aasland.bpo-42384 [https://bugs.python.org/issue?@action=redirect&bpo=42384]: Make pdb populate sys.path[0] exactly the same as regular python execution.
bpo-42383 [https://bugs.python.org/issue?@action=redirect&bpo=42383]: Fix pdb: previously pdb would fail to restart the debugging target if it was specified using a relative path and the current directory changed.
bpo-42005 [https://bugs.python.org/issue?@action=redirect&bpo=42005]: Fix CLI of
cProfile
andprofile
to catchBrokenPipeError
.bpo-41604 [https://bugs.python.org/issue?@action=redirect&bpo=41604]: Don't decrement the reference count of the previous user_ptr when set_panel_userptr fails.
bpo-41149 [https://bugs.python.org/issue?@action=redirect&bpo=41149]: Allow executing callables that have a boolean value of
False
when passed toThreading.thread
as the target. Patch contributed by Barney Stratford.bpo-38307 [https://bugs.python.org/issue?@action=redirect&bpo=38307]: Add an 'end_lineno' attribute to the Class and Function objects that appear in the tree returned by pyclbr functions. This and the existing 'lineno' attribute define the extent of class and def statements. Patch by Aviral Srivastava.
bpo-39273 [https://bugs.python.org/issue?@action=redirect&bpo=39273]: The
BUTTON5_*
constants are now exposed in thecurses
module if available.bpo-33289 [https://bugs.python.org/issue?@action=redirect&bpo=33289]: Correct call to
tkinter.colorchooser
to return RGB triplet of ints instead of floats. Patch by Cheryl Sabella.
文档
bpo-40304 [https://bugs.python.org/issue?@action=redirect&bpo=40304]: Fix doc for type(name, bases, dict). Patch by Boris Verkhovskiy and Éric Araujo.
bpo-42811 [https://bugs.python.org/issue?@action=redirect&bpo=42811]: Updated importlib.util.resolvename() doc to use spec.parent instead of _package. (Thanks Yair Frid.)
测试
bpo-40823 [https://bugs.python.org/issue?@action=redirect&bpo=40823]: Use
unittest.TestLoader().loadTestsFromTestCase()
instead ofunittest.makeSuite()
insqlite3
tests. Patch by Erlend E. Aasland.bpo-40810 [https://bugs.python.org/issue?@action=redirect&bpo=40810]: In
sqlite3
, fixCheckTraceCallbackContent
for SQLite pre 3.7.15.
构建
bpo-43031 [https://bugs.python.org/issue?@action=redirect&bpo=43031]: Pass
--timeout=$(TESTTIMEOUT)
option to the default profile task./python -m test --pgo
command.bpo-36143 [https://bugs.python.org/issue?@action=redirect&bpo=36143]:
make regen-all
now also runsregen-keyword
. Patch by Victor Stinner.bpo-42874 [https://bugs.python.org/issue?@action=redirect&bpo=42874]: Removed the grep -q and -E flags in the tzpath validation section of the configure script to better accommodate users of some platforms (specifically Solaris 10).
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Add library search path by wr-cc in add_cross_compiling_paths() for VxWorks.
bpo-42856 [https://bugs.python.org/issue?@action=redirect&bpo=42856]: Add
--with-wheel-pkg-dir=PATH
option to the./configure
script. If specified, theensurepip
module looks forsetuptools
andpip
wheel packages in this directory: if both are present, these wheel packages are used instead of ensurepip bundled wheel packages.
某些 Linux 发行版的打包策略建议不要绑定依赖关系。比如 Fedora 在 usrshare/python-wheels/
目录下安装 wheel 包,而不安装 ensurepip._bundled
包。
Windows
bpo-41837 [https://bugs.python.org/issue?@action=redirect&bpo=41837]: Updated Windows installer to include OpenSSL 1.1.1i
bpo-42584 [https://bugs.python.org/issue?@action=redirect&bpo=42584]: Upgrade Windows installer to use SQLite 3.34.0.
macOS
- bpo-42504 [https://bugs.python.org/issue?@action=redirect&bpo=42504]: Ensure that the value of sysconfig.getconfigvar('MACOSX_DEPLOYMENT_TARGET') is always a string, even in when the value is parsable as an integer.
IDLE
bpo-43008 [https://bugs.python.org/issue?@action=redirect&bpo=43008]: Make IDLE invoke
sys.excepthook()
in normal, 2-process mode. Patch by Ken Hilton.bpo-33065 [https://bugs.python.org/issue?@action=redirect&bpo=33065]: Fix problem debugging user classes with repr method.
bpo-23544 [https://bugs.python.org/issue?@action=redirect&bpo=23544]: Disable Debug=>Stack Viewer when user code is running or Debugger is active, to prevent hang or crash. Patch by Zackery Spytz.
bpo-32631 [https://bugs.python.org/issue?@action=redirect&bpo=32631]: Finish zzdummy example extension module: make menu entries work; add docstrings and tests with 100% coverage.
C API
bpo-42979 [https://bugs.python.org/issue?@action=redirect&bpo=42979]: When Python is built in debug mode (with C assertions), calling a type slot like
sq_length
(__len__()
in Python) now fails with a fatal error if the slot succeeded with an exception set, or failed with no exception set. The error message contains the slot, the type name, and the current exception (if an exception is set). Patch by Victor Stinner.bpo-43030 [https://bugs.python.org/issue?@action=redirect&bpo=43030]: Fixed a compiler warning in
Py_UNICODE_ISSPACE()
on platforms with signedwchar_t
.
Python 3.10.0 alpha 4
发布日期: 2021-01-04
核心与内置函数
bpo-42814 [https://bugs.python.org/issue?@action=redirect&bpo=42814]: Fix undefined behavior in
Objects/genericaliasobject.c
.bpo-42806 [https://bugs.python.org/issue?@action=redirect&bpo=42806]: Fix the column offsets for fstrings
ast
nodes surrounded by parentheses and for nodes that spawn multiple lines. Patch by Pablo Galindo.bpo-40631 [https://bugs.python.org/issue?@action=redirect&bpo=40631]: Fix regression where a single parenthesized starred expression was a valid assignment target.
bpo-27794 [https://bugs.python.org/issue?@action=redirect&bpo=27794]: Improve the error message for failed writes/deletes to property objects. When possible, the attribute name is now shown. Patch provided by Yurii Karabas.
bpo-42745 [https://bugs.python.org/issue?@action=redirect&bpo=42745]: Make the type attribute lookup cache per-interpreter. Patch by Victor Stinner.
bpo-42246 [https://bugs.python.org/issue?@action=redirect&bpo=42246]: Jumps to jumps are not eliminated when it would break PEP 626.
bpo-42246 [https://bugs.python.org/issue?@action=redirect&bpo=42246]: Make sure that the
f_lasti
andf_lineno
attributes of a frame are set correctly when an exception is raised or reraised. Required for PEP 626.bpo-32381 [https://bugs.python.org/issue?@action=redirect&bpo=32381]: The coding cookie (ex:
# coding: latin1
) is now ignored in the command passed to the-c
command line option. Patch by Victor Stinner.bpo-30858 [https://bugs.python.org/issue?@action=redirect&bpo=30858]: Improve error location in expressions that contain assignments. Patch by Pablo Galindo and Lysandros Nikolaou.
bpo-42615 [https://bugs.python.org/issue?@action=redirect&bpo=42615]: Remove jump commands made redundant by the deletion of unreachable bytecode blocks
bpo-42639 [https://bugs.python.org/issue?@action=redirect&bpo=42639]: Make the
atexit
module state per-interpreter. It is now safe have more than oneatexit
module instance. Patch by Donghee Na and Victor Stinner.bpo-32381 [https://bugs.python.org/issue?@action=redirect&bpo=32381]: Fix encoding name when running a
.pyc
file on Windows:PyRun_SimpleFileExFlags()
now uses the correct encoding to decode the filename.bpo-42195 [https://bugs.python.org/issue?@action=redirect&bpo=42195]: The
__args__
of the parameterized generics fortyping.Callable
andcollections.abc.Callable
are now consistent. The__args__
forcollections.abc.Callable
are now flattened whiletyping.Callable
's have not changed. To allow this change,types.GenericAlias
can now be subclassed andcollections.abc.Callable
's__class_getitem__
will now return a subclass oftypes.GenericAlias
. Tests for typing were also updated to not subclass things likeCallable[…, T]
as that is not a valid base class. Finally, bothCallable
s no longer validate theirargtypes
, inCallable[[argtypes], resulttype]
to prepare for PEP 612 [https://peps.python.org/pep-0612/]. Patch by Ken Jin.bpo-40137 [https://bugs.python.org/issue?@action=redirect&bpo=40137]: Convert functools module to use
PyType_FromModuleAndSpec()
.bpo-40077 [https://bugs.python.org/issue?@action=redirect&bpo=40077]: Convert
array
to use heap types, and establish module state for these.bpo-42008 [https://bugs.python.org/issue?@action=redirect&bpo=42008]: Fix _random.Random() seeding.
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
pyexpat
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-40521 [https://bugs.python.org/issue?@action=redirect&bpo=40521]: Make the Unicode dictionary of interned strings compatible with subinterpreters. Patch by Victor Stinner.
bpo-39465 [https://bugs.python.org/issue?@action=redirect&bpo=39465]: Make
PyUnicodeFromId()
function compatible with subinterpreters. Each interpreter now has an array of identifier objects (interned strings decoded from UTF-8). Patch by Victor Stinner.
库
bpo-42257 [https://bugs.python.org/issue?@action=redirect&bpo=42257]: Handle empty string in variable executable in platform.libc_ver()
bpo-42772 [https://bugs.python.org/issue?@action=redirect&bpo=42772]: randrange() now raises a TypeError when step is specified without a stop argument. Formerly, it silently ignored the step argument.
bpo-42759 [https://bugs.python.org/issue?@action=redirect&bpo=42759]: Fixed equality comparison of
tkinter.Variable
andtkinter.font.Font
. Objects which belong to different Tcl interpreters are now always different, even if they have the same name.bpo-42756 [https://bugs.python.org/issue?@action=redirect&bpo=42756]: Configure LMTP Unix-domain socket to use socket global default timeout when a timeout is not explicitly provided.
bpo-23328 [https://bugs.python.org/issue?@action=redirect&bpo=23328]: Allow / character in username, password fields on _PROXY envars.
bpo-42740 [https://bugs.python.org/issue?@action=redirect&bpo=42740]:
typing.get_args()
andtyping.get_origin()
now support PEP 604 [https://peps.python.org/pep-0604/] union types and PEP 612 [https://peps.python.org/pep-0612/] additions toCallable
.bpo-42655 [https://bugs.python.org/issue?@action=redirect&bpo=42655]:
subprocess
extra_groups is now correctly passed into setgroups() system call.bpo-42727 [https://bugs.python.org/issue?@action=redirect&bpo=42727]:
EnumMeta.__prepare__
now accepts**kwds
to properly support__init_subclass__
bpo-38308 [https://bugs.python.org/issue?@action=redirect&bpo=38308]: Add optional weights to statistics.harmonic_mean().
bpo-42721 [https://bugs.python.org/issue?@action=redirect&bpo=42721]: When simple query dialogs (
tkinter.simpledialog
), message boxes (tkinter.messagebox
) or color choose dialog (tkinter.colorchooser
) are created without arguments master and parent, and the default root window is not yet created, andNoDefaultRoot()
was not called, a new temporal hidden root window will be created automatically. It will not be set as the default root window and will be destroyed right after closing the dialog window. It will help to use these simple dialog windows in programs which do not need other GUI.bpo-25246 [https://bugs.python.org/issue?@action=redirect&bpo=25246]: Optimized
collections.deque.remove()
.bpo-35728 [https://bugs.python.org/issue?@action=redirect&bpo=35728]: Added a root parameter to
tkinter.font.nametofont()
.bpo-15303 [https://bugs.python.org/issue?@action=redirect&bpo=15303]:
tkinter
supports now widgets with boolean value False.bpo-42681 [https://bugs.python.org/issue?@action=redirect&bpo=42681]: Fixed range checks for color and pair numbers in
curses
.bpo-42685 [https://bugs.python.org/issue?@action=redirect&bpo=42685]: Improved placing of simple query windows in Tkinter (such as
tkinter.simpledialog.askinteger()
). They are now centered at the center of the parent window if it is specified and shown, otherwise at the center of the screen.bpo-9694 [https://bugs.python.org/issue?@action=redirect&bpo=9694]: Argparse help no longer uses the confusing phrase, "optional arguments". It uses "options" instead.
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_thread
extension module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]) and convert its static types to heap types.bpo-37961 [https://bugs.python.org/issue?@action=redirect&bpo=37961]: Fix crash in
tracemalloc.Traceback._repr_()
(regressed in Python 3.9).bpo-42630 [https://bugs.python.org/issue?@action=redirect&bpo=42630]:
tkinter
functions and constructors which need a default root window raise nowRuntimeError
with descriptive message instead of obscureAttributeError
orNameError
if it is not created yet or cannot be created automatically.bpo-42639 [https://bugs.python.org/issue?@action=redirect&bpo=42639]:
atexit.runexitfuncs()
now logs callback exceptions usingsys.unraisablehook
, rather than logging them directly intosys.stderr
and raise the last exception.bpo-42644 [https://bugs.python.org/issue?@action=redirect&bpo=42644]:
logging.disable
will now validate the types and value of its parameter. It also now accepts strings representing the levels (as doeslogging.setLevel
) instead of only the numerical values.bpo-42639 [https://bugs.python.org/issue?@action=redirect&bpo=42639]: At Python exit, if a callback registered with
atexit.register()
fails, its exception is now logged. Previously, only some exceptions were logged, and the last exception was always silently ignored.bpo-36541 [https://bugs.python.org/issue?@action=redirect&bpo=36541]: Fixed lib2to3.pgen2 to be able to parse PEP-570 positional only argument syntax.
bpo-42382 [https://bugs.python.org/issue?@action=redirect&bpo=42382]: In
importlib.metadata
: -EntryPoint
objects now expose a.dist
object referencing theDistribution
when constructed from aDistribution
. - Add support for package discovery under package normalization rules. - The object returned bymetadata()
now has a formally defined protocol calledPackageMetadata
with declared support for the.get_all()
method. - Synced with importlib_metadata 3.3.bpo-41877 [https://bugs.python.org/issue?@action=redirect&bpo=41877]: A check is added against misspellings of autospect, auto_spec and set_spec being passed as arguments to patch, patch.object and create_autospec.
bpo-39717 [https://bugs.python.org/issue?@action=redirect&bpo=39717]: [tarfile] update nested exception raising to use
from None
orfrom e
bpo-41877 [https://bugs.python.org/issue?@action=redirect&bpo=41877]: AttributeError for suspected misspellings of assertions on mocks are now pointing out that the cause are misspelled assertions and also what to do if the misspelling is actually an intended attribute name. The unittest.mock document is also updated to reflect the current set of recognised misspellings.
bpo-41559 [https://bugs.python.org/issue?@action=redirect&bpo=41559]: Implemented PEP 612 [https://peps.python.org/pep-0612/]: added
ParamSpec
andConcatenate
totyping
. Patch by Ken Jin.bpo-42385 [https://bugs.python.org/issue?@action=redirect&bpo=42385]: StrEnum: fix generatenextvalue to return a str
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Define THREAD_STACK_SIZE for VxWorks.
bpo-34750 [https://bugs.python.org/issue?@action=redirect&bpo=34750]: [Enum]
_EnumDict.update()
is now supported.bpo-42517 [https://bugs.python.org/issue?@action=redirect&bpo=42517]: Enum: private names do not become members / do not generate errors — they remain normal attributes
bpo-42678 [https://bugs.python.org/issue?@action=redirect&bpo=42678]:
Enum
: call__init_subclass__
after members have been addedbpo-28964 [https://bugs.python.org/issue?@action=redirect&bpo=28964]:
ast.literal_eval()
adds line number information (if available) in error message for malformed nodes.bpo-42470 [https://bugs.python.org/issue?@action=redirect&bpo=42470]:
random.sample()
no longer warns on a sequence which is also a set.bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]:
posixpath.expanduser()
returns the input path unchanged if user home directory is None on VxWorks.bpo-42388 [https://bugs.python.org/issue?@action=redirect&bpo=42388]: Fix subprocess.check_output(…, input=None) behavior when text=True to be consistent with that of the documentation and universal_newlines=True.
bpo-34463 [https://bugs.python.org/issue?@action=redirect&bpo=34463]: Fixed discrepancy between
traceback
and the interpreter in formatting of SyntaxError with lineno not set (traceback
was changed to match interpreter).bpo-42393 [https://bugs.python.org/issue?@action=redirect&bpo=42393]: Raise
OverflowError
instead of silent truncation insocket.ntohs()
andsocket.htons()
. Silent truncation was deprecated in Python 3.7. Patch by Erlend E. Aaslandbpo-42222 [https://bugs.python.org/issue?@action=redirect&bpo=42222]: Harmonized
random.randrange()
argument handling to matchrange()
.The integer test and conversion in
randrange()
now usesoperator.index()
.Non-integer arguments to
randrange()
are deprecated.The
ValueError
is deprecated in favor of aTypeError
.It now runs a little faster than before.
(Contributed by Raymond Hettinger and Serhiy Storchaka.)
bpo-42163 [https://bugs.python.org/issue?@action=redirect&bpo=42163]: Restore compatibility for
uname_result
around deepcopy and _replace.bpo-42090 [https://bugs.python.org/issue?@action=redirect&bpo=42090]:
zipfile.Path.joinpath
now accepts arbitrary arguments, same aspathlib.Path.joinpath
.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the _csv module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]).
bpo-42059 [https://bugs.python.org/issue?@action=redirect&bpo=42059]:
typing.TypedDict
types created using the alternative call-style syntax now correctly respect thetotal
keyword argument when setting their__required_keys__
and__optional_keys__
class attributes.bpo-41960 [https://bugs.python.org/issue?@action=redirect&bpo=41960]: Add
globalns
andlocalns
parameters to theinspect.signature()
andinspect.Signature.from_callable()
.bpo-41907 [https://bugs.python.org/issue?@action=redirect&bpo=41907]: fix
format()
behavior forIntFlag
bpo-41891 [https://bugs.python.org/issue?@action=redirect&bpo=41891]: Ensure asyncio.wait_for waits for task completion
bpo-24792 [https://bugs.python.org/issue?@action=redirect&bpo=24792]: Fixed bug where
zipimporter
sometimes reports an incorrect cause of import errors.bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Fix site and sysconfig modules for VxWorks RTOS which has no home directories.
bpo-41462 [https://bugs.python.org/issue?@action=redirect&bpo=41462]: Add
os.set_blocking()
support for VxWorks RTOS.bpo-40219 [https://bugs.python.org/issue?@action=redirect&bpo=40219]: Lowered
tkinter.ttk.LabeledScale
dummy widget to prevent hiding part of the content label.bpo-37193 [https://bugs.python.org/issue?@action=redirect&bpo=37193]: Fixed memory leak in
socketserver.ThreadingMixIn
introduced in Python 3.7.bpo-39068 [https://bugs.python.org/issue?@action=redirect&bpo=39068]: Fix initialization race condition in
a85encode()
andb85encode()
inbase64
. Patch by Brandon Stansbury.
文档
bpo-17140 [https://bugs.python.org/issue?@action=redirect&bpo=17140]: Add documentation for the
multiprocessing.pool.ThreadPool
class.bpo-34398 [https://bugs.python.org/issue?@action=redirect&bpo=34398]: Prominently feature listings from the glossary in documentation search results. Patch by Ammar Askar.
测试
bpo-42794 [https://bugs.python.org/issue?@action=redirect&bpo=42794]: Update test_nntplib to use official group name of news.aioe.org for testing. Patch by Donghee Na.
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Skip some asyncio tests on VxWorks.
bpo-42641 [https://bugs.python.org/issue?@action=redirect&bpo=42641]: Enhance
test_select.test_select()
: it now takes 500 milliseconds rather than 10 seconds. Use Python rather than a shell to make the test more portable.bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Skip some tests in testall_chown_common() on VxWorks.
bpo-42199 [https://bugs.python.org/issue?@action=redirect&bpo=42199]: Fix bytecode helper assertNotInBytecode.
bpo-41443 [https://bugs.python.org/issue?@action=redirect&bpo=41443]: Add more attribute checking in test_posix.py
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Disable os.popen and impacted tests on VxWorks
bpo-41439 [https://bugs.python.org/issue?@action=redirect&bpo=41439]: Port test_ssl and test_uuid to VxWorks RTOS.
构建
bpo-42692 [https://bugs.python.org/issue?@action=redirect&bpo=42692]: Fix __builtin_available check on older compilers. Patch by Joshua Root.
bpo-27640 [https://bugs.python.org/issue?@action=redirect&bpo=27640]: Added
--disable-test-modules
option to theconfigure
script: don't build nor install test modules. Patch by Xavier de Gaye, Thomas Petazzoni and Peixing Xin.bpo-42604 [https://bugs.python.org/issue?@action=redirect&bpo=42604]: Now all platforms use a value for the "EXT_SUFFIX" build variable derived from SOABI (for instance in freeBSD, "EXT_SUFFIX" is now ".cpython-310d.so" instead of ".so"). Previously only Linux, Mac and VxWorks were using a value for "EXT_SUFFIX" that included "SOABI".
bpo-42598 [https://bugs.python.org/issue?@action=redirect&bpo=42598]: Fix implicit function declarations in configure which could have resulted in incorrect configuration checks. Patch contributed by Joshua Root.
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Enable libpython3.so for VxWorks.
bpo-29076 [https://bugs.python.org/issue?@action=redirect&bpo=29076]: Add fish shell support to macOS installer.
macOS
bpo-42361 [https://bugs.python.org/issue?@action=redirect&bpo=42361]: Update macOS installer build to use Tcl/Tk 8.6.11 (rc2, expected to be final release).
bpo-41837 [https://bugs.python.org/issue?@action=redirect&bpo=41837]: Update macOS installer build to use OpenSSL 1.1.1i.
bpo-42584 [https://bugs.python.org/issue?@action=redirect&bpo=42584]: Update macOS installer to use SQLite 3.34.0.
工具/示例
bpo-42726 [https://bugs.python.org/issue?@action=redirect&bpo=42726]: Fixed Python 3 compatibility issue with gdb/libpython.py handling of attribute dictionaries.
bpo-42613 [https://bugs.python.org/issue?@action=redirect&bpo=42613]: Fix
freeze.py
tool to use the prope config and library directories. Patch by Victor Stinner.