Security¶
- bpo-44022: mod:
http.client
now avoids infinitely reading potential HTTP headers after a100 Continue
status response from the server.
Core and Builtins¶
- bpo-44409: Fix error location information for tokenizer errors raised on initialization of the tokenizer. Patch by Pablo Galindo.
- bpo-43667: Improve Unicode support in non-UTF locales on Oracle Solaris. This issue does not affect other Solaris systems.
- bpo-44168: Fix error message in the parser involving keyword arguments with invalid expressions. Patch by Pablo Galindo
- bpo-44114: Fix incorrect dictkeys_reversed and dictitems_reversed function signatures in C code, which broke webassembly builds.
- bpo-44070: No longer eagerly makes import filenames absolute, except for extension modules, which was introduced in 3.9.5.
- bpo-28146: Fix a confusing error message in
str.format()
. - bpo-11105: When compiling
ast.AST
objects with recursive references throughcompile()
, the interpreter doesn’t crash anymore instead it raises aRecursionError
.
Library¶
- bpo-44516: Update vendored pip to 21.1.3
- bpo-44482: Fix very unlikely resource leak in
glob
in alternate Python implementations. - bpo-44439: Fix in
bz2.BZ2File.write()
/lzma.LZMAFile.write()
methods, when the input data is an object that supports the buffer protocol, the file length may be wrong. - bpo-44434: _thread.start_new_thread() no longer calls PyThread_exit_thread() explicitly at the thread exit, the call was redundant. On Linux with the glibc, pthread_exit() aborts the whole process if dlopen() fails to open libgcc_s.so file (ex: EMFILE error). Patch by Victor Stinner.
- bpo-44422: The
threading.enumerate()
function now uses a reentrant lock to prevent a hang on reentrant call. Patch by Victor Stinner. - bpo-44395: Fix
as_string()
to pass unixfrom properly. Patch by Dong-hee Na. - bpo-44342: [Enum] Be more robust in searching for pickle support before making an enum class unpicklable.
- bpo-44356: [Enum] Allow multiple data-type mixins if they are all the same.
- bpo-44254: On Mac, give turtledemo button text a color that works on both light or dark background. Programmers cannot control the latter.
- bpo-44145:
hmac
computations were not releasing the GIL while calling the OpenSSLHMAC_Update
C API (a new feature in 3.9). This unintentionally prevented parallel computation as otherhashlib
algorithms support. - bpo-37788: Fix a reference leak when a Thread object is never joined.
- bpo-44061: Fix regression in previous release when calling
pkgutil.iter_modules()
with a list ofpathlib.Path
objects - bpo-36515: The
hashlib
module no longer does unaligned memory accesses when compiled for ARM platforms. - bpo-44018: random.seed() no longer mutates bytearray inputs.
- bpo-38352: Add
IO
,BinaryIO
,TextIO
,Match
, andPattern
totyping.__all__
. Patch by Jelle Zijlstra. - bpo-43972: When
http.server.SimpleHTTPRequestHandler
sends a301 (Moved Permanently)
for a directory path not ending with/
, add aContent-Length: 0
header. This improves the behavior for certain clients. - bpo-28528: Fix a bug in
pdb
wherecheckline()
raisesAttributeError
if it is called afterreset()
. - bpo-43776: When
subprocess.Popen
args are provided as a string or aspathlib.Path
, the Popen instance repr now shows the right thing. - bpo-43666: AIX:
Lib/_aix_support.get_platform()
may fail in an AIX WPAR. The fileset bos.rte appears to have a builddate in both LPAR and WPAR so this fileset is queried rather than bos.mp64. To prevent a similiar situation (no builddate in ODM) a value (9988) sufficient for completing a build is provided. Patch by M Felt. - bpo-43650: Fix
MemoryError
inshutil.unpack_archive()
which fails insideshutil._unpack_zipfile()
on large files. Patch by Igor Bolshakov. - bpo-43318: Fix a bug where
pdb
does not always echo cleared breakpoints. - bpo-43295:
datetime.datetime.strptime()
now raisesValueError
instead ofIndexError
when matching'z'
with the%z
format specifier. - bpo-37022:
pdb
now displays exceptions fromrepr()
with itsp
andpp
commands.
Documentation¶
- bpo-40620: Convert examples in tutorial controlflow.rst section 4.3 to be interpreter-demo style.
- bpo-13814: In the Design FAQ, answer “Why don’t generators support the with statement?”
- bpo-44392: Added a new section in the C API documentation for types used in type hinting. Documented
Py_GenericAlias
andPy_GenericAliasType
. - bpo-38291: Mark
typing.io
andtyping.re
as deprecated since Python 3.8 in the documentation. They were never properly supported by type checkers. - bpo-44322: Document that SyntaxError args have a details tuple and that details are adjusted for errors in f-string field replacement expressions.
- bpo-44195: Corrected references to
TraversableResources
in docs. There is noTraversableReader
. - bpo-41963: Document that
ConfigParser
strips off comments when reading configuration files. - bpo-44072: Correct where in the numeric ABC hierarchy
**
support is added, i.e., in numbers.Complex, not numbers.Integral. - bpo-43558: Add the remark to
dataclasses
documentation that the__init__()
of any base class has to be called in__post_init__()
, along with a code example. - bpo-41621: Document that
collections.defaultdict
parameterdefault_factory
defaults to None and is positional-only.
Tests¶
- bpo-44287: Fix asyncio test_popen() of test_windows_utils by using a longer timeout. Use military grade battle-tested
test.support.SHORT_TIMEOUT
timeout rather than a hardcoded timeout of 10 seconds: it’s 30 seconds by default, but it is made longer on slow buildbots. Patch by Victor Stinner. - bpo-44363: Account for address sanitizer in test_capi. test_capi now passes when run GCC address sanitizer.
Build¶
- bpo-44381: The Windows build now accepts
EnableControlFlowGuard
set toguard
to enable CFG.
Windows¶
- bpo-41299: Fix 16ms jitter when using timeouts in
threading
, such as withthreading.Lock.acquire()
orthreading.Condition.wait()
.
macOS¶
IDLE¶
- bpo-40128: Mostly fix completions on macOS when not using tcl/tk 8.6.11 (as with 3.9). The added update_idletask call should be harmless and possibly helpful otherwise.
- bpo-33962: Move the indent space setting from the Font tab to the new Windows tab. Patch by Mark Roseman and Terry Jan Reedy.
- bpo-40468: Split the settings dialog General tab into Windows and Shell/ED tabs. Move help sources, which extend the Help menu, to the Extensions tab. Make space for new options and shorten the dialog. The latter makes the dialog better fit small screens.
- bpo-41611: Avoid uncaught exceptions in
AutoCompleteWindow.winconfig_event()
. - bpo-41611: Fix IDLE sometimes freezing upon tab-completion on macOS.
Tools/Demos¶
- bpo-44074: Make patchcheck automatically detect the correct base branch name (previously it was hardcoded to ‘master’)
C API¶
- bpo-44441:
Py_RunMain()
now resetsPyImport_Inittab
to its initial value at exit. It must be possible to callPyImport_AppendInittab()
orPyImport_ExtendInittab()
at each Python initialization. Patch by Victor Stinner. - bpo-42083: Fix crash in
PyStructSequence_NewType()
when passedNULL
in the documentation string slot.
转自 https://docs.python.org/release/3.9.6/whatsnew/changelog.html