C API
bpo-42591 [https://bugs.python.org/issue?@action=redirect&bpo=42591]: Export the
Py_FrozenMain()
function: fix a Python 3.9.0 regression. Python 3.9 uses-fvisibility=hidden
and the function was not exported explicitly and so not exported.bpo-32381 [https://bugs.python.org/issue?@action=redirect&bpo=32381]: Remove the private
Pyfopen()
function which is no longer needed. UsePywfopen()
orPyfopen_obj()
instead. Patch by Victor Stinner.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
resource
extension module to module statebpo-42111 [https://bugs.python.org/issue?@action=redirect&bpo=42111]: Update the
xxlimited
module to be a better example of how to use the limited C API.bpo-40052 [https://bugs.python.org/issue?@action=redirect&bpo=40052]: Fix an alignment build warning/error in function
PyVectorcall_Function()
. Patch by Andreas Schneider, Antoine Pitrou and Petr Viktorin.
Python 3.10.0 alpha 3
发布日期: 2020-12-07
安全性
- bpo-40791 [https://bugs.python.org/issue?@action=redirect&bpo=40791]: Add
volatile
to the accumulator variable inhmac.compare_digest
, making constant-time-defeating optimizations less likely.
核心与内置函数
bpo-42576 [https://bugs.python.org/issue?@action=redirect&bpo=42576]:
types.GenericAlias
will now raise aTypeError
when attempting to initialize with a keyword argument. Previously, this would cause the interpreter to crash if the interpreter was compiled with debug symbols. This does not affect interpreters compiled for release. Patch by Ken Jin.bpo-42536 [https://bugs.python.org/issue?@action=redirect&bpo=42536]: Several builtin and standard library types now ensure that their internal result tuples are always tracked by the garbage collector:
之前,它们可能会被前一次垃圾回收取消追踪。 由 Brandt Bucher 提供补丁。
bpo-42500 [https://bugs.python.org/issue?@action=redirect&bpo=42500]: Improve handling of exceptions near recursion limit. Converts a number of Fatal Errors in RecursionErrors.
bpo-42246 [https://bugs.python.org/issue?@action=redirect&bpo=42246]: PEP 626: After a return, the f_lineno attribute of a frame is always the last line executed.
bpo-42435 [https://bugs.python.org/issue?@action=redirect&bpo=42435]: Speed up comparison of bytes objects with non-bytes objects when option
-b
is specified. Speed up comparison of bytarray objects with non-buffer object.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_warnings
extension module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]). Patch by Victor Stinner.bpo-41686 [https://bugs.python.org/issue?@action=redirect&bpo=41686]: On Windows, the
SIGINT
event,_PyOS_SigintEvent()
, is now created even if Python is configured to not install signal handlers (ifPyConfig.install_signal_handlers
equals to 0, orPy_InitializeEx(0)
).bpo-42381 [https://bugs.python.org/issue?@action=redirect&bpo=42381]: Allow assignment expressions in set literals and set comprehensions as per PEP 572. Patch by Pablo Galindo.
bpo-42202 [https://bugs.python.org/issue?@action=redirect&bpo=42202]: Change function parameters annotations internal representation to tuple of strings. Patch provided by Yurii Karabas.
bpo-42374 [https://bugs.python.org/issue?@action=redirect&bpo=42374]: Fix a regression introduced by the new parser, where an unparenthesized walrus operator was not allowed within generator expressions.
bpo-42316 [https://bugs.python.org/issue?@action=redirect&bpo=42316]: Allow an unparenthesized walrus in subscript indexes.
bpo-42349 [https://bugs.python.org/issue?@action=redirect&bpo=42349]: Make sure that the compiler front-end produces a well-formed control flow graph. Be more aggressive in the compiler backend, as it is now safe to do so.
bpo-42296 [https://bugs.python.org/issue?@action=redirect&bpo=42296]: On Windows, fix a regression in signal handling which prevented to interrupt a program using CTRL+C. The signal handler can be run in a thread different than the Python thread, in which case the test deciding if the thread can handle signals is wrong.
bpo-42332 [https://bugs.python.org/issue?@action=redirect&bpo=42332]:
types.GenericAlias
objects can now be the targets of weakrefs.bpo-42282 [https://bugs.python.org/issue?@action=redirect&bpo=42282]: Optimise constant subexpressions that appear as part of named expressions (previously the AST optimiser did not descend into named expressions). Patch by Nick Coghlan.
bpo-42266 [https://bugs.python.org/issue?@action=redirect&bpo=42266]: Fixed a bug with the LOAD_ATTR opcode cache that was not respecting monkey-patching a class-level attribute to make it a descriptor. Patch by Pablo Galindo.
bpo-40077 [https://bugs.python.org/issue?@action=redirect&bpo=40077]: Convert
queue
to use heap types.bpo-42246 [https://bugs.python.org/issue?@action=redirect&bpo=42246]: Improved accuracy of line tracing events and f_lineno attribute of Frame objects. See PEP 626 for details.
bpo-40077 [https://bugs.python.org/issue?@action=redirect&bpo=40077]: Convert
mmap
to use heap types.bpo-42233 [https://bugs.python.org/issue?@action=redirect&bpo=42233]: Allow
GenericAlias
objects to use union type expressions. This allows expressions likelist[int] | dict[float, str]
where previously aTypeError
would have been thrown. This also fixes union type expressions not deduplicatingGenericAlias
objects. (Contributed by Ken Jin in bpo-42233 [https://bugs.python.org/issue?@action=redirect&bpo=42233].)bpo-26131 [https://bugs.python.org/issue?@action=redirect&bpo=26131]: The import system triggers a
ImportWarning
when it falls back to usingload_module()
.
库
- bpo-5054 [https://bugs.python.org/issue?@action=redirect&bpo=5054]: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed. Replace the special purpose getallmatchingheaders with generic get_all method and add relevant tests.
Original Patch by Martin Panter. Modified by Senthil Kumaran.
bpo-42562 [https://bugs.python.org/issue?@action=redirect&bpo=42562]: Fix issue when dis failed to parse function that has no line numbers. Patch provided by Yurii Karabas.
bpo-17735 [https://bugs.python.org/issue?@action=redirect&bpo=17735]:
inspect.findsource()
now raisesOSError
instead ofIndexError
whenco_lineno
of a code object is greater than the file length. This can happen, for example, when a file is edited after it was imported. PR by Irit Katriel.bpo-42116 [https://bugs.python.org/issue?@action=redirect&bpo=42116]: Fix handling of trailing comments by
inspect.getsource()
.bpo-42532 [https://bugs.python.org/issue?@action=redirect&bpo=42532]: Remove unexpected call of
__bool__
when passing aspec_arg
argument to a Mock.bpo-38200 [https://bugs.python.org/issue?@action=redirect&bpo=38200]: Added itertools.pairwise()
bpo-41818 [https://bugs.python.org/issue?@action=redirect&bpo=41818]: Fix test_master_read() so that it succeeds on all platforms that either raise OSError or return b"" upon reading from master.
bpo-42487 [https://bugs.python.org/issue?@action=redirect&bpo=42487]: ChainMap.iter no longer calls getitem on underlying maps
bpo-42482 [https://bugs.python.org/issue?@action=redirect&bpo=42482]:
TracebackException
no longer holds a reference to the exception's traceback object. Consequently, instances of TracebackException for equivalent but non-equal exceptions now compare as equal.bpo-41818 [https://bugs.python.org/issue?@action=redirect&bpo=41818]: Make test_openpty() avoid unexpected success due to number of rows and/or number of columns being == 0.
bpo-42392 [https://bugs.python.org/issue?@action=redirect&bpo=42392]: Remove loop parameter from
asyncio.subprocess
andasyncio.tasks
functions. Patch provided by Yurii Karabas.bpo-42392 [https://bugs.python.org/issue?@action=redirect&bpo=42392]: Remove loop parameter from
asyncio.open_connection
andasyncio.start_server
functions. Patch provided by Yurii Karabas.bpo-28468 [https://bugs.python.org/issue?@action=redirect&bpo=28468]: Add
platform.freedesktop_os_release()
function to parse freedesktop.orgos-release
files.bpo-42299 [https://bugs.python.org/issue?@action=redirect&bpo=42299]: Removed the
formatter
module, which was deprecated in Python 3.4. It is somewhat obsolete, little used, and not tested. It was originally scheduled to be removed in Python 3.6, but such removals were delayed until after Python 2.7 EOL. Existing users should copy whatever classes they use into their code. Patch by Donghee Na and and Terry J. Reedy.bpo-26131 [https://bugs.python.org/issue?@action=redirect&bpo=26131]: Deprecate zipimport.zipimporter.load_module() in favour of exec_module().
bpo-41818 [https://bugs.python.org/issue?@action=redirect&bpo=41818]: Updated tests for the pty library. test_basic() has been changed to test_openpty(); this additionally checks if slave termios and slave winsize are being set properly by pty.openpty(). In order to add support for FreeBSD, NetBSD, OpenBSD, and Darwin, this also adds test_master_read(), which demonstrates that pty.spawn() should not depend on an OSError to exit from its copy loop.
bpo-42392 [https://bugs.python.org/issue?@action=redirect&bpo=42392]: Remove loop parameter from
__init__
in allasyncio.locks
andasyncio.Queue
classes. Patch provided by Yurii Karabas.bpo-15450 [https://bugs.python.org/issue?@action=redirect&bpo=15450]: Make
filecmp.dircmp
respect subclassing. Now thefilecmp.dircmp.subdirs
behaves as expected when subclassing dircmp.bpo-42413 [https://bugs.python.org/issue?@action=redirect&bpo=42413]: The exception
socket.timeout
is now an alias ofTimeoutError
.bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Support signal module on VxWorks.
bpo-42406 [https://bugs.python.org/issue?@action=redirect&bpo=42406]: We fixed an issue in
pickle.whichmodule
in which importingmultiprocessing
could change the how pickle identifies which module an object belongs to, potentially breaking the unpickling of those objects.bpo-42403 [https://bugs.python.org/issue?@action=redirect&bpo=42403]: Simplify the
importlib
external bootstrap code:importlib.bootstrapexternal
now uses regular imports to import builtin modules. When it is imported, the builtin__import__()
function is already fully working and so can be used to import builtin modules likesys
. Patch by Victor Stinner.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Convert _sre module types to heap types (PEP 384). Patch by Erlend E. Aasland.
bpo-42375 [https://bugs.python.org/issue?@action=redirect&bpo=42375]: subprocess module update for DragonFlyBSD support.
bpo-41713 [https://bugs.python.org/issue?@action=redirect&bpo=41713]: Port the
_signal
extension module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]). Patch by Victor Stinner and Mohamed Koubaa.bpo-37205 [https://bugs.python.org/issue?@action=redirect&bpo=37205]:
time.time()
,time.perf_counter()
andtime.monotonic()
functions can no longer fail with a Python fatal error, instead raise a regular Python exception on failure.bpo-42328 [https://bugs.python.org/issue?@action=redirect&bpo=42328]: Fixed
tkinter.ttk.Style.map()
. The function accepts now the representation of the default state as empty sequence (as returned byStyle.map()
). The structure of the result is now the same on all platform and does not depend on the value ofwantobjects
.bpo-42345 [https://bugs.python.org/issue?@action=redirect&bpo=42345]: Fix various issues with
typing.Literal
parameter handling (flatten, deduplicate, use type to cache key). Patch provided by Yurii Karabas.bpo-37205 [https://bugs.python.org/issue?@action=redirect&bpo=37205]:
time.perf_counter()
on Windows andtime.monotonic()
on macOS are now system-wide. Previously, they used an offset computed at startup to reduce the precision loss caused by the float type. Usetime.perf_counter_ns()
andtime.monotonic_ns()
added in Python 3.7 to avoid this precision loss.bpo-42318 [https://bugs.python.org/issue?@action=redirect&bpo=42318]: Fixed support of non-BMP characters in
tkinter
on macOS.bpo-42350 [https://bugs.python.org/issue?@action=redirect&bpo=42350]: Fix the
threading.Thread
class at fork: do nothing if the thread is already stopped (ex: fork called at Python exit). Previously, an error was logged in the child process.bpo-42333 [https://bugs.python.org/issue?@action=redirect&bpo=42333]: Port _ssl extension module to heap types.
bpo-42014 [https://bugs.python.org/issue?@action=redirect&bpo=42014]: The
onerror
callback fromshutil.rmtree
now receives correct function whenos.open
fails.bpo-42237 [https://bugs.python.org/issue?@action=redirect&bpo=42237]: Fix
os.sendfile()
on illumos.bpo-42308 [https://bugs.python.org/issue?@action=redirect&bpo=42308]: Add
threading.__excepthook__
to allow retrieving the original value ofthreading.excepthook()
in case it is set to a broken or a different value. Patch by Mario Corchero.bpo-42131 [https://bugs.python.org/issue?@action=redirect&bpo=42131]: Implement PEP 451/spec methods on zipimport.zipimporter: find_spec(), create_module(), and exec_module().
This also allows for the documented deprecation of find_loader(), find_module(), and load_module().
bpo-41877 [https://bugs.python.org/issue?@action=redirect&bpo=41877]: Mock objects which are not unsafe will now raise an AttributeError if an attribute with the prefix asert, aseert, or assrt is accessed, in addition to this already happening for the prefixes assert or assret.
bpo-42264 [https://bugs.python.org/issue?@action=redirect&bpo=42264]:
sqlite3.OptimizedUnicode
has been undocumented and obsolete since Python 3.3, when it was made an alias tostr
. It is now deprecated, scheduled for removal in Python 3.12.bpo-42251 [https://bugs.python.org/issue?@action=redirect&bpo=42251]: Added
threading.gettrace()
andthreading.getprofile()
to retrieve the functions set bythreading.settrace()
andthreading.setprofile()
respectively. Patch by Mario Corchero.bpo-42249 [https://bugs.python.org/issue?@action=redirect&bpo=42249]: Fixed writing binary Plist files larger than 4 GiB.
bpo-42236 [https://bugs.python.org/issue?@action=redirect&bpo=42236]: On Unix, the
os.device_encoding()
function now returns'UTF-8'
rather than the device encoding if the Python UTF-8 Mode is enabled.bpo-41754 [https://bugs.python.org/issue?@action=redirect&bpo=41754]: webbrowser: Ignore NotADirectoryError when calling
xdg-settings
.bpo-42183 [https://bugs.python.org/issue?@action=redirect&bpo=42183]: Fix a stack overflow error for asyncio Task or Future repr().
在 Task 或 Future 递归返回自身的情形下会导致栈溢出。
bpo-42140 [https://bugs.python.org/issue?@action=redirect&bpo=42140]: Improve asyncio.wait function to create the futures set just one time.
bpo-42133 [https://bugs.python.org/issue?@action=redirect&bpo=42133]: Update various modules in the stdlib to fall back on
__spec__.loader
when__loader__
isn't defined on a module.bpo-26131 [https://bugs.python.org/issue?@action=redirect&bpo=26131]: The
load_module()
methods found inimportlib
now trigger aDeprecationWarning
.bpo-39825 [https://bugs.python.org/issue?@action=redirect&bpo=39825]: Windows: Change
sysconfig.getconfigvar('EXT_SUFFIX')
to the expected fullplatform_tag.extension
format. Previously it was hardcoded to.pyd
, now it is compatible withdistutils.sysconfig
and will result in something like.cp38-win_amd64.pyd
. This brings windows into conformance with the other platforms.bpo-26389 [https://bugs.python.org/issue?@action=redirect&bpo=26389]: The
traceback.format_exception()
,traceback.format_exception_only()
, andtraceback.print_exception()
functions can now take an exception object as a positional-only argument.bpo-41889 [https://bugs.python.org/issue?@action=redirect&bpo=41889]: Enum: fix regression involving inheriting a multiply inherited enum
bpo-41861 [https://bugs.python.org/issue?@action=redirect&bpo=41861]: Convert
sqlite3
to use heap types (PEP 384). Patch by Erlend E. Aasland.bpo-40624 [https://bugs.python.org/issue?@action=redirect&bpo=40624]: Added support for the XPath
!=
operator in xml.etreebpo-28850 [https://bugs.python.org/issue?@action=redirect&bpo=28850]: Fix
pprint.PrettyPrinter.format()
overrides being ignored for contents of small containers. Thepprint._safe_repr()
function was removed.bpo-41625 [https://bugs.python.org/issue?@action=redirect&bpo=41625]: Expose the
splice()
asos.splice()
in theos
module. Patch by Pablo Galindobpo-34215 [https://bugs.python.org/issue?@action=redirect&bpo=34215]: Clarify the error message for
asyncio.IncompleteReadError
whenexpected
isNone
.bpo-41543 [https://bugs.python.org/issue?@action=redirect&bpo=41543]: Add async context manager support for contextlib.nullcontext.
bpo-21041 [https://bugs.python.org/issue?@action=redirect&bpo=21041]:
pathlib.PurePath.parents
now supports negative indexing. Patch contributed by Yaroslav Pankovych.bpo-41332 [https://bugs.python.org/issue?@action=redirect&bpo=41332]: Added missing connect_accepted_socket() method to
asyncio.AbstractEventLoop
.bpo-12800 [https://bugs.python.org/issue?@action=redirect&bpo=12800]: Extracting a symlink from a tarball should succeed and overwrite the symlink if it already exists. The fix is to remove the existing file or symlink before extraction. Based on patch by Chris AtLee, Jeffrey Kintscher, and Senthil Kumaran.
bpo-40968 [https://bugs.python.org/issue?@action=redirect&bpo=40968]:
urllib.request
andhttp.client
now sendhttp/1.1
ALPN extension during TLS handshake when no custom context is supplied.bpo-41001 [https://bugs.python.org/issue?@action=redirect&bpo=41001]: Add
os.eventfd()
to provide a low level interface for Linux's event notification file descriptor.bpo-40816 [https://bugs.python.org/issue?@action=redirect&bpo=40816]: Add AsyncContextDecorator to contextlib to support async context manager as a decorator.
bpo-40550 [https://bugs.python.org/issue?@action=redirect&bpo=40550]: Fix time-of-check/time-of-action issue in subprocess.Popen.send_signal.
bpo-39411 [https://bugs.python.org/issue?@action=redirect&bpo=39411]: Add an
is_async
identifier topyclbr
'sFunction
objects. Patch by Batuhan Taskayabpo-35498 [https://bugs.python.org/issue?@action=redirect&bpo=35498]: Add slice support to
pathlib.PurePath.parents
.
文档
bpo-42238 [https://bugs.python.org/issue?@action=redirect&bpo=42238]: Tentative to deprecate
make suspicious
by first removing it from the CI and documentation builds, but keeping it around for manual uses.bpo-42153 [https://bugs.python.org/issue?@action=redirect&bpo=42153]: Fix the URL for the IMAP protocol documents.
bpo-41028 [https://bugs.python.org/issue?@action=redirect&bpo=41028]: Language and version switchers, previously maintained in every cpython branches, are now handled by docsbuild-script.
测试
bpo-41473 [https://bugs.python.org/issue?@action=redirect&bpo=41473]: Re-enable test_gdb on gdb 9.2 and newer: https://bugzilla.redhat.com/show_bug.cgi?id=1866884 bug is fixed in gdb 10.1.
bpo-42553 [https://bugs.python.org/issue?@action=redirect&bpo=42553]: Fix
test_asyncio.test_call_later()
race condition: don't measure asyncio performance in thecall_later()
unit test. The test failed randomly on the CI.bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Fix test_netrc on VxWorks: create temporary directories using temp_cwd().
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: skip test_getaddrinfo_ipv6_scopeid_symbolic and test_getnameinfo_ipv6_scopeid_symbolic on VxWorks
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: skip test_test of test_mailcap on VxWorks
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: add shell requirement for test_pipes
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: skip some tests related to fifo on VxWorks
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Fix test_doctest.py failures for VxWorks.
bpo-40754 [https://bugs.python.org/issue?@action=redirect&bpo=40754]: Include
_testinternalcapi
module in Windows installer for test suitebpo-41561 [https://bugs.python.org/issue?@action=redirect&bpo=41561]: test_ssl: skip test_min_max_version_mismatch when TLS 1.0 is not available
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Fix os module failures for VxWorks RTOS.
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: Fix fifo test cases for VxWorks RTOS.
构建
bpo-31904 [https://bugs.python.org/issue?@action=redirect&bpo=31904]: remove libnet dependency from detect_socket() for VxWorks
bpo-42398 [https://bugs.python.org/issue?@action=redirect&bpo=42398]: Fix a race condition in "make regen-all" when make -jN option is used to run jobs in parallel. The clinic.py script now only use atomic write to write files. Moveover, generated files are now left unchanged if the content does not change, to not change the file modification time.
bpo-41617 [https://bugs.python.org/issue?@action=redirect&bpo=41617]: Fix building
pycore_bitutils.h
internal header on old clang version without__builtin_bswap16()
(ex: Xcode 4.6.3 on Mac OS X 10.7). Patch by Joshua Root and Victor Stinner.bpo-38823 [https://bugs.python.org/issue?@action=redirect&bpo=38823]: It is no longer possible to build the
_ctypes
extension module withoutwchar_t
type: removeCTYPES_UNICODE
macro. Anyway, thewchar_t
type is required to build Python. Patch by Victor Stinner.bpo-42087 [https://bugs.python.org/issue?@action=redirect&bpo=42087]: Support was removed for AIX 5.3 and below. See bpo-40680 [https://bugs.python.org/issue?@action=redirect&bpo=40680].
bpo-40998 [https://bugs.python.org/issue?@action=redirect&bpo=40998]: Addressed three compiler warnings found by undefined behavior sanitizer (ubsan).
Windows
bpo-42120 [https://bugs.python.org/issue?@action=redirect&bpo=42120]: Remove macro definition of
copysign
(to_copysign
) in headers.bpo-38506 [https://bugs.python.org/issue?@action=redirect&bpo=38506]: The Windows launcher now properly handles Python 3.10 when listing installed Python versions.
macOS
bpo-42504 [https://bugs.python.org/issue?@action=redirect&bpo=42504]: Fix build on macOS Big Sur when MACOSX_DEPLOYMENT_TARGET=11
bpo-41116 [https://bugs.python.org/issue?@action=redirect&bpo=41116]: Ensure distutils.unixxcompiler.find_library_file can find system provided libraries on macOS 11.
bpo-41100 [https://bugs.python.org/issue?@action=redirect&bpo=41100]: Add support for macOS 11 and Apple Silicon systems.
It is now possible to build "Universal 2" binaries using "—enable-universalsdk —with-universal-archs=universal2".
Binaries build on later macOS versions can be deployed back to older versions (tested up to macOS 10.9), when using the correct deployment target. This is tested using Xcode 11 and later.
bpo-42232 [https://bugs.python.org/issue?@action=redirect&bpo=42232]: Added Darwin specific madvise options to mmap module.
bpo-38443 [https://bugs.python.org/issue?@action=redirect&bpo=38443]: The
--enable-universalsdk
and--with-universal-archs
options for the configure script now check that the specified architectures can be used.
IDLE
bpo-42508 [https://bugs.python.org/issue?@action=redirect&bpo=42508]: Keep IDLE running on macOS. Remove obsolete workaround that prevented running files with shortcuts when using new universal2 installers built on macOS 11.
bpo-42426 [https://bugs.python.org/issue?@action=redirect&bpo=42426]: Fix reporting offset of the RE error in searchengine.
bpo-42415 [https://bugs.python.org/issue?@action=redirect&bpo=42415]: Get docstrings for IDLE calltips more often by using inspect.getdoc.
工具/示例
bpo-42212 [https://bugs.python.org/issue?@action=redirect&bpo=42212]: The smelly.py script now also checks the Python dynamic library and extension modules, not only the Python static library. Make also the script more verbose: explain what it does.
bpo-36310 [https://bugs.python.org/issue?@action=redirect&bpo=36310]: Allow
Tools/i18n/pygettext.py
to detect calls togettext
in fstrings.
C API
bpo-42423 [https://bugs.python.org/issue?@action=redirect&bpo=42423]: The
PyType_FromSpecWithBases()
andPyType_FromModuleAndSpec()
functions now accept a single class as the bases argument.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
select
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port _posixsubprocess extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port _posixshmem extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port _struct extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
spwd
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
gc
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port _queue extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])
bpo-39573 [https://bugs.python.org/issue?@action=redirect&bpo=39573]: Convert
Py_TYPE()
andPy_SIZE()
back to macros to allow using them as an l-value. Many third party C extension modules rely on the ability of using Py_TYPE() and Py_SIZE() to set an object type and size:Py_TYPE(obj) = type;
andPy_SIZE(obj) = size;
.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
symtable
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
grp
andpwd
extension modules to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port _random extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port _hashlib extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/])
bpo-41713 [https://bugs.python.org/issue?@action=redirect&bpo=41713]: Removed the undocumented
PyOS_InitInterrupts()
function. Initializing Python already implicitly installs signal handlers: seePyConfig.install_signal_handlers
. Patch by Victor Stinner.bpo-40170 [https://bugs.python.org/issue?@action=redirect&bpo=40170]: The
Py_TRASHCAN_BEGIN
macro no longer accesses PyTypeObject attributes, but now can get the condition by calling the new privatePyTrashcond()
function which hides implementation details.bpo-42260 [https://bugs.python.org/issue?@action=redirect&bpo=42260]:
Py_GetPath()
,Py_GetPrefix()
,Py_GetExecPrefix()
,Py_GetProgramFullPath()
,Py_GetPythonHome()
andPy_GetProgramName()
functions now returnNULL
if called beforePy_Initialize()
(before Python is initialized). Use the new Python Initialization Configuration API to get the Python Path Configuration.. Patch by Victor Stinner.bpo-42260 [https://bugs.python.org/issue?@action=redirect&bpo=42260]: The
PyConfig_Read()
function now only parsesPyConfig.argv
arguments once:PyConfig.parse_argv
is set to2
after arguments are parsed. Since Python arguments are strippped fromPyConfig.argv
, parsing arguments twice would parse the application options as Python options.bpo-42262 [https://bugs.python.org/issue?@action=redirect&bpo=42262]: Added
Py_NewRef()
andPy_XNewRef()
functions to increment the reference count of an object and return the object. Patch by Victor Stinner.bpo-42260 [https://bugs.python.org/issue?@action=redirect&bpo=42260]: When
Py_Initialize()
is called twice, the second call now updates moresys
attributes for the configuration, rather than onlysys.argv
. Patch by Victor Stinner.bpo-41832 [https://bugs.python.org/issue?@action=redirect&bpo=41832]: The
PyType_FromModuleAndSpec()
function now accepts NULLtp_doc
slot.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Added
PyModule_AddObjectRef()
function: similar toPyModule_AddObject()
but don't steal a reference to the value on success. Patch by Victor Stinner.bpo-42171 [https://bugs.python.org/issue?@action=redirect&bpo=42171]: The
METH_FASTCALL
calling convention is added to the limited API. The functionsPyModule_AddType()
,PyType_FromModuleAndSpec()
,PyType_GetModule()
andPyType_GetModuleState()
are added to the limited API on Windows.bpo-42085 [https://bugs.python.org/issue?@action=redirect&bpo=42085]: Add dedicated entry to PyAsyncMethods for sending values
bpo-41073 [https://bugs.python.org/issue?@action=redirect&bpo=41073]:
PyType_GetSlot()
can now accept static types.bpo-30459 [https://bugs.python.org/issue?@action=redirect&bpo=30459]:
PyList_SET_ITEM()
,PyTuple_SET_ITEM()
andPyCell_SET()
macros can no longer be used as l-value or r-value. For example,x = PyList_SET_ITEM(a, b, c)
andPyList_SET_ITEM(a, b, c) = x
now fail with a compiler error. It prevents bugs likeif (PyList_SET_ITEM (a, b, c) < 0) …
test. Patch by Zackery Spytz and Victor Stinner.
Python 3.10.0 alpha 2
发布日期: 2020-11-03
安全性
bpo-42103 [https://bugs.python.org/issue?@action=redirect&bpo=42103]: Prevented potential DoS attack via CPU and RAM exhaustion when processing malformed Apple Property List files in binary format.
bpo-42051 [https://bugs.python.org/issue?@action=redirect&bpo=42051]: The
plistlib
module no longer accepts entity declarations in XML plist files to avoid XML vulnerabilities. This should not affect users as entity declarations are not used in regular plist files.
核心与内置函数
bpo-42236 [https://bugs.python.org/issue?@action=redirect&bpo=42236]: If the
nl_langinfo(CODESET)
function returns an empty string, Python now uses UTF-8 as the filesystem encoding. Patch by Victor Stinner.bpo-42218 [https://bugs.python.org/issue?@action=redirect&bpo=42218]: Fixed a bug in the PEG parser that was causing crashes in debug mode. Now errors are checked in left-recursive rules to avoid cases where such errors do not get handled in time and appear as long-distance crashes in other places.
bpo-42214 [https://bugs.python.org/issue?@action=redirect&bpo=42214]: Fixed a possible crash in the PEG parser when checking for the '!=' token in the
barryasflufl
rule. Patch by Pablo Galindo.bpo-42206 [https://bugs.python.org/issue?@action=redirect&bpo=42206]: Propagate and raise the errors caused by
PyAST_Validate()
in the parser.bpo-41796 [https://bugs.python.org/issue?@action=redirect&bpo=41796]: The
ast
module internal state is now per interpreter. Patch by Victor Stinner.bpo-42143 [https://bugs.python.org/issue?@action=redirect&bpo=42143]: Fix handling of errors during creation of
PyFunctionObject
, which resulted in operations on uninitialized memory. Patch by Yonatan Goldschmidt.bpo-41659 [https://bugs.python.org/issue?@action=redirect&bpo=41659]: Fix a bug in the parser, where a curly brace following a
primary
didn't fail immediately. This led to invalid expressions likea {b}
to throw aSyntaxError
with a wrong offset, or invalid expressions ending with a curly brace likea {
to not fail immediately in the REPL.bpo-42150 [https://bugs.python.org/issue?@action=redirect&bpo=42150]: Fix possible buffer overflow in the new parser when checking for continuation lines. Patch by Pablo Galindo.
bpo-42123 [https://bugs.python.org/issue?@action=redirect&bpo=42123]: Run the parser two times. On the first run, disable all the rules that only generate better error messages to gain performance. If there's a parse failure, run the parser a second time with those enabled.
bpo-42093 [https://bugs.python.org/issue?@action=redirect&bpo=42093]: The
LOAD_ATTR
instruction now uses new "per opcode cache" mechanism and it is about 36% faster now. Patch by Pablo Galindo and Yury Selivanov.bpo-42030 [https://bugs.python.org/issue?@action=redirect&bpo=42030]: Support for the legacy AIX-specific shared library loading support has been removed. All versions of AIX since 4.3 have supported and defaulted to using the common Unix mechanism instead.
bpo-41984 [https://bugs.python.org/issue?@action=redirect&bpo=41984]: The garbage collector now tracks all user-defined classes. Patch by Brandt Bucher.
bpo-41993 [https://bugs.python.org/issue?@action=redirect&bpo=41993]: Fixed potential issues with removing not completely initialized module from
sys.modules
when import fails.bpo-41979 [https://bugs.python.org/issue?@action=redirect&bpo=41979]: Star-unpacking is now allowed for with item's targets in the PEG parser.
bpo-41974 [https://bugs.python.org/issue?@action=redirect&bpo=41974]: Removed special methods
__int__
,__float__
,__floordiv__
,__mod__
,__divmod__
,__rfloordiv__
,__rmod__
and__rdivmod__
of thecomplex
class. They always raised aTypeError
.bpo-41902 [https://bugs.python.org/issue?@action=redirect&bpo=41902]: Micro optimization when compute
sq_item
andmp_subscript
ofrange
. Patch by Donghee Na.bpo-41894 [https://bugs.python.org/issue?@action=redirect&bpo=41894]: When loading a native module and a load failure occurs, prevent a possible UnicodeDecodeError when not running in a UTF-8 locale by decoding the load error message using the current locale's encoding.
bpo-41902 [https://bugs.python.org/issue?@action=redirect&bpo=41902]: Micro optimization for range.index if step is 1. Patch by Donghee Na.
bpo-41435 [https://bugs.python.org/issue?@action=redirect&bpo=41435]: Add
sys._current_exceptions()
function to retrieve a dictionary mapping each thread's identifier to the topmost exception currently active in that thread at the time the function is called.bpo-38605 [https://bugs.python.org/issue?@action=redirect&bpo=38605]: Enable
from __future__ import annotations
( PEP 563 [https://peps.python.org/pep-0563/]) by default. The values found in__annotations__
dicts are now strings, for example{"x": "int"}
instead of{"x": int}
.
库
bpo-35455 [https://bugs.python.org/issue?@action=redirect&bpo=35455]: On Solaris,
thread_time()
is now implemented withgethrvtime()
becauseclock_gettime(CLOCK_THREAD_CPUTIME_ID)
is not always available. Patch by Jakub Kulik.bpo-42233 [https://bugs.python.org/issue?@action=redirect&bpo=42233]: The
repr()
oftyping
types containing Generic Alias Types previously did not show the parameterized types in theGenericAlias
. They have now been changed to do so.bpo-29566 [https://bugs.python.org/issue?@action=redirect&bpo=29566]:
binhex.binhex()
consistently writes macOS 9 line endings.bpo-26789 [https://bugs.python.org/issue?@action=redirect&bpo=26789]: The
logging.FileHandler
class now keeps a reference to the builtinopen()
function to be able to open or reopen the file during Python finalization. Fix errors like:NameError: name 'open' is not defined
. Patch by Victor Stinner.bpo-42157 [https://bugs.python.org/issue?@action=redirect&bpo=42157]: Removed the
unicodedata.ucnhash_CAPI
attribute which was an internal PyCapsule object. The related privatePyUnicodeName_CAPI
structure was moved to the internal C API. Patch by Victor Stinner.bpo-42157 [https://bugs.python.org/issue?@action=redirect&bpo=42157]: Convert the
unicodedata
extension module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]) and convert theunicodedata.UCD
static type to a heap type. Patch by Mohamed Koubaa and Victor Stinner.bpo-42146 [https://bugs.python.org/issue?@action=redirect&bpo=42146]: Fix memory leak in
subprocess.Popen()
in case an uid (gid) specified inuser
(group
,extra_groups
) overflowsuid_t
(gid_t
).bpo-42103 [https://bugs.python.org/issue?@action=redirect&bpo=42103]:
InvalidFileException
andRecursionError
are now the only errors caused by loading malformed binary Plist file (previously ValueError and TypeError could be raised in some specific cases).bpo-41490 [https://bugs.python.org/issue?@action=redirect&bpo=41490]: In
importlib.resources
,.path
method is more aggressive about releasing handles to zipfile objects early, enabling use-cases like certifi to leave the context open but delete the underlying zip file.bpo-41052 [https://bugs.python.org/issue?@action=redirect&bpo=41052]: Pickling heap types implemented in C with protocols 0 and 1 raises now an error instead of producing incorrect data.
bpo-42089 [https://bugs.python.org/issue?@action=redirect&bpo=42089]: In
importlib.metadata.PackageNotFoundError
, make reference to the package metadata being missing to improve the user experience.bpo-41491 [https://bugs.python.org/issue?@action=redirect&bpo=41491]: plistlib: fix parsing XML plists with hexadecimal integer values
bpo-42065 [https://bugs.python.org/issue?@action=redirect&bpo=42065]: Fix an incorrectly formatted error from
codecs.charmapdecode()
when called with a mapped value outside the range of valid Unicode code points. PR by Max Bernstein.bpo-41966 [https://bugs.python.org/issue?@action=redirect&bpo=41966]: Fix pickling pure Python
datetime.time
subclasses. Patch by Dean Inwood.bpo-19270 [https://bugs.python.org/issue?@action=redirect&bpo=19270]:
sched.scheduler.cancel()
will now cancel the correct event, if two events with same priority are scheduled for the same time. Patch by Bar Harel.bpo-28660 [https://bugs.python.org/issue?@action=redirect&bpo=28660]:
textwrap.wrap()
now attempts to break long words after hyphens whenbreak_long_words=True
andbreak_on_hyphens=True
.bpo-35823 [https://bugs.python.org/issue?@action=redirect&bpo=35823]: Use
vfork()
instead offork()
forsubprocess.Popen()
on Linux to improve performance in cases where it is deemed safe.bpo-42043 [https://bugs.python.org/issue?@action=redirect&bpo=42043]: Add support for
zipfile.Path
inheritance.zipfile.Path.is_file()
now returns False for nonexistent names.zipfile.Path
objects now expose a.filename
attribute and rely on that to resolve.name
and.parent
when thePath
object is at the root of the zipfile.bpo-42021 [https://bugs.python.org/issue?@action=redirect&bpo=42021]: Fix possible ref leaks in
sqlite3
module init.bpo-39101 [https://bugs.python.org/issue?@action=redirect&bpo=39101]: Fixed tests using IsolatedAsyncioTestCase from hanging on BaseExceptions.
bpo-41976 [https://bugs.python.org/issue?@action=redirect&bpo=41976]: Fixed a bug that was causing
ctypes.util.find_library()
to returnNone
when triying to locate a library in an environment when gcc>=9 is available andldconfig
is not. Patch by Pablo Galindobpo-41943 [https://bugs.python.org/issue?@action=redirect&bpo=41943]: Fix bug where TestCase.assertLogs doesn't correctly filter messages by level.
bpo-41923 [https://bugs.python.org/issue?@action=redirect&bpo=41923]: Implement PEP 613 [https://peps.python.org/pep-0613/], introducing
typing.TypeAlias
annotation.bpo-41905 [https://bugs.python.org/issue?@action=redirect&bpo=41905]: A new function in abc: update_abstractmethods to re-calculate an abstract class's abstract status. In addition, dataclass has been changed to call this function.
bpo-23706 [https://bugs.python.org/issue?@action=redirect&bpo=23706]: Added newline parameter to
pathlib.Path.write_text()
.bpo-41876 [https://bugs.python.org/issue?@action=redirect&bpo=41876]: Tkinter font class repr uses font name
bpo-41831 [https://bugs.python.org/issue?@action=redirect&bpo=41831]:
str()
for thetype
attribute of thetkinter.Event
object always returns now the numeric code returned by Tk instead of the name of the event type.bpo-39337 [https://bugs.python.org/issue?@action=redirect&bpo=39337]:
encodings.normalize_encoding()
now ignores nonASCII characters.bpo-41747 [https://bugs.python.org/issue?@action=redirect&bpo=41747]: Ensure all methods that generated from
dataclasses.dataclass()
objects now have the proper__qualname__
attribute referring to the class they belong to. Patch by Batuhan Taskaya.bpo-30681 [https://bugs.python.org/issue?@action=redirect&bpo=30681]: Handle exceptions caused by unparsable date headers when using email "default" policy. Patch by Tim Bell, Georges Toth
bpo-41586 [https://bugs.python.org/issue?@action=redirect&bpo=41586]: Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module. Allow setting pipesize on subprocess.Popen.
bpo-41229 [https://bugs.python.org/issue?@action=redirect&bpo=41229]: Add
contextlib.aclosing
for deterministic cleanup of async generators which is analogous tocontextlib.closing
for non-async generators. Patch by Joongi Kim and John Belmonte.bpo-16396 [https://bugs.python.org/issue?@action=redirect&bpo=16396]: Allow
ctypes.wintypes
to be imported on non-Windows systems.bpo-4356 [https://bugs.python.org/issue?@action=redirect&bpo=4356]: Add a key function to the bisect module.
bpo-40592 [https://bugs.python.org/issue?@action=redirect&bpo=40592]:
shutil.which()
now ignores empty entries inPATHEXT
instead of treating them as a match.bpo-40492 [https://bugs.python.org/issue?@action=redirect&bpo=40492]: Fix
--outfile
forcProfile
/profile
not writing the output file in the original directory when the program being profiled changes the working directory. PR by Anthony Sottile.bpo-34204 [https://bugs.python.org/issue?@action=redirect&bpo=34204]: The
shelve
module now usespickle.DEFAULT_PROTOCOL
by default instead ofpickle
protocol3
.bpo-27321 [https://bugs.python.org/issue?@action=redirect&bpo=27321]: Fixed KeyError exception when flattening an email to a string attempts to replace a nonexistent Content-Transfer-Encoding header.
bpo-38976 [https://bugs.python.org/issue?@action=redirect&bpo=38976]: The
http.cookiejar
module now supports the parsing of cookies in CURL-style cookiejar files through MozillaCookieJar on all platforms. Previously, such cookie entries would be silently ignored when loading a cookiejar with such entries.
Additionally, the HTTP Only attribute is persisted in the object, and will be correctly written to file if the MozillaCookieJar object is subsequently dumped.
文档
bpo-42061 [https://bugs.python.org/issue?@action=redirect&bpo=42061]: Document format functionality for IP addresses.
bpo-41910 [https://bugs.python.org/issue?@action=redirect&bpo=41910]: Document the default implementation of
object.__eq__
.bpo-42010 [https://bugs.python.org/issue?@action=redirect&bpo=42010]: Clarify that subscription expressions are also valid for certain classes and types in the standard library, and for user-defined classes and types if the classmethod
__class_getitem__()
is provided.bpo-41805 [https://bugs.python.org/issue?@action=redirect&bpo=41805]: Documented generic alias type and
types.GenericAlias
. Also added an entry in glossary for generic types.bpo-39693 [https://bugs.python.org/issue?@action=redirect&bpo=39693]: Fix tarfile's extractfile documentation
bpo-39416 [https://bugs.python.org/issue?@action=redirect&bpo=39416]: Document some restrictions on the default string representations of numeric classes.
测试
bpo-41739 [https://bugs.python.org/issue?@action=redirect&bpo=41739]: Fix test_logging.test_race_betweensettarget_and_flush(): the test now waits until all threads complete to avoid leaking running threads.
bpo-41970 [https://bugs.python.org/issue?@action=redirect&bpo=41970]: Avoid a test failure in
test_lib2to3
if the module has already imported at the time the test executes. Patch by Pablo Galindo.bpo-41944 [https://bugs.python.org/issue?@action=redirect&bpo=41944]: Tests for CJK codecs no longer call
eval()
on content received via HTTP.bpo-41306 [https://bugs.python.org/issue?@action=redirect&bpo=41306]: Fixed a failure in
test_tk.test_widgets.ScaleTest
happening when executing the test with Tk 8.6.10.
构建
- bpo-38980 [https://bugs.python.org/issue?@action=redirect&bpo=38980]: Add
-fno-semantic-interposition
to both the compile and link line when building with--enable-optimizations
. Patch by Victor Stinner and Pablo Galindo.
Windows
bpo-38439 [https://bugs.python.org/issue?@action=redirect&bpo=38439]: Updates the icons for IDLE in the Windows Store package.
bpo-38252 [https://bugs.python.org/issue?@action=redirect&bpo=38252]: Use 8-byte step to detect ASCII sequence in 64-bit Windows build.
bpo-39107 [https://bugs.python.org/issue?@action=redirect&bpo=39107]: Update Tcl and Tk to 8.6.10 in Windows installer.
bpo-41557 [https://bugs.python.org/issue?@action=redirect&bpo=41557]: Update Windows installer to use SQLite 3.33.0.
bpo-38324 [https://bugs.python.org/issue?@action=redirect&bpo=38324]: Avoid Unicode errors when accessing certain locale data on Windows.
macOS
- bpo-41471 [https://bugs.python.org/issue?@action=redirect&bpo=41471]: Ignore invalid prefix lengths in system proxy excludes.
IDLE
bpo-33987 [https://bugs.python.org/issue?@action=redirect&bpo=33987]: Mostly finish using ttk widgets, mainly for editor, settings, and searches. Some patches by Mark Roseman.
bpo-40511 [https://bugs.python.org/issue?@action=redirect&bpo=40511]: Typing opening and closing parentheses inside the parentheses of a function call will no longer cause unnecessary "flashing" off and on of an existing open calltip, e.g. when typed in a string literal.
bpo-38439 [https://bugs.python.org/issue?@action=redirect&bpo=38439]: Add a 256×256 pixel IDLE icon to the Windows .ico file. Created by Andrew Clover. Remove the low-color gif variations from the .ico file.
C API
bpo-42157 [https://bugs.python.org/issue?@action=redirect&bpo=42157]: The private
PyUnicodeName_CAPI
structure of the PyCapsule APIunicodedata.ucnhash_CAPI
has been moved to the internal C API. Patch by Victor Stinner.bpo-42015 [https://bugs.python.org/issue?@action=redirect&bpo=42015]: Fix potential crash in deallocating method objects when dynamically allocated
PyMethodDef
's lifetime is managed through theself
argument of aPyCFunction
.bpo-40423 [https://bugs.python.org/issue?@action=redirect&bpo=40423]: The
subprocess
module andos.closerange
will now use theclose_range(low, high, flags)
syscall when it is available for more efficient closing of ranges of descriptors.bpo-41845 [https://bugs.python.org/issue?@action=redirect&bpo=41845]:
PyObject_GenericGetDict()
is available again in the limited API when targeting 3.10 or later.bpo-40422 [https://bugs.python.org/issue?@action=redirect&bpo=40422]: Add
Pycloserange
function to provide performant closing of a range of file descriptors.bpo-41986 [https://bugs.python.org/issue?@action=redirect&bpo=41986]:
Py_FileSystemDefaultEncodeErrors
andPy_UTF8Mode
are available again in limited API.bpo-41756 [https://bugs.python.org/issue?@action=redirect&bpo=41756]: Add
PyIter_Send
function to allow sending value into generator/coroutine/iterator without raising StopIteration exception to signal return.bpo-41784 [https://bugs.python.org/issue?@action=redirect&bpo=41784]: Added
PyUnicode_AsUTF8AndSize
to the limited C API.
Python 3.10.0 alpha 1
Release date: 2020-10-05
安全性
bpo-41304 [https://bugs.python.org/issue?@action=redirect&bpo=41304]: Fixes
python3x._pth
being ignored on Windows, caused by the fix for bpo-29778 [https://bugs.python.org/issue?@action=redirect&bpo=29778] ( CVE 2020-15801 [https://www.cve.org/CVERecord?id=CVE-2020-15801]).bpo-41162 [https://bugs.python.org/issue?@action=redirect&bpo=41162]: Audit hooks are now cleared later during finalization to avoid missing events.
bpo-29778 [https://bugs.python.org/issue?@action=redirect&bpo=29778]: Ensure
python3.dll
is loaded from correct locations when Python is embedded ( CVE 2020-15523 [https://www.cve.org/CVERecord?id=CVE-2020-15523]).bpo-41004 [https://bugs.python.org/issue?@action=redirect&bpo=41004]: The hash() methods of ipaddress.IPv4Interface and ipaddress.IPv6Interface incorrectly generated constant hash values of 32 and 128 respectively. This resulted in always causing hash collisions. The fix uses hash() to generate hash values for the tuple of (address, mask length, network address).
bpo-39603 [https://bugs.python.org/issue?@action=redirect&bpo=39603]: Prevent http header injection by rejecting control characters in http.client.putrequest(…).
核心与内置函数
bpo-41909 [https://bugs.python.org/issue?@action=redirect&bpo=41909]: Fixed stack overflow in
issubclass()
andisinstance()
when getting the__bases__
attribute leads to infinite recursion.bpo-41922 [https://bugs.python.org/issue?@action=redirect&bpo=41922]: Speed up calls to
reversed()
by using the PEP 590 [https://peps.python.org/pep-0590/]vectorcall
calling convention. Patch by Donghee Na.bpo-41873 [https://bugs.python.org/issue?@action=redirect&bpo=41873]: Calls to
float()
are now faster due to thevectorcall
calling convention. Patch by Dennis Sweeney.bpo-41870 [https://bugs.python.org/issue?@action=redirect&bpo=41870]: Speed up calls to
bool()
by using the PEP 590 [https://peps.python.org/pep-0590/]vectorcall
calling convention. Patch by Donghee Na.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_bisect
module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-39934 [https://bugs.python.org/issue?@action=redirect&bpo=39934]: Correctly count control blocks in 'except' in compiler. Ensures that a syntax error, rather a fatal error, occurs for deeply nested, named exception handlers.
bpo-41780 [https://bugs.python.org/issue?@action=redirect&bpo=41780]: Fix
__dir__()
oftypes.GenericAlias
. Patch by Batuhan Taskaya.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_lsprof
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
cmath
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_scproxy
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
termios
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Convert the
_sha256
extension module types to heap types.bpo-41690 [https://bugs.python.org/issue?@action=redirect&bpo=41690]: Fix a possible stack overflow in the parser when parsing functions and classes with a huge amount of arguments. Patch by Pablo Galindo.
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_overlapped
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
cursespanel
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_opcode
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-41681 [https://bugs.python.org/issue?@action=redirect&bpo=41681]: Fixes the wrong error description in the error raised by using 2
,
in format string in fstring andstr.format()
.bpo-41675 [https://bugs.python.org/issue?@action=redirect&bpo=41675]: The implementation of
signal.siginterrupt()
now usessigaction()
(if it is available in the system) instead of the deprecatedsiginterrupt()
. Patch by Pablo Galindo.bpo-41670 [https://bugs.python.org/issue?@action=redirect&bpo=41670]: Prevent line trace being skipped on platforms not compiled with
USE_COMPUTED_GOTOS
. Fixes issue where some lines nested within a try-except block were not being traced on Windows.bpo-41654 [https://bugs.python.org/issue?@action=redirect&bpo=41654]: Fix a crash that occurred when destroying subclasses of
MemoryError
. Patch by Pablo Galindo.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
zlib
extension module to multiphase initialization ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-41631 [https://bugs.python.org/issue?@action=redirect&bpo=41631]: The
_ast
module uses again a global state. Using a module state per module instance is causing subtle practical problems. For example, the Mercurial project replaces the__import__()
function to implement lazy import, whereas Python expected thatimport _ast
always return a fully initialized_ast
module.bpo-40077 [https://bugs.python.org/issue?@action=redirect&bpo=40077]: Convert
_operator
to usePyType_FromSpec()
.bpo-1653741 [https://bugs.python.org/issue?@action=redirect&bpo=1653741]: Port
_sha3
to multiphase init. Convert static types to heap types.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_blake2
extension module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-41533 [https://bugs.python.org/issue?@action=redirect&bpo=41533]: Free the stack allocated in
va_build_stack
ifdo_mkstack
fails and the stack is not asmall_stack
.bpo-41531 [https://bugs.python.org/issue?@action=redirect&bpo=41531]: Fix a bug that was dropping keys when compiling dict literals with more than 0xFFFF elements. Patch by Pablo Galindo.
bpo-41525 [https://bugs.python.org/issue?@action=redirect&bpo=41525]: The output of
python --help
contains now only ASCII characters.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_sha1
,_sha512
, and_md5
extension modules to multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-41431 [https://bugs.python.org/issue?@action=redirect&bpo=41431]: Optimize
dict_merge()
for copying dict (e.g.dict(d)
and{}.update(d)
).bpo-41428 [https://bugs.python.org/issue?@action=redirect&bpo=41428]: Implement PEP 604. This supports (int | str) etc. in place of Union[str, int].
bpo-41340 [https://bugs.python.org/issue?@action=redirect&bpo=41340]: Removed fallback implementation for
strdup
.bpo-38156 [https://bugs.python.org/issue?@action=redirect&bpo=38156]: Handle interrupts that come after EOF correctly in
PyOS_StdioReadline
.bpo-41342 [https://bugs.python.org/issue?@action=redirect&bpo=41342]:
round()
with integer argument is now faster (9—60%).bpo-41334 [https://bugs.python.org/issue?@action=redirect&bpo=41334]: Constructors
str()
,bytes()
andbytearray()
are now faster (around 30—40% for small objects).bpo-41295 [https://bugs.python.org/issue?@action=redirect&bpo=41295]: Resolve a regression in CPython 3.8.4 where defining "setattr" in a multi-inheritance setup and calling up the hierarchy chain could fail if builtins/extension types were involved in the base types.
bpo-41323 [https://bugs.python.org/issue?@action=redirect&bpo=41323]: Bytecode optimizations are performed directly on the control flow graph. This will result in slightly more compact code objects in some circumstances.
bpo-41247 [https://bugs.python.org/issue?@action=redirect&bpo=41247]: Always cache the running loop holder when running
asyncio.set_running_loop
.bpo-41252 [https://bugs.python.org/issue?@action=redirect&bpo=41252]: Fix incorrect refcounting in _ssl.c's
_servername_callback()
.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
multiprocessing
to multiphase initializationbpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
winapi
to multiphase initializationbpo-41215 [https://bugs.python.org/issue?@action=redirect&bpo=41215]: Use non-NULL default values in the PEG parser keyword list to overcome a bug that was preventing Python from being properly compiled when using the XLC compiler. Patch by Pablo Galindo.
bpo-41218 [https://bugs.python.org/issue?@action=redirect&bpo=41218]: Python 3.8.3 had a regression where compiling with ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension with CO_COROUTINE. Now only list comprehension making use of async/await will tagged as so.
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
faulthandler
to multiphase initialization.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
sha256
to multiphase initializationbpo-41175 [https://bugs.python.org/issue?@action=redirect&bpo=41175]: Guard against a NULL pointer dereference within bytearrayobject triggered by the
bytearray() + bytearray()
operation.bpo-41100 [https://bugs.python.org/issue?@action=redirect&bpo=41100]: add arm64 to the allowable Mac OS arches in mpdecimal.h
bpo-41094 [https://bugs.python.org/issue?@action=redirect&bpo=41094]: Fix decoding errors with audit when open files with nonASCII names on non-UTF-8 locale.
bpo-39960 [https://bugs.python.org/issue?@action=redirect&bpo=39960]: The "hackcheck" that prevents sneaking around a type's setattr() by calling the superclass method was rewritten to allow C implemented heap types.
bpo-41084 [https://bugs.python.org/issue?@action=redirect&bpo=41084]: Prefix the error message with 'fstring: ', when parsing an fstring expression which throws a
SyntaxError
.bpo-40521 [https://bugs.python.org/issue?@action=redirect&bpo=40521]: Empty frozensets are no longer singletons.
bpo-41076 [https://bugs.python.org/issue?@action=redirect&bpo=41076]: Prefeed the parser with the location of the fstring expression, not the fstring itself, which allows us to skip the shifting of the AST node locations after the parsing is completed.
bpo-41056 [https://bugs.python.org/issue?@action=redirect&bpo=41056]: Fixes a reference to deallocated stack space during startup when constructing sys.path involving a relative symlink when code was supplied via -c. (discovered via Coverity)
bpo-41061 [https://bugs.python.org/issue?@action=redirect&bpo=41061]: Fix incorrect expressions and asserts in hashtable code and tests.
bpo-41052 [https://bugs.python.org/issue?@action=redirect&bpo=41052]: Opt out serialization/deserialization for _random.Random
bpo-40939 [https://bugs.python.org/issue?@action=redirect&bpo=40939]: Rename
PyPegen*
functions toPyParser*
, so that we can remove the old set ofPyParser*
functions that were using the old parser, but keep everything backwards-compatible.bpo-35975 [https://bugs.python.org/issue?@action=redirect&bpo=35975]: Stefan Behnel reported that cf_feature_version is used even when PyCF_ONLY_AST is not set. This is against the intention and against the documented behavior, so it's been fixed.
bpo-40939 [https://bugs.python.org/issue?@action=redirect&bpo=40939]: Remove the remaining files from the old parser and the
symbol
module.bpo-40077 [https://bugs.python.org/issue?@action=redirect&bpo=40077]: Convert
_bz2
to usePyType_FromSpec()
.bpo-41006 [https://bugs.python.org/issue?@action=redirect&bpo=41006]: The
encodings.latin_1
module is no longer imported at startup. Now it is only imported when it is the filesystem encoding or the stdio encoding.bpo-40636 [https://bugs.python.org/issue?@action=redirect&bpo=40636]:
zip()
now supports PEP 618 [https://peps.python.org/pep-0618/]'sstrict
parameter, which raises aValueError
if the arguments are exhausted at different lengths. Patch by Brandt Bucher.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
_gdbm
to multiphase initialization.bpo-40985 [https://bugs.python.org/issue?@action=redirect&bpo=40985]: Fix a bug that caused the
SyntaxError
text to be empty when a file ends with a line ending in a line continuation character (i.e. backslash). The error text should contain the text of the last line.bpo-40958 [https://bugs.python.org/issue?@action=redirect&bpo=40958]: Fix a possible buffer overflow in the PEG parser when gathering information for emitting syntax errors. Patch by Pablo Galindo.
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
_dbm
to multiphase initialization.bpo-40957 [https://bugs.python.org/issue?@action=redirect&bpo=40957]: Fix refleak in Pyfopen_obj() when PySys_Audit() fails
bpo-40950 [https://bugs.python.org/issue?@action=redirect&bpo=40950]: Add a state to the
nis
module ( PEP 3121 [https://peps.python.org/pep-3121/]) and apply the multiphase initialization. Patch by Donghee Na.bpo-40947 [https://bugs.python.org/issue?@action=redirect&bpo=40947]: The Python Path Configuration now takes
PyConfig.platlibdir
in account.bpo-40939 [https://bugs.python.org/issue?@action=redirect&bpo=40939]: Remove the old parser, the
parser
module and all associated support code, commandline options and environment variables. Patch by Pablo Galindo.bpo-40847 [https://bugs.python.org/issue?@action=redirect&bpo=40847]: Fix a bug where a line with only a line continuation character is not considered a blank line at tokenizer level. In such cases, more than a single
NEWLINE
token was emitted. The old parser was working around the issue, but the new parser threw aSyntaxError
for valid input due to this. For example, an empty line following a line continuation character was interpreted as aSyntaxError
.bpo-40890 [https://bugs.python.org/issue?@action=redirect&bpo=40890]: Each dictionary view now has a
mapping
attribute that provides atypes.MappingProxyType
wrapping the original dictionary. Patch contributed by Dennis Sweeney.bpo-40889 [https://bugs.python.org/issue?@action=redirect&bpo=40889]: Improved the performance of symmetric difference operations on dictionary item views. Patch by Dennis Sweeney.
bpo-40904 [https://bugs.python.org/issue?@action=redirect&bpo=40904]: Fix possible segfault in the new PEG parser when parsing fstring containing yield statements with no value (
f"{yield}"
). Patch by Pablo Galindobpo-40903 [https://bugs.python.org/issue?@action=redirect&bpo=40903]: Fixed a possible segfault in the new PEG parser when producing error messages for invalid assignments of the form
p=p=
. Patch by Pablo Galindobpo-40880 [https://bugs.python.org/issue?@action=redirect&bpo=40880]: Fix invalid memory read in the new parser when checking newlines in string literals. Patch by Pablo Galindo.
bpo-40883 [https://bugs.python.org/issue?@action=redirect&bpo=40883]: Fix memory leak in when parsing fstrings in the new parser. Patch by Pablo Galindo
bpo-40870 [https://bugs.python.org/issue?@action=redirect&bpo=40870]: Raise
ValueError
when validating custom AST's where the constantsTrue
,False
andNone
are used within aast.Name
node.bpo-40854 [https://bugs.python.org/issue?@action=redirect&bpo=40854]: Allow overriding
sys.platlibdir
via a newPYTHONPLATLIBDIR
environment variable.bpo-40826 [https://bugs.python.org/issue?@action=redirect&bpo=40826]: Fix GIL usage in
PyOS_Readline()
: lock the GIL to set an exception and pass the Python thread state when checking if there is a pending signal.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
fcntl
to multiphase initialization.bpo-19468 [https://bugs.python.org/issue?@action=redirect&bpo=19468]: Delete unnecessary instance check in importlib.reload(). Patch by Furkan Önder.
bpo-40824 [https://bugs.python.org/issue?@action=redirect&bpo=40824]: Unexpected errors in calling the
__iter__
method are no longer masked byTypeError
in thein
operator and functionscontains()
,indexOf()
andcountOf()
of theoperator
module.bpo-40792 [https://bugs.python.org/issue?@action=redirect&bpo=40792]: Attributes
start
,stop
andstep
of therange
object now always has exact typeint
. Previously, they could have been an instance of a subclass ofint
.bpo-40780 [https://bugs.python.org/issue?@action=redirect&bpo=40780]: Fix a corner case where g-style string formatting of a float failed to remove trailing zeros.
bpo-38964 [https://bugs.python.org/issue?@action=redirect&bpo=38964]: When there's a
SyntaxError
in the expression part of an fstring, the filename attribute of theSyntaxError
gets correctly set to the name of the file the fstring resides in.bpo-40750 [https://bugs.python.org/issue?@action=redirect&bpo=40750]: Support the "-d" debug flag in the new PEG parser. Patch by Pablo Galindo
bpo-40217 [https://bugs.python.org/issue?@action=redirect&bpo=40217]: Instances of types created with
PyType_FromSpecWithBases()
will no longer automatically visit their class object when traversing references in the garbage collector. The user is expected to manually visit the object's class. Patch by Pablo Galindo.bpo-39573 [https://bugs.python.org/issue?@action=redirect&bpo=39573]:
Py_TYPE()
is changed to the inline static function. Patch by Donghee Na.bpo-40696 [https://bugs.python.org/issue?@action=redirect&bpo=40696]: Fix a hang that can arise after
generator.throw()
due to a cycle in the exception context chain.bpo-40521 [https://bugs.python.org/issue?@action=redirect&bpo=40521]: Each interpreter now its has own free lists, singletons and caches:
Free lists: float, tuple, list, dict, frame, context, asynchronous generator, MemoryError.
Singletons: empty tuple, empty bytes string, empty Unicode string, single byte character, single Unicode (latin1) character.
Slice cache.
They are no longer shared by all interpreters.
bpo-40679 [https://bugs.python.org/issue?@action=redirect&bpo=40679]: Certain
TypeError
messages about missing or extra arguments now include the function's qualified name. Patch by Dennis Sweeney.bpo-29590 [https://bugs.python.org/issue?@action=redirect&bpo=29590]: Make the stack trace correct after calling
generator.throw()
on a generator that has yielded from ayield from
.bpo-4022 [https://bugs.python.org/issue?@action=redirect&bpo=4022]: Improve performance of generators by not raising internal StopIteration.
bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
mmap
to multiphase initialization.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port
_lzma
to multiphase initialization.bpo-37999 [https://bugs.python.org/issue?@action=redirect&bpo=37999]: Builtin and extension functions that take integer arguments no longer accept
Decimal
s,Fraction
s and other objects that can be converted to integers only with a loss (e.g. that have the__int__()
method but do not have the__index__()
method).bpo-29882 [https://bugs.python.org/issue?@action=redirect&bpo=29882]: Add
int.bit_count()
, counting the number of ones in the binary representation of an integer. Patch by Niklas Fiekas.bpo-36982 [https://bugs.python.org/issue?@action=redirect&bpo=36982]: Use ncurses extended color functions when available to support terminals with 256 colors, and add the new function
curses.has_extended_color_support()
to indicate whether extended color support is provided by the underlying ncurses library.bpo-19569 [https://bugs.python.org/issue?@action=redirect&bpo=19569]: Add the private macros
PyCOMP_DIAG_PUSH
,PyCOMP_DIAG_IGNORE_DEPR_DECLS
, andPyCOMP_DIAG_POP
.bpo-26680 [https://bugs.python.org/issue?@action=redirect&bpo=26680]: The int type now supports the x.is_integer() method for compatibility with float.
库
bpo-41900 [https://bugs.python.org/issue?@action=redirect&bpo=41900]: C14N 2.0 serialisation in xml.etree.ElementTree failed for unprefixed attributes when a default namespace was defined.
bpo-41887 [https://bugs.python.org/issue?@action=redirect&bpo=41887]: Strip leading spaces and tabs on
ast.literal_eval()
. Also document stripping of spaces and tabs foreval()
.bpo-41773 [https://bugs.python.org/issue?@action=redirect&bpo=41773]: Note in documentation that
random.choices()
doesn't support non-finite weights, raiseValueError
when given non-finite weights.bpo-41840 [https://bugs.python.org/issue?@action=redirect&bpo=41840]: Fix a bug in the
symtable
module that was causing module-scope global variables to not be reported as both local and global. Patch by Pablo Galindo.bpo-41842 [https://bugs.python.org/issue?@action=redirect&bpo=41842]: Add
codecs.unregister()
function to unregister a codec search function.bpo-40564 [https://bugs.python.org/issue?@action=redirect&bpo=40564]: In
zipfile.Path
, mutate the passed ZipFile object type instead of making a copy. Prevents issues when both the local copy and the caller’s copy attempt to close the same file handle.bpo-40670 [https://bugs.python.org/issue?@action=redirect&bpo=40670]: More reliable validation of statements in
timeit.Timer
. It now accepts "empty" statements (only whitespaces and comments) and rejects misindentent statements.bpo-41833 [https://bugs.python.org/issue?@action=redirect&bpo=41833]: The
threading.Thread
constructor now uses the target name if the target argument is specified but the name argument is omitted.bpo-41817 [https://bugs.python.org/issue?@action=redirect&bpo=41817]: fix
tkinter.EventType
Enum so all members are strings, and none are tuplesbpo-41810 [https://bugs.python.org/issue?@action=redirect&bpo=41810]:
types.EllipsisType
,types.NotImplementedType
andtypes.NoneType
have been reintroduced, providing a new set of types readily interpretable by static type checkers.bpo-41815 [https://bugs.python.org/issue?@action=redirect&bpo=41815]: Fix SQLite3 segfault when backing up closed database. Patch contributed by Peter David McCormick.
bpo-41816 [https://bugs.python.org/issue?@action=redirect&bpo=41816]: StrEnum added: it ensures that all members are already strings or string candidates
bpo-41517 [https://bugs.python.org/issue?@action=redirect&bpo=41517]: fix bug allowing Enums to be extended via multiple inheritance
bpo-39587 [https://bugs.python.org/issue?@action=redirect&bpo=39587]: use the correct mix-in data type when constructing Enums
bpo-41792 [https://bugs.python.org/issue?@action=redirect&bpo=41792]: Add is_typeddict function to typing.py to check if a type is a TypedDict class
Previously there was no way to check that without using private API. See the relevant issue in python/typing [https://github.com/python/typing/issues/751].
bpo-41789 [https://bugs.python.org/issue?@action=redirect&bpo=41789]: Honor
object
overrides inEnum
class creation (specifically,__str__
,_repr_
,__format__
, and__reduce_ex__
).bpo-32218 [https://bugs.python.org/issue?@action=redirect&bpo=32218]:
enum.Flag
andenum.IntFlag
members are now iterable.bpo-39651 [https://bugs.python.org/issue?@action=redirect&bpo=39651]: Fix a race condition in the
call_soon_threadsafe()
method ofasyncio.ProactorEventLoop
: do nothing if the self-pipe socket has been closed.bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
mashal
extension module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-1635741 [https://bugs.python.org/issue?@action=redirect&bpo=1635741]: Port the
_string
extension module to the multiphase initialization API ( PEP 489 [https://peps.python.org/pep-0489/]).bpo-41732 [https://bugs.python.org/issue?@action=redirect&bpo=41732]: Added an iterator to
memoryview
.bpo-41720 [https://bugs.python.org/issue?@action=redirect&bpo=41720]: Fixed
turtle.Vec2D.__rmul__()
for arguments which are not int or float.bpo-41696 [https://bugs.python.org/issue?@action=redirect&bpo=41696]: Fix handling of debug mode in
asyncio.run()
. This allows settingPYTHONASYNCIODEBUG
or-X dev
to enable asyncio debug mode when usingasyncio.run()
.bpo-41687 [https://bugs.python.org/issue?@action=redirect&bpo=41687]: Fix implementation of sendfile to be compatible with Solaris.
bpo-41662 [https://bugs.python.org/issue?@action=redirect&bpo=41662]: No longer override exceptions raised in
__len__()
of a sequence of parameters insqlite3
withProgrammingError
.bpo-39010 [https://bugs.python.org/issue?@action=redirect&bpo=39010]: Restarting a
ProactorEventLoop
on Windows no longer logs spuriousConnectionResetErrors
.bpo-41638 [https://bugs.python.org/issue?@action=redirect&bpo=41638]:
ProgrammingError
message for absent parameter insqlite3
contains now the name of the parameter instead of its index when parameters are supplied as a dict.bpo-41662 [https://bugs.python.org/issue?@action=redirect&bpo=41662]: Fixed crash when mutate list of parameters during iteration in
sqlite3
.bpo-41513 [https://bugs.python.org/issue?@action=redirect&bpo=41513]: Improved the accuracy of math.hypot(). Internally, each step is computed with extra precision so that the result is now almost always correctly rounded.
bpo-41609 [https://bugs.python.org/issue?@action=redirect&bpo=41609]: The pdb whatis command correctly reports instance methods as 'Method' rather than 'Function'.
bpo-39994 [https://bugs.python.org/issue?@action=redirect&bpo=39994]: Fixed pprint's handling of dict subclasses that override repr.
bpo-32751 [https://bugs.python.org/issue?@action=redirect&bpo=32751]: When cancelling the task due to a timeout,
asyncio.wait_for()
will now wait until the cancellation is complete also in the case when timeout is <= 0, like it does with positive timeouts.bpo-37658 [https://bugs.python.org/issue?@action=redirect&bpo=37658]:
asyncio.wait_for()
now properly handles races between cancellation of itself and the completion of the wrapped awaitable.bpo-40782 [https://bugs.python.org/issue?@action=redirect&bpo=40782]: Change the method asyncio.AbstractEventLoop.run_in_executor to not be a coroutine.
bpo-41520 [https://bugs.python.org/issue?@action=redirect&bpo=41520]: Fix
codeop
regression that prevented turning compile warnings into errors.bpo-41528 [https://bugs.python.org/issue?@action=redirect&bpo=41528]: turtle uses math module functions to convert degrees to radians and vice versa and to calculate vector norm
bpo-41513 [https://bugs.python.org/issue?@action=redirect&bpo=41513]: Minor algorithmic improvement to math.hypot() and math.dist() giving small gains in speed and accuracy.
bpo-41503 [https://bugs.python.org/issue?@action=redirect&bpo=41503]: Fixed a race between setTarget and flush in logging.handlers.MemoryHandler.
bpo-41497 [https://bugs.python.org/issue?@action=redirect&bpo=41497]: Fix potential UnicodeDecodeError in dis module.
bpo-41467 [https://bugs.python.org/issue?@action=redirect&bpo=41467]: On Windows, fix asyncio
recv_into()
return value when the socket/pipe is closed (BrokenPipeError
): return0
rather than an empty byte string (b''
).bpo-41425 [https://bugs.python.org/issue?@action=redirect&bpo=41425]: Make tkinter doc example runnable.
bpo-41421 [https://bugs.python.org/issue?@action=redirect&bpo=41421]: Make an algebraic simplification to random.paretovariate(). It now is slightly less subject to round-off error and is slightly faster. Inputs that used to cause ZeroDivisionError now cause an OverflowError instead.
bpo-41440 [https://bugs.python.org/issue?@action=redirect&bpo=41440]: Add
os.cpu_count()
support for VxWorks RTOS.bpo-41316 [https://bugs.python.org/issue?@action=redirect&bpo=41316]: Fix the
tarfile
module to write only basename of TAR file to GZIP compression header.bpo-41384 [https://bugs.python.org/issue?@action=redirect&bpo=41384]: Raise TclError instead of TypeError when an unknown option is passed to tkinter.OptionMenu.
bpo-41317 [https://bugs.python.org/issue?@action=redirect&bpo=41317]: Use add_done_callback() in asyncio.loop.sock_accept() to unsubscribe reader early on cancellation.
bpo-41364 [https://bugs.python.org/issue?@action=redirect&bpo=41364]: Reduce import overhead of
uuid
.bpo-35328 [https://bugs.python.org/issue?@action=redirect&bpo=35328]: Set the environment variable
VIRTUAL_ENV_PROMPT
atvenv
activation.bpo-41341 [https://bugs.python.org/issue?@action=redirect&bpo=41341]: Recursive evaluation of
typing.ForwardRef
inget_type_hints
.bpo-41344 [https://bugs.python.org/issue?@action=redirect&bpo=41344]: Prevent creating
shared_memory.SharedMemory
objects withsize=0
.bpo-41333 [https://bugs.python.org/issue?@action=redirect&bpo=41333]:
collections.OrderedDict.pop()
is now 2 times faster.bpo-41288 [https://bugs.python.org/issue?@action=redirect&bpo=41288]: Unpickling invalid NEWOBJ_EX opcode with the C implementation raises now UnpicklingError instead of crashing.
bpo-39017 [https://bugs.python.org/issue?@action=redirect&bpo=39017]: Avoid infinite loop when reading specially crafted TAR files using the tarfile module ( CVE 2019-20907 [https://www.cve.org/CVERecord?id=CVE-2019-20907]).
bpo-41273 [https://bugs.python.org/issue?@action=redirect&bpo=41273]: Speed up any transport using
_ProactorReadPipeTransport
by callingrecv_into
instead ofrecv
, thus not creating a new buffer for eachrecv
call in the transport's read loop.bpo-41235 [https://bugs.python.org/issue?@action=redirect&bpo=41235]: Fix the error handling in
ssl.SSLContext.load_dh_params()
.bpo-41207 [https://bugs.python.org/issue?@action=redirect&bpo=41207]: In distutils.spawn, restore expectation that DistutilsExecError is raised when the command is not found.
bpo-29727 [https://bugs.python.org/issue?@action=redirect&bpo=29727]: Register
array.array
as aMutableSequence
. Patch by Pablo Galindo.bpo-39168 [https://bugs.python.org/issue?@action=redirect&bpo=39168]: Remove the
_new_
method oftyping.Generic
.bpo-41194 [https://bugs.python.org/issue?@action=redirect&bpo=41194]: Fix a crash in the
_ast
module: it can no longer be loaded more than once. It now uses a global state rather than a module state.bpo-41195 [https://bugs.python.org/issue?@action=redirect&bpo=41195]: Add readonly ssl.SSLContext.security_level attribute to retrieve the context's security level.
bpo-41193 [https://bugs.python.org/issue?@action=redirect&bpo=41193]: The
write_history()
atexit function of the readline completer now ignores anyOSError
to ignore error if the filesystem is readonly, instead of only ignoringFileNotFoundError
andPermissionError
.bpo-41182 [https://bugs.python.org/issue?@action=redirect&bpo=41182]: selector: use DefaultSelector based upon implementation
bpo-41161 [https://bugs.python.org/issue?@action=redirect&bpo=41161]: The decimal module now requires libmpdec-2.5.0. Users of —with-system-libmpdec should update their system library.
bpo-40874 [https://bugs.python.org/issue?@action=redirect&bpo=40874]: The decimal module now requires libmpdec-2.5.0.
bpo-41138 [https://bugs.python.org/issue?@action=redirect&bpo=41138]: Fixed the
trace
module CLI for Python source files with non-UTF-8 encoding.bpo-31082 [https://bugs.python.org/issue?@action=redirect&bpo=31082]: Use the term "iterable" in the docstring for
functools.reduce()
.bpo-40521 [https://bugs.python.org/issue?@action=redirect&bpo=40521]: Remove freelist from collections.deque().
bpo-31938 [https://bugs.python.org/issue?@action=redirect&bpo=31938]: Fix default-value signatures of several functions in the
select
module - by Anthony Sottile.bpo-41068 [https://bugs.python.org/issue?@action=redirect&bpo=41068]: Fixed reading files with nonASCII names from ZIP archive directly after writing them.
bpo-41058 [https://bugs.python.org/issue?@action=redirect&bpo=41058]:
pdb.find_function()
now correctly determines the source file encoding.bpo-41056 [https://bugs.python.org/issue?@action=redirect&bpo=41056]: Invalid file descriptor values are now prevented from being passed to os.fpathconf. (discovered by Coverity)
bpo-41056 [https://bugs.python.org/issue?@action=redirect&bpo=41056]: Fix a NULL pointer dereference within the ssl module during a MemoryError in the keylog callback. (discovered by Coverity)
bpo-41056 [https://bugs.python.org/issue?@action=redirect&bpo=41056]: Fixed an instance where a MemoryError within the zoneinfo module might not be reported or not reported at its source. (found by Coverity)
bpo-41048 [https://bugs.python.org/issue?@action=redirect&bpo=41048]:
mimetypes.read_mime_types()
function reads the rule file using UTF-8 encoding, not the locale encoding. Patch by Srinivas Reddy Thatiparthy.bpo-41043 [https://bugs.python.org/issue?@action=redirect&bpo=41043]: Fixed the use of
glob()
in the stdlib: literal part of the path is now always correctly escaped.bpo-41025 [https://bugs.python.org/issue?@action=redirect&bpo=41025]: Fixed an issue preventing the C implementation of
zoneinfo.ZoneInfo
from being subclassed.bpo-35018 [https://bugs.python.org/issue?@action=redirect&bpo=35018]: Add the
xml.sax.handler.LexicalHandler
class that is present in other SAX XML implementations.bpo-41002 [https://bugs.python.org/issue?@action=redirect&bpo=41002]: Improve performance of HTTPResponse.read with a given amount. Patch by Bruce Merry.
bpo-40448 [https://bugs.python.org/issue?@action=redirect&bpo=40448]:
ensurepip
now disables the use ofpip
cache when installing the bundled versions ofpip
andsetuptools
. Patch by Krzysztof Konopko.bpo-40967 [https://bugs.python.org/issue?@action=redirect&bpo=40967]: Removed
asyncio.Task.current_task()
andasyncio.Task.all_tasks()
. Patch contributed by Rémi Lapeyre.bpo-40924 [https://bugs.python.org/issue?@action=redirect&bpo=40924]: Ensure
importlib.resources.path
returns an extant path for the SourceFileLoader's resource reader. Avoids the regression identified in master while a long-term solution is devised.bpo-40955 [https://bugs.python.org/issue?@action=redirect&bpo=40955]: Fix a minor memory leak in
subprocess
module when extra_groups was specified.bpo-40855 [https://bugs.python.org/issue?@action=redirect&bpo=40855]: The standard deviation and variance functions in the statistics module were ignoring their mu and xbar arguments.
bpo-40939 [https://bugs.python.org/issue?@action=redirect&bpo=40939]: Use the new PEG parser when generating the stdlib
keyword
module.bpo-23427 [https://bugs.python.org/issue?@action=redirect&bpo=23427]: Add
sys.orig_argv
attribute: the list of the original command line arguments passed to the Python executable.bpo-33689 [https://bugs.python.org/issue?@action=redirect&bpo=33689]: Ignore empty or whitespace-only lines in .pth files. This matches the documentated behavior. Before, empty lines caused the site-packages dir to appear multiple times in sys.path. By Ido Michael, contributors Malcolm Smith and Tal Einat.
bpo-40884 [https://bugs.python.org/issue?@action=redirect&bpo=40884]: Added a
defaults
parameter tologging.Formatter
, to allow specifying default values for custom fields. Patch by Asaf Alon and Bar Harel.bpo-40876 [https://bugs.python.org/issue?@action=redirect&bpo=40876]: Clarify error message in the
csv
module.bpo-39791 [https://bugs.python.org/issue?@action=redirect&bpo=39791]: Refresh importlib.metadata from importlib_metadata 1.6.1.
bpo-40807 [https://bugs.python.org/issue?@action=redirect&bpo=40807]: Stop codeop._maybe_compile, used by code.InteractiveInterpreter (and IDLE). from emitting each warning three times.
bpo-32604 [https://bugs.python.org/issue?@action=redirect&bpo=32604]: Fix reference leak in the
select
module when the module is imported in a subinterpreter.bpo-39791 [https://bugs.python.org/issue?@action=redirect&bpo=39791]: Builtin loaders (SourceFileLoader and ZipImporter) now supply
TraversableResources
implementations forResourceReader
, and the fallback function has been removed.bpo-39314 [https://bugs.python.org/issue?@action=redirect&bpo=39314]:
rlcompleter.Completer
and the standard Python shell now close the parenthesis for functions that take no arguments. Patch contributed by Rémi Lapeyre.bpo-17005 [https://bugs.python.org/issue?@action=redirect&bpo=17005]: The topological sort functionality that was introduced initially in the
functools
module has been moved to a newgraphlib
module to better accommodate the new tools and keep the original scope of thefunctools
module. Patch by Pablo Galindobpo-40834 [https://bugs.python.org/issue?@action=redirect&bpo=40834]: Fix truncate when sending str object with_xxsubinterpreters.channel_send.
bpo-40755 [https://bugs.python.org/issue?@action=redirect&bpo=40755]: Add rich comparisons to collections.Counter().
bpo-26407 [https://bugs.python.org/issue?@action=redirect&bpo=26407]: Unexpected errors in calling the
__iter__
method are no longer masked byTypeError
incsv.reader()
,csv.writer.writerow()
andcsv.writer.writerows()
.bpo-39384 [https://bugs.python.org/issue?@action=redirect&bpo=39384]: Fixed email.contentmanager to allow set_content() to set a null string.
bpo-40744 [https://bugs.python.org/issue?@action=redirect&bpo=40744]: The
sqlite3
module uses SQLite API functions that require SQLite v3.7.3 or higher. This patch removes support for older SQLite versions, and explicitly requires SQLite 3.7.3 both at build, compile and runtime. Patch by Sergey Fedoseev and Erlend E. Aasland.bpo-40777 [https://bugs.python.org/issue?@action=redirect&bpo=40777]: Initialize PyDateTime_IsoCalendarDateType.tp_base at runtime to avoid errors on some compilers.
bpo-38488 [https://bugs.python.org/issue?@action=redirect&bpo=38488]: Update ensurepip to install pip 20.1.1 and setuptools 47.1.0.
bpo-40792 [https://bugs.python.org/issue?@action=redirect&bpo=40792]: The result of
operator.index()
now always has exact typeint
. Previously, the result could have been an instance of a subclass ofint
.bpo-40767 [https://bugs.python.org/issue?@action=redirect&bpo=40767]:
webbrowser
now properly finds the default browser in pure Wayland systems by checking the WAYLAND_DISPLAY environment variable. Patch contributed by Jérémy Attali.bpo-40791 [https://bugs.python.org/issue?@action=redirect&bpo=40791]:
hashlib.compare_digest()
uses OpenSSL'sCRYPTO_memcmp()
function when OpenSSL is available.bpo-40795 [https://bugs.python.org/issue?@action=redirect&bpo=40795]:
ctypes
module: If ctypes fails to convert the result of a callback or if a ctypes callback function raises an exception, sys.unraisablehook is now called with an exception set. Previously, the error was logged into stderr byPyErr_Print()
.bpo-16995 [https://bugs.python.org/issue?@action=redirect&bpo=16995]: Add
base64.b32hexencode()
andbase64.b32hexdecode()
to support the Base32 Encoding with Extended Hex Alphabet.bpo-30008 [https://bugs.python.org/issue?@action=redirect&bpo=30008]: Fix
ssl
code to be compatible with OpenSSL 1.1.x builds that useno-deprecated
and--api=1.1.0
.bpo-30064 [https://bugs.python.org/issue?@action=redirect&bpo=30064]: Fix asyncio
loop.sock_*
race condition issuebpo-40759 [https://bugs.python.org/issue?@action=redirect&bpo=40759]: Deprecate the
symbol
module.bpo-40756 [https://bugs.python.org/issue?@action=redirect&bpo=40756]: The second argument (extra) of
LoggerAdapter.__init__
now defaults to None.bpo-37129 [https://bugs.python.org/issue?@action=redirect&bpo=37129]: Add a new
os.RWF_APPEND
flag foros.pwritev()
.bpo-40737 [https://bugs.python.org/issue?@action=redirect&bpo=40737]: Fix possible reference leak for
sqlite3
initialization.bpo-40726 [https://bugs.python.org/issue?@action=redirect&bpo=40726]: Handle cases where the
end_lineno
isNone
onast.increment_lineno()
.bpo-40698 [https://bugs.python.org/issue?@action=redirect&bpo=40698]:
distutils
upload creates SHA2-256 and Blake2b-256 digests. MD5 digests is skipped if platform blocks MD5.bpo-40695 [https://bugs.python.org/issue?@action=redirect&bpo=40695]:
hashlib
no longer falls back to builtin hash implementations when OpenSSL provides a hash digest and the algorithm is blocked by security policy.bpo-9216 [https://bugs.python.org/issue?@action=redirect&bpo=9216]:
hashlib.new()
passedusedforsecurity
to OpenSSL EVP constructor_hashlib.new()
. test_hashlib and test_smtplib handle strict security policy better.bpo-40614 [https://bugs.python.org/issue?@action=redirect&bpo=40614]:
ast.parse()
will not parse self documenting expressions in fstrings when passedfeature_version
is less than(3, 8)
.bpo-40626 [https://bugs.python.org/issue?@action=redirect&bpo=40626]: Add h5 file extension as MIME Type application/x-hdf5, as per HDF Group recommendation for HDF5 formatted data files. Patch contributed by Mark Schwab.
bpo-25920 [https://bugs.python.org/issue?@action=redirect&bpo=25920]: On macOS, when building Python for macOS 10.4 and older, which wasn't the case for python.org macOS installer,
socket.getaddrinfo()
no longer uses an internal lock to prevent race conditions when callinggetaddrinfo()
which is threadsafe since macOS 10.5. Python 3.9 requires macOS 10.6 or newer. The internal lock caused random hang on fork when another thread was callingsocket.getaddrinfo()
. The lock was also used on FreeBSD older than 5.3, OpenBSD older than 201311 and NetBSD older than 4.bpo-40671 [https://bugs.python.org/issue?@action=redirect&bpo=40671]: Prepare
_hashlib
for PEP 489 [https://peps.python.org/pep-0489/] and usePyModule_AddType()
.bpo-32309 [https://bugs.python.org/issue?@action=redirect&bpo=32309]: Added a new coroutine
asyncio.to_thread()
. It is mainly used for running IO-bound functions in a separate thread to avoid blocking the event loop, and essentially works as a high-level version ofrun_in_executor()
that can directly take keyword arguments.bpo-36543 [https://bugs.python.org/issue?@action=redirect&bpo=36543]: Restored the deprecated
xml.etree.cElementTree
module.bpo-40611 [https://bugs.python.org/issue?@action=redirect&bpo=40611]:
MAP_POPULATE
constant has now been added to the list of exportedmmap
module flags.bpo-39881 [https://bugs.python.org/issue?@action=redirect&bpo=39881]: PEP 554 for use in the test suite. (Patch By Joannah Nanjekye)
bpo-13097 [https://bugs.python.org/issue?@action=redirect&bpo=13097]:
ctypes
now raises anArgumentError
when a callback is invoked with more than 1024 arguments.bpo-39385 [https://bugs.python.org/issue?@action=redirect&bpo=39385]: A new test assertion contextmanager,
unittest.assertNoLogs()
will ensure a given block of code emits no log messages using the logging module. Contributed by Kit Yan Choi.bpo-23082 [https://bugs.python.org/issue?@action=redirect&bpo=23082]: Updated the error message and docs of PurePath.relative_to() to better reflect the function behaviour.
bpo-40318 [https://bugs.python.org/issue?@action=redirect&bpo=40318]: Use SQLite3 trace v2 API, if it is available.
bpo-40105 [https://bugs.python.org/issue?@action=redirect&bpo=40105]: ZipFile truncates files to avoid corruption when a shorter comment is provided in append ("a") mode. Patch by Jan Mazur.
bpo-40084 [https://bugs.python.org/issue?@action=redirect&bpo=40084]: Fix
Enum.__dir__
: dir(Enum.member) now includes attributes as well as methods.bpo-31122 [https://bugs.python.org/issue?@action=redirect&bpo=31122]: ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation
bpo-39728 [https://bugs.python.org/issue?@action=redirect&bpo=39728]: fix default
missing
so a duplicateValueError
is not set as the__context__
of the originalValueError
.bpo-39244 [https://bugs.python.org/issue?@action=redirect&bpo=39244]: Fixed
multiprocessing.context.get_allstartmethods
to properly return the default method first on macOS.bpo-39040 [https://bugs.python.org/issue?@action=redirect&bpo=39040]: Fix parsing of invalid mime headers parameters by collapsing whitespace between encoded words in a bare-quote-string.
bpo-38731 [https://bugs.python.org/issue?@action=redirect&bpo=38731]: Add
--quiet
option to commandline interface ofpy_compile
. Patch by Gregory Schevchenko.bpo-35714 [https://bugs.python.org/issue?@action=redirect&bpo=35714]:
struct.error
is now raised if there is a null character in astruct
format string.bpo-38144 [https://bugs.python.org/issue?@action=redirect&bpo=38144]: Added the root_dir and dir_fd parameters in
glob.glob()
.bpo-26543 [https://bugs.python.org/issue?@action=redirect&bpo=26543]: Fix
IMAP4.noop()
when debug mode is enabled (ex:imaplib.Debug = 3
).bpo-12178 [https://bugs.python.org/issue?@action=redirect&bpo=12178]:
csv.writer()
now correctly escapes escapechar when input contains escapechar. Patch by Catalin Iacob, Berker Peksag, and Itay Elbirt.bpo-36290 [https://bugs.python.org/issue?@action=redirect&bpo=36290]: AST nodes are now raising
TypeError
on conflicting keyword arguments. Patch contributed by Rémi Lapeyre.bpo-33944 [https://bugs.python.org/issue?@action=redirect&bpo=33944]: Added site.py site-packages tracing in verbose mode.
bpo-35078 [https://bugs.python.org/issue?@action=redirect&bpo=35078]: Refactor formatweekday, formatmonthname methods in LocaleHTMLCalendar and LocaleTextCalendar classes in calendar module to call the base class methods.This enables customizable CSS classes for LocaleHTMLCalendar. Patch by Srinivas Reddy Thatiparthy
bpo-29620 [https://bugs.python.org/issue?@action=redirect&bpo=29620]:
assertWarns()
no longer raises aRuntimeException
when accessing a module's__warningregistry__
causes importation of a new module, or when a new module is imported in another thread. Patch by Kernc.bpo-31844 [https://bugs.python.org/issue?@action=redirect&bpo=31844]: Remove
ParserBase.error()
method from the private and undocumented_markupbase
module.html.parser.HTMLParser
is the only subclass ofParserBase
and itserror()
implementation was deprecated in Python 3.4 and removed in Python 3.5.bpo-34226 [https://bugs.python.org/issue?@action=redirect&bpo=34226]: Fix
cgi.parse_multipart
without content_length. Patch by Roger Duranbpo-33660 [https://bugs.python.org/issue?@action=redirect&bpo=33660]: Fix pathlib.PosixPath to resolve a relative path located on the root directory properly.
bpo-28557 [https://bugs.python.org/issue?@action=redirect&bpo=28557]: Improve the error message for a misbehaving
rawio.readinto
bpo-26680 [https://bugs.python.org/issue?@action=redirect&bpo=26680]: The d.is_integer() method is added to the Decimal type, for compatibility with other number types.
bpo-26680 [https://bugs.python.org/issue?@action=redirect&bpo=26680]: The x.is_integer() method is incorporated into the abstract types of the numeric tower, Real, Rational and Integral, with appropriate default implementations.