Python 3.12.0 alpha 1
Release date: 2022-10-25
安全性
gh-97616 [https://github.com/python/cpython/issues/97616]: Fix multiplying a list by an integer (
list *= int
): detect the integer overflow when the new allocated length is close to the maximum size. Issue reported by Jordan Limor. Patch by Victor Stinner.gh-97514 [https://github.com/python/cpython/issues/97514]: On Linux the
multiprocessing
module returns to using filesystem backed unix domain sockets for communication with the forkserver process instead of the Linux abstract socket namespace. Only code that chooses to use the "forkserver" start method is affected.
Abstract sockets have no permissions and could allow any user on the system in the same network namespace [https://man7.org/linux/manpages/man7/network_namespaces.7.html] (often the whole system) to inject code into the multiprocessing forkserver process. This was a potential privilege escalation. Filesystem based socket permissions restrict this to the forkserver process user as was the default in Python 3.8 and earlier.
This prevents Linux CVE 2022-42919 [https://www.cve.org/CVERecord?id=CVE-2022-42919].
gh-87389 [https://github.com/python/cpython/issues/87389]:
http.server
: Fix an open redirection vulnerability in the HTTP server when an URI path starts with//
. Vulnerability discovered, and initial fix proposed, by Hamza Avvan.gh-79096 [https://github.com/python/cpython/issues/79096]: LWPCookieJar and MozillaCookieJar create files with file mode 600 instead of 644 (Microsoft Windows is not affected)
gh-92888 [https://github.com/python/cpython/issues/92888]: Fix
memoryview
use after free when accessing the backing buffer in certain cases.gh-68966 [https://github.com/python/cpython/issues/68966]: The deprecated mailcap module now refuses to inject unsafe text (filenames, MIME types, parameters) into shell commands. Instead of using such text, it will warn and act as if a match was not found (or for test commands, as if the test failed).
核心与内置函数
gh-98374 [https://github.com/python/cpython/issues/98374]: Suppress ImportError for invalid query for help() command. Patch by Donghee Na.
gh-98461 [https://github.com/python/cpython/issues/98461]: Fix source location in bytecode for list, set and dict comprehensions as well as generator expressions.
gh-98354 [https://github.com/python/cpython/issues/98354]: Added unicode check for
name
attribute ofspec
argument passed inimp.createbuiltin()
function.gh-98398 [https://github.com/python/cpython/issues/98398]: Fix source location of 'assert' bytecodes.
gh-98390 [https://github.com/python/cpython/issues/98390]: Fix location of subexpressions of boolean expressions, by reducing their scope to that of the subexpression.
gh-98254 [https://github.com/python/cpython/issues/98254]: Modules from the standard library are now potentially suggested as part of the error messages displayed by the interpreter when an
NameError
is raised to the top level. Patch by Pablo Galindogh-97997 [https://github.com/python/cpython/issues/97997]: Add running column offset to the tokenizer state to avoid calculating AST column information with pointer arithmetic.
gh-97973 [https://github.com/python/cpython/issues/97973]: Modify the tokenizer to return all necessary information the parser needs to set location information in the AST nodes, so that the parser does not have to calculate those doing pointer arithmetic.
gh-96078 [https://github.com/python/cpython/issues/96078]:
os.sched_yield()
now release the GIL while calling sched_yield(2). Patch by Donghee Na.gh-97955 [https://github.com/python/cpython/issues/97955]: Migrate
zoneinfo
to Argument Clinic.gh-97912 [https://github.com/python/cpython/issues/97912]: The compiler now avoids quadratic behavior when finding which instructions should use the
LOAD_FAST_CHECK
opcode.gh-97002 [https://github.com/python/cpython/issues/97002]: Fix an issue where several frame objects could be backed by the same interpreter frame, possibly leading to corrupted memory and hard crashes of the interpreter.
gh-97943 [https://github.com/python/cpython/issues/97943]: Bugfix:
PyFunction_GetAnnotations()
should return a borrowed reference. It was returning a new reference.gh-97922 [https://github.com/python/cpython/issues/97922]: The Garbage Collector now runs only on the eval breaker mechanism of the Python bytecode evaluation loop instead on object allocations. The GC can also run when
PyErr_CheckSignals()
is called so C extensions that need to run for a long time without executing any Python code also have a chance to execute the GC periodically.gh-65961 [https://github.com/python/cpython/issues/65961]: When
__package__
is different than__spec__.parent
, raise aDeprecationWarning
instead ofImportWarning
.
Also remove importlib.util.set_package()
which was scheduled for removal.
gh-97850 [https://github.com/python/cpython/issues/97850]: Long deprecated,
module_repr()
should now be completely eradicated.gh-86298 [https://github.com/python/cpython/issues/86298]: In cases where
warnings.warn_explicit()
consults the module's loader, anDeprecationWarning
is issued whenm.__loader__
differs fromm.__spec__.loader
.gh-97779 [https://github.com/python/cpython/issues/97779]: Ensure that all Python frame objects are backed by "complete" frames.
gh-91052 [https://github.com/python/cpython/issues/91052]: Add API for subscribing to modification events on selected dictionaries.
gh-97752 [https://github.com/python/cpython/issues/97752]: Fix possible data corruption or crashes when accessing the
f_back
member of newly-created generator or coroutine frames.gh-97591 [https://github.com/python/cpython/issues/97591]: Fixed a missing incref/decref pair in
Exception.__setstate__()
. Patch by Ofey Chan.gh-97670 [https://github.com/python/cpython/issues/97670]: Remove the
sys.getdxp()
function and theTools/scripts/analyze_dxp.py
script. DXP stands for "dynamic execution pairs". They were related toDYNAMIC_EXECUTION_PROFILE
andDXPAIRS
macros which have been removed in Python 3.11. Python can now be built with./configure --enable-pystats
to gather statistics on Python opcodes. Patch by Victor Stinner.gh-94526 [https://github.com/python/cpython/issues/94526]: Fix the Python path configuration used to initialized
sys.path
at Python startup. Paths are no longer encoded to UTF-8/strict to avoid encoding errors if it contains surrogate characters (bytes paths are decoded with the surrogateescape error handler). Patch by Victor Stinner.gh-96670 [https://github.com/python/cpython/issues/96670]: The parser now raises
SyntaxError
when parsing source code containing null bytes. Patch by Pablo Galindogh-96975 [https://github.com/python/cpython/issues/96975]: Fix a crash occurring when
PyEval_GetFrame()
is called while the topmost Python frame is in a partially-initialized state.gh-96848 [https://github.com/python/cpython/issues/96848]: Fix command line parsing: reject
-X int_max_str_digits
option with no value (invalid) when thePYTHONINTMAXSTRDIGITS
environment variable is set to a valid limit. Patch by Victor Stinner.gh-95921 [https://github.com/python/cpython/issues/95921]: Fix overly-broad source position information for chained comparisons used as branching conditions.
gh-96821 [https://github.com/python/cpython/issues/96821]: Fix undefined behaviour in
audioop.c
.gh-96821 [https://github.com/python/cpython/issues/96821]: Fix undefined behaviour in
_testcapimodule.c
.gh-95778 [https://github.com/python/cpython/issues/95778]: When
ValueError
is raised if an integer is larger than the limit, mention thesys.set_int_max_str_digits()
function in the error message. Patch by Victor Stinner.gh-96387 [https://github.com/python/cpython/issues/96387]: At Python exit, sometimes a thread holding the GIL can wait forever for a thread (usually a daemon thread) which requested to drop the GIL, whereas the thread already exited. To fix the race condition, the thread which requested the GIL drop now resets its request before exiting. Issue discovered and analyzed by Mingliang ZHAO. Patch by Victor Stinner.
gh-96864 [https://github.com/python/cpython/issues/96864]: Fix a possible assertion failure, fatal error, or
SystemError
if a line tracing event raises an exception while opcode tracing is enabled.gh-95778 [https://github.com/python/cpython/issues/95778]: The
PyLong_FromString
function was refactored to make it more maintainable and extensible.gh-96678 [https://github.com/python/cpython/issues/96678]: Fix undefined behaviour in C code of null pointer arithmetic.
gh-96754 [https://github.com/python/cpython/issues/96754]: Make sure that all frame objects created are created from valid interpreter frames. Prevents the possibility of invalid frames in backtraces and signal handlers.
gh-90997 [https://github.com/python/cpython/issues/90997]: Improve the performance of reading and writing inline bytecode caches on some platforms.
gh-96751 [https://github.com/python/cpython/issues/96751]: Remove dead code from
CALL_FUNCTION_EX
opcode.gh-90751 [https://github.com/python/cpython/issues/90751]:
memoryview
now supports half-floats. Patch by Donghee Na and Antoine Pitrou.gh-96678 [https://github.com/python/cpython/issues/96678]: Fix case of undefined behavior in ceval.c
gh-64373 [https://github.com/python/cpython/issues/64373]: Convert
_functools
to argument clinic.gh-96641 [https://github.com/python/cpython/issues/96641]: Do not expose
KeyWrapper
in_functools
.gh-96636 [https://github.com/python/cpython/issues/96636]: Ensure that tracing,
sys.setrace()
, is turned on immediately. In prerelease versions of 3.11, some tracing events might have been lost when turning on tracing in a__del__
method or interrupt.gh-96572 [https://github.com/python/cpython/issues/96572]: Fix use after free in trace refs build mode. Patch by Kumar Aditya.
gh-96611 [https://github.com/python/cpython/issues/96611]: When loading a file with invalid UTF-8 inside a multiline string, a correct SyntaxError is emitted.
gh-96612 [https://github.com/python/cpython/issues/96612]: Make sure that incomplete frames do not show up in tracemalloc traces.
gh-90230 [https://github.com/python/cpython/issues/90230]: Fix compiler warnings and test failures when building with
--enable-pystats
.gh-96587 [https://github.com/python/cpython/issues/96587]: Correctly raise
SyntaxError
on exception groups ( PEP 654 [https://peps.python.org/pep-0654/]) on python versions prior to 3.11gh-96569 [https://github.com/python/cpython/issues/96569]: Remove two cases of undefined behavior, by adding NULL checks.
gh-96582 [https://github.com/python/cpython/issues/96582]: Fix possible
NULL
pointer dereference inPyThreadCurrentFrames
. Patch by Kumar Aditya.gh-91079 [https://github.com/python/cpython/issues/91079]: Separate Python recursion checking from C recursion checking which reduces the chance of C stack overflow and allows the recursion limit to be increased safely.
gh-93911 [https://github.com/python/cpython/issues/93911]: Fix an issue that could prevent
LOAD_ATTR
from specializing properly when accessing properties.gh-96348 [https://github.com/python/cpython/issues/96348]: Emit a DeprecationWarning when
throw()
,throw()
orathrow()
are called with more than one argument.gh-95196 [https://github.com/python/cpython/issues/95196]: Disable incorrect pickling of the C implemented classmethod descriptors.
gh-96364 [https://github.com/python/cpython/issues/96364]: Fix text signatures of
list.__getitem__
anddict.__getitem__
.gh-96352 [https://github.com/python/cpython/issues/96352]: Fix
AttributeError
missingname
andobj
attributes inobject.__getattribute__()
. Patch by Philip Georgi.gh-93554 [https://github.com/python/cpython/issues/93554]: Change the jump opcodes so that all conditional jumps are forward jumps. Backward jumps are converted by the assembler into a conditional forward jump whose target is the fallthrough block (and with a reversed condition), followed by an unconditional backward jump. For example:
POP_JUMP_IF_TRUE BACKWARD_TARGET
becomes POP_JUMP_IF_FALSE
NEXT_BLOCK; JUMP BACKWARD_TARGET
.
All the directed conditional jump opcodes were removed: POP_JUMP_FORWARD_IF_TRUE
, POP_JUMP_BACKWARD_IF_TRUE
, POP_JUMP_FORWARD_IF_FALSE
, POP_JUMP_BACKWARD_IF_FALSE
, POP_JUMP_FORWARD_IF_NONE
, POP_JUMP_BACKWARD_IF_NONE
, POP_JUMP_FORWARD_IF_NOT_NONE
, POP_JUMP_BACKWARD_IF_NOT_NONE
.
The corresponding opcodes without direction are no longer pseudo-instructions, and they implement the forward conditional jumps.
gh-96268 [https://github.com/python/cpython/issues/96268]: Loading a file with invalid UTF-8 will now report the broken character at the correct location.
gh-96237 [https://github.com/python/cpython/issues/96237]: The internal field
PyInterpreterFrame.ffunc
is renamed toPyInterpreterFrame.ffuncobj
and may be any object. Thef_globals
andf_builtin
fields may hold junk values.
It is safest to treat the _PyInterpreterFrame
struct as opaque.
gh-96187 [https://github.com/python/cpython/issues/96187]: Fixed a bug that caused
PyCodeGetExtra
to return garbage for negative indexes. Patch by Pablo Galindogh-96143 [https://github.com/python/cpython/issues/96143]: Add a new
-X perf
Python command line option as well assys.activate_stack_trampoline()
andsys.deactivate_stack_trampoline()
function in thesys
module that allows to set/unset the interpreter in a way that the Linuxperf
profiler can detect Python calls. The newsys.is_stack_trampoline_active()
function allows to query the state of the perf trampoline. Design by Pablo Galindo. Patch by Pablo Galindo and Christian Heimes with contributions from Gregory P. Smith [Google] and Mark Shannon.gh-96071 [https://github.com/python/cpython/issues/96071]: Fix a deadlock in
PyGILState_Ensure()
when allocating new thread state. Patch by Kumar Aditya.gh-96046 [https://github.com/python/cpython/issues/96046]:
PyType_Ready()
now initializesht_cached_keys
and performs additional checks to ensure that type objects are properly configured. This avoids crashes in 3rd party packages that don't use regular API to create new types.gh-96005 [https://github.com/python/cpython/issues/96005]: On WASI
ENOTCAPABLE
is now mapped toPermissionError
. Theerrno
modules exposes the new error number.getpath.py
now ignoresPermissionError
when it cannot open landmark filespybuilddir.txt
andpyenv.cfg
.gh-93678 [https://github.com/python/cpython/issues/93678]: Added test a harness for direct unit tests of the compiler's optimization stage. The
testinternalcapi.optimizecfg()
function runs the optimiser on a sequence of instructions. TheCfgOptimizationTestCase
class intest.support
has utilities for invoking the optimizer and checking the output.gh-95245 [https://github.com/python/cpython/issues/95245]: Reduces the size of a "simple" Python object from 8 to 6 words by moving the weakreflist pointer into the preheader directly before the object's dict/values pointer.
gh-90997 [https://github.com/python/cpython/issues/90997]: Compile virtual
try
/except
blocks to handle exceptions raised duringclose()
orthrow()
calls through a suspended frame.gh-95977 [https://github.com/python/cpython/issues/95977]: Optimized calling
_get_()
with vectorcall. Patch by Kumar Aditya.gh-91210 [https://github.com/python/cpython/issues/91210]: Improve error message when a parameter without a default value follows one with a default value, and show the same message, even when the non-default/default sequence is preceded by positional-only parameters.
gh-95922 [https://github.com/python/cpython/issues/95922]: Fixed bug where the compiler's
eliminate_empty_basic_blocks
function ignores the last block of the code unit.gh-95818 [https://github.com/python/cpython/issues/95818]: Skip over incomplete frames in
PyThreadState_GetFrame()
.gh-95876 [https://github.com/python/cpython/issues/95876]: Fix format string in
PyPegenraise_error_known_location
that can lead to memory corruption on some 64bit systems. The function was building a tuple withi
(int) instead ofn
(Py_ssize_t) for Py_ssize_t arguments.gh-95605 [https://github.com/python/cpython/issues/95605]: Fix misleading contents of error message when converting an all-whitespace string to
float
.gh-95150 [https://github.com/python/cpython/issues/95150]: Update code object hashing and equality to consider all debugging and exception handling tables. This fixes an issue where certain non-identical code objects could be "deduplicated" during compilation.
gh-91146 [https://github.com/python/cpython/issues/91146]: Reduce allocation size of
list
fromstr.split()
andstr.rsplit()
. Patch by Donghee Na and Inada Naoki.gh-87092 [https://github.com/python/cpython/issues/87092]: Create a 'jump target label' abstraction in the compiler so that the compiler's codegen stage does not work directly with basic blocks. This prepares the code for changes to the underlying CFG generation mechanism.
gh-95355 [https://github.com/python/cpython/issues/95355]:
PyPegenParser_New
now properly detects token memory allocation errors. Patch by Honglin Zhu.gh-90081 [https://github.com/python/cpython/issues/90081]: Run Python code in tracer/profiler function at full speed. Fixes slowdown in earlier versions of 3.11.
gh-95324 [https://github.com/python/cpython/issues/95324]: Emit a warning in debug mode if an object does not call
PyObject_GC_UnTrack()
before deallocation. Patch by Pablo Galindo.gh-95245 [https://github.com/python/cpython/issues/95245]: Merge managed dict and values pointer into a single tagged pointer to save one word in the preheader.
gh-93678 [https://github.com/python/cpython/issues/93678]: Add cfg_builder struct and refactor the relevant code so that a cfg can be constructed without an instance of the compiler struct.
gh-95185 [https://github.com/python/cpython/issues/95185]: Prevented crashes in the AST constructor when compiling some absurdly long expressions like
"+0"*1000000
.RecursionError
is now raised instead. Patch by Pablo Galindogh-93351 [https://github.com/python/cpython/issues/93351]:
ast.AST
node positions are now validated when provided tocompile()
and other related functions. If invalid positions are detected, aValueError
will be raised.gh-94438 [https://github.com/python/cpython/issues/94438]: Fix an issue that caused extended opcode arguments and some conditional pops to be ignored when calculating valid jump targets for assignments to the
f_lineno
attribute of frame objects. In some cases, this could cause inconsistent internal state, resulting in a hard crash of the interpreter.gh-95060 [https://github.com/python/cpython/issues/95060]: Undocumented
PyCode_Addr2Location
function now properly returns whenaddrq
argument is less than zero.gh-95113 [https://github.com/python/cpython/issues/95113]: Replace all
EXTENDED_ARG_QUICK
instructions with basicEXTENDED_ARG
instructions in unquickened code. Consumers of non-adaptive bytecode should be able to handle extended arguments the same way they were handled in CPython 3.10 and older.gh-91409 [https://github.com/python/cpython/issues/91409]: Fix incorrect source location info caused by certain optimizations in the bytecode compiler.
gh-95023 [https://github.com/python/cpython/issues/95023]: Implement
os.setns()
andos.unshare()
for Linux. Patch by Noam Cohen.gh-94036 [https://github.com/python/cpython/issues/94036]: Fix incorrect source location info for some multiline attribute accesses and method calls.
gh-94938 [https://github.com/python/cpython/issues/94938]: Fix error detection in some builtin functions when keyword argument name is an instance of a str subclass with overloaded
__eq__
and__hash__
. Previously it could cause SystemError or other undesired behavior.gh-94996 [https://github.com/python/cpython/issues/94996]:
ast.parse()
will no longer parse function definitions with positional-only params when passedfeature_version
less than(3, 8)
. Patch by Shantanu Jain.gh-94739 [https://github.com/python/cpython/issues/94739]: Allow jumping within, out of, and across exception handlers in the debugger.
gh-94949 [https://github.com/python/cpython/issues/94949]:
ast.parse()
will no longer parse parenthesized context managers when passedfeature_version
less than(3, 9)
. Patch by Shantanu Jain.gh-94947 [https://github.com/python/cpython/issues/94947]:
ast.parse()
will no longer parse assignment expressions when passedfeature_version
less than(3, 8)
. Patch by Shantanu Jain.gh-91256 [https://github.com/python/cpython/issues/91256]: Ensures the program name is known for help text during interpreter startup.
gh-94869 [https://github.com/python/cpython/issues/94869]: Fix the column offsets for some expressions in multiline fstrings
ast
nodes. Patch by Pablo Galindo.gh-94893 [https://github.com/python/cpython/issues/94893]: Fix an issue where frame object manipulations could corrupt inline bytecode caches.
gh-94822 [https://github.com/python/cpython/issues/94822]: Fix an issue where lookups of metaclass descriptors may be ignored when an identically-named attribute also exists on the class itself.
gh-91153 [https://github.com/python/cpython/issues/91153]: Fix an issue where a
bytearray
item assignment could crash if it's resized by the new value's__index__()
method.gh-90699 [https://github.com/python/cpython/issues/90699]: Fix reference counting bug in
bool._repr_()
. Patch by Kumar Aditya.gh-94694 [https://github.com/python/cpython/issues/94694]: Fix an issue that could cause code with multiline method lookups to have misleading or incorrect column offset information. In some cases (when compiling a hand-built AST) this could have resulted in a hard crash of the interpreter.
gh-93252 [https://github.com/python/cpython/issues/93252]: Fix an issue that caused internal frames to outlive failed Python function calls, possibly resulting in memory leaks or hard interpreter crashes.
gh-94215 [https://github.com/python/cpython/issues/94215]: Fix an issue where exceptions raised by line-tracing events would cause frames to be left in an invalid state, possibly resulting in a hard crash of the interpreter.
gh-92228 [https://github.com/python/cpython/issues/92228]: Disable the compiler's inline-small-exit-blocks optimization for exit blocks that are associated with source code lines. This fixes a bug where the debugger cannot tell where an exception handler ends and the following code block begins.
gh-94485 [https://github.com/python/cpython/issues/94485]: Line number of a module's
RESUME
instruction is set to 0 as specified in PEP 626 [https://peps.python.org/pep-0626/].gh-94438 [https://github.com/python/cpython/issues/94438]: Account for instructions that can push NULL to the stack when setting line number in a frame. Prevents some (unlikely) crashes.
gh-91719 [https://github.com/python/cpython/issues/91719]: Reload
opcode
when raisingunknown opcode error
in the interpreter main loop, for C compilers to generate dispatching code independently.gh-94329 [https://github.com/python/cpython/issues/94329]: Compile and run code with unpacking of extremely large sequences (1000s of elements). Such code failed to compile. It now compiles and runs correctly.
gh-94360 [https://github.com/python/cpython/issues/94360]: Fixed a tokenizer crash when reading encoded files with syntax errors from
stdin
with non utf-8 encoded text. Patch by Pablo Galindogh-88116 [https://github.com/python/cpython/issues/88116]: Fix an issue when reading line numbers from code objects if the encoded line numbers are close to
INT_MIN
. Patch by Pablo Galindogh-94262 [https://github.com/python/cpython/issues/94262]: Don't create frame objects for incomplete frames. Prevents the creation of generators and closures from being observable to Python and C extensions, restoring the behavior of 3.10 and earlier.
gh-94192 [https://github.com/python/cpython/issues/94192]: Fix error for dictionary literals with invalid expression as value.
gh-87995 [https://github.com/python/cpython/issues/87995]:
types.MappingProxyType
instances are now hashable if the underlying mapping is hashable.gh-93883 [https://github.com/python/cpython/issues/93883]: Revise the display strategy of traceback enhanced error locations. The indicators are only shown when the location doesn't span the whole line.
gh-94163 [https://github.com/python/cpython/issues/94163]: Add
BINARY_SLICE
andSTORE_SLICE
instructions for more efficient handling and better specialization of slicing operations, where the slice is explicit in the source code.gh-94021 [https://github.com/python/cpython/issues/94021]: Fix unreachable code warning in
Python/specialize.c
.gh-93911 [https://github.com/python/cpython/issues/93911]: Specialize
LOAD_ATTR
for objects with custom__getattribute__
.gh-93955 [https://github.com/python/cpython/issues/93955]: Improve performance of attribute lookups on objects with custom
__getattribute__
and__getattr__
. Patch by Ken Jin.gh-93911 [https://github.com/python/cpython/issues/93911]: Specialize
LOAD_ATTR
forproperty()
attributes.gh-93678 [https://github.com/python/cpython/issues/93678]: Refactor compiler optimisation code so that it no longer needs the
struct assembler
andstruct compiler
passed around. Instead, each function takes the CFG and other data that it actually needs. This will make it possible to test this code directly.gh-93841 [https://github.com/python/cpython/issues/93841]: When built with
-enable-pystats
,sys._stats_on()
,sys._stats_off()
,sys._stats_clear()
andsys._stats_dump()
functions have been added to enable gathering stats for parts of programs.gh-93516 [https://github.com/python/cpython/issues/93516]: Store offset of first traceable instruction in code object to avoid having to recompute it for each instruction when tracing.
gh-93516 [https://github.com/python/cpython/issues/93516]: Lazily create a table mapping bytecode offsets to line numbers to speed up calculation of line numbers when tracing.
gh-89828 [https://github.com/python/cpython/issues/89828]:
types.GenericAlias
no longer relays the__class__
attribute. For example,isinstance(list[int], type)
no longer returnsTrue
.gh-93678 [https://github.com/python/cpython/issues/93678]: Refactor the compiler to reduce boilerplate and repetition.
gh-93671 [https://github.com/python/cpython/issues/93671]: Fix some exponential backtrace case happening with deeply nested sequence patterns in match statements. Patch by Pablo Galindo
gh-93662 [https://github.com/python/cpython/issues/93662]: Make sure that the end column offsets are correct in multiline method calls. Previously, the end column could precede the column offset.
gh-93461 [https://github.com/python/cpython/issues/93461]:
importlib.invalidate_caches()
now drops entries fromsys.path_importer_cache
with a relative path as name. This solves a caching issue when a process changes its current working directory.
FileFinder
no longer inserts a dot in the path, e.g. egg./spam
is now eggspam
.
gh-93621 [https://github.com/python/cpython/issues/93621]: Change order of bytecode instructions emitted for
with
andasync with
to reduce the number of entries in the exception table.gh-93533 [https://github.com/python/cpython/issues/93533]: Reduce the size of the inline cache for
LOAD_METHOD
by 2 bytes.gh-93444 [https://github.com/python/cpython/issues/93444]: Removed redundant fields from the compiler's basicblock struct:
b_nofallthrough
,b_exit
,b_return
. They can be easily calculated from the opcode of the last instruction of the block.gh-93429 [https://github.com/python/cpython/issues/93429]:
LOAD_METHOD
instruction has been removed. It was merged back intoLOAD_ATTR
.gh-93418 [https://github.com/python/cpython/issues/93418]: Fixed an assert where an fstring has an equal sign '=' following an expression, but there's no trailing brace. For example, f"{i=".
gh-93382 [https://github.com/python/cpython/issues/93382]: Cache the result of
PyCode_GetCode()
function to restore the O(1) lookup of theco_code
attribute.gh-93359 [https://github.com/python/cpython/issues/93359]: Ensure that custom
ast
nodes without explicit end positions can be compiled. Patch by Pablo Galindo.gh-93356 [https://github.com/python/cpython/issues/93356]: Code for exception handlers is emitted at the end of the code unit's bytecode. This avoids one jump when no exception is raised.
gh-93354 [https://github.com/python/cpython/issues/93354]: Use exponential backoff for specialization counters in the interpreter. Can reduce the number of failed specializations significantly and avoid slowdown for those parts of a program that are not suitable for specialization.
gh-93283 [https://github.com/python/cpython/issues/93283]: Improve error message for invalid syntax of conversion character in fstring expressions.
gh-93345 [https://github.com/python/cpython/issues/93345]: Fix a crash in substitution of a
TypeVar
in nested generic alias afterTypeVarTuple
.gh-93223 [https://github.com/python/cpython/issues/93223]: When a bytecode instruction jumps to an unconditional jump instruction, the first instruction can often be optimized to target the unconditional jump's target directly. For tracing reasons, this would previously only occur if both instructions have the same line number. This also now occurs if the unconditional jump is artificial, i.e., if it has no associated line number.
gh-84694 [https://github.com/python/cpython/issues/84694]: The
--experimental-isolated-subinterpreters
configure option andEXPERIMENTAL_ISOLATED_SUBINTERPRETERS
macro have been removed.gh-91924 [https://github.com/python/cpython/issues/91924]: Fix
__lltrace__
debug feature if the stdout encoding is not UTF-8. Patch by Victor Stinner.gh-93040 [https://github.com/python/cpython/issues/93040]: Wraps unused parameters in
Objects/obmalloc.c
withPy_UNUSED
.gh-93143 [https://github.com/python/cpython/issues/93143]: Avoid
NULL
checks for uninitialized local variables by determining at compile time which variables must be initialized.gh-93061 [https://github.com/python/cpython/issues/93061]: Backward jumps after
async for
loops are no longer given dubious line numbers.gh-93065 [https://github.com/python/cpython/issues/93065]: Fix contextvars HAMT implementation to handle iteration over deep trees.
The bug was discovered and fixed by Eli Libman. See MagicStack/immutables#84 [https://github.com/MagicStack/immutables/issues/84] for more details.
- gh-93012 [https://github.com/python/cpython/issues/93012]: Added the new function
PyType_FromMetaclass()
, which generalizes the existingPyType_FromModuleAndSpec()
using an additional metaclass argument. This is useful for language binding tools, where it can be used to intercept type-related operations like subclassing or static attribute access by specifying a metaclass with custom slots.
Importantly, PyType_FromMetaclass()
is available in the Limited API, which provides a path towards migrating more binding tools onto the Stable ABI.
gh-93021 [https://github.com/python/cpython/issues/93021]: Fix the
__textsignature_
for_get_()
methods implemented in C. Patch by Jelle Zijlstra.gh-89914 [https://github.com/python/cpython/issues/89914]: The operand of the
YIELD_VALUE
instruction is set to the stack depth. This is done to help frame handling onyield
and may assist debuggers.gh-92955 [https://github.com/python/cpython/issues/92955]: Fix memory leak in code object's lines and positions iterators as they were not finalized at exit. Patch by Kumar Aditya.
gh-92930 [https://github.com/python/cpython/issues/92930]: Fixed a crash in
_pickle.c
from mutating collections during__reduce__
orpersistent_id
.gh-90690 [https://github.com/python/cpython/issues/90690]: The PRECALL instruction has been removed. It offered only a small advantage for specialization and is not needed in the vast majority of cases.
gh-92914 [https://github.com/python/cpython/issues/92914]: Always round the allocated size for lists up to the nearest even number.
gh-92858 [https://github.com/python/cpython/issues/92858]: Improve error message for some suites with syntax error before ':'
gh-90473 [https://github.com/python/cpython/issues/90473]: Decrease default recursion limit on WASI to address limited call stack size.
gh-92804 [https://github.com/python/cpython/issues/92804]: Fix memory leak in
memoryview
iterator as it was not finalized at exit. Patch by Kumar Aditya.gh-92777 [https://github.com/python/cpython/issues/92777]: Specialize
LOAD_METHOD
for objects with lazy dictionaries. Patch by Ken Jin.gh-92658 [https://github.com/python/cpython/issues/92658]: Add support for connecting and binding to Hyper-V sockets on Windows Hyper-V hosts and guests.
gh-92236 [https://github.com/python/cpython/issues/92236]: Remove spurious "LINE" event when starting a generator or coroutine, visible tracing functions implemented in C.
gh-91102 [https://github.com/python/cpython/issues/91102]:
warnings.warnexplicit()
is ported to Argument Clinic.gh-92619 [https://github.com/python/cpython/issues/92619]: Make the compiler duplicate an exit block only if none of its instructions have a lineno (previously only the first instruction in the block was checked, leading to unnecessarily duplicated blocks).
gh-88750 [https://github.com/python/cpython/issues/88750]: The deprecated debug build only
PYTHONTHREADDEBUG
environment variable no longer does anything.gh-92261 [https://github.com/python/cpython/issues/92261]: Fix hang when trying to iterate over a
typing.Union
.gh-91432 [https://github.com/python/cpython/issues/91432]: Specialized the
FOR_ITER
opcode using the PEP 659 machinerygh-91399 [https://github.com/python/cpython/issues/91399]: Removed duplicate '{0, 0, 0, 0, 0, 0}' entry in 'Objects/unicodetype_db.h'.
gh-91578 [https://github.com/python/cpython/issues/91578]: Updates the error message for abstract class.
bpo-47091 [https://bugs.python.org/issue?@action=redirect&bpo=47091]: Improve performance of repetition of
list
andtuple
by usingmemcpy
to copy data and performing the reference increments in one step.bpo-46142 [https://bugs.python.org/issue?@action=redirect&bpo=46142]: Make
--help
output shorter by moving some info to the new--help-env
and--help-xoptions
commandline options. Also add--help-all
option to print complete usage.bpo-42316 [https://bugs.python.org/issue?@action=redirect&bpo=42316]: Document some places where an assignment expression needs parentheses.
库
gh-89237 [https://github.com/python/cpython/issues/89237]: Fix hang on Windows in
subprocess.wait_closed()
inasyncio
withProactorEventLoop
. Patch by Kumar Aditya.gh-97928 [https://github.com/python/cpython/issues/97928]:
tkinter.Text.count()
raises now an exception for options starting with "-" instead of silently ignoring them.gh-98393 [https://github.com/python/cpython/issues/98393]: The
os
module no longer accepts bytes-like paths, likebytearray
andmemoryview
types: only the exactbytes
type is accepted for bytes strings. Patch by Victor Stinner.gh-98363 [https://github.com/python/cpython/issues/98363]: Added itertools.batched() to batch data into lists of a given length with the last list possibly being shorter than the others.
gh-98331 [https://github.com/python/cpython/issues/98331]: Update the bundled copies of pip and setuptools to versions 22.3 and 65.5.0 respectively.
gh-98307 [https://github.com/python/cpython/issues/98307]: A
createSocket()
method was added toSysLogHandler
.gh-96035 [https://github.com/python/cpython/issues/96035]: Fix bug in
urllib.parse.urlparse()
that causes certain port numbers containing whitespace, underscores, plus and minus signs, or nonASCII digits to be incorrectly accepted.gh-98257 [https://github.com/python/cpython/issues/98257]: Make
sys.setprofile()
andsys.settrace()
functions reentrant. They can no long fail with:RuntimeError("Cannot install a trace function while another trace function is being installed")
. Patch by Victor Stinner.gh-98251 [https://github.com/python/cpython/issues/98251]: Allow
venv
to pass alongPYTHON*
variables toensurepip
andpip
when they do not impact path resolutiongh-94597 [https://github.com/python/cpython/issues/94597]: Deprecated
asyncio.AbstractEventLoopPolicy.get_child_watcher()
andasyncio.AbstractEventLoopPolicy.set_child_watcher()
methods to be removed in Python 3.14. Patch by Kumar Aditya.gh-98178 [https://github.com/python/cpython/issues/98178]: On macOS, fix a crash in
syslog.syslog()
in multithreaded applications. On macOS, the libcsyslog()
function is not threadsafe, sosyslog.syslog()
no longer releases the GIL to call it. Patch by Victor Stinner.gh-44098 [https://github.com/python/cpython/issues/44098]: Release the GIL when creating
mmap.mmap
objects on Unix.gh-87730 [https://github.com/python/cpython/issues/87730]: Wrap network errors consistently in urllib FTP support, so the test suite doesn't fail when a network is available but the public internet is not reachable.
gh-94597 [https://github.com/python/cpython/issues/94597]: The child watcher classes
MultiLoopChildWatcher
,FastChildWatcher
andSafeChildWatcher
are deprecated and will be removed in Python 3.14. Patch by Kumar Aditya.gh-98023 [https://github.com/python/cpython/issues/98023]: Change default child watcher to
PidfdChildWatcher
on Linux systems which supports it. Patch by Kumar Aditya.gh-90985 [https://github.com/python/cpython/issues/90985]: Earlier in 3.11 we deprecated
asyncio.Task.cancel("message")
. We realized we were too harsh, and have undeprecated it.gh-65961 [https://github.com/python/cpython/issues/65961]: Do not rely solely on
__cached__
on modules; code will also support__spec__.cached
.gh-97646 [https://github.com/python/cpython/issues/97646]: Replace deprecated
application/javascript
withtext/javascript
inmimetypes
. See RFC 9239 [https://datatracker.ietf.org/doc/html/rfc9239.html]. Patch by Noam Cohen.gh-97930 [https://github.com/python/cpython/issues/97930]: Apply changes from importlib_resources 5.8 and 5.9:
Traversable.joinpath
provides a concrete implementation.as_file
now supports directories of resources.gh-97850 [https://github.com/python/cpython/issues/97850]: Remove deprecated
importlib.util.set_loader()
andimportlib.util.module_for_loader()
fromimportlib.util
.gh-97837 [https://github.com/python/cpython/issues/97837]: Change deprecate warning message in
unittest
fromIt is deprecated to return a value!=None
to
It is deprecated to return a value that is not None from a test case
gh-97825 [https://github.com/python/cpython/issues/97825]: Fixes
AttributeError
whensubprocess.check_output()
is used with argumentinput=None
and either of the arguments encoding or errors are used.gh-97008 [https://github.com/python/cpython/issues/97008]:
NameError
andAttributeError
spelling suggestions provided since gh-82711 [https://github.com/python/cpython/issues/82711] are now also emitted by the pure Pythontraceback
module. Tests for those suggestions now exercise both implementations to ensure they are equivalent. Patch by Carl Friedrich Bolz-Tereick and Łukasz Langa.gh-97799 [https://github.com/python/cpython/issues/97799]:
dataclass
now usesinspect.get_annotations()
to examine the annotations on class objects.gh-97781 [https://github.com/python/cpython/issues/97781]: Removed deprecated interfaces in
importlib.metadata
(entry points accessed as dictionary, implicit dictionary construction of sequence ofEntryPoint
objects, mutablility ofEntryPoints
result, access of entry point by index).entry_points
now has a simpler, more straightforward API (returningEntryPoints
).gh-96827 [https://github.com/python/cpython/issues/96827]: Avoid spurious tracebacks from
asyncio
when default executor cleanup is delayed until after the event loop is closed (e.g. as the result of a keyboard interrupt).gh-95534 [https://github.com/python/cpython/issues/95534]:
gzip.GzipFile.read()
reads 10% faster.gh-97592 [https://github.com/python/cpython/issues/97592]: Avoid a crash in the C version of
asyncio.Future.remove_done_callback()
when an evil argument is passed.gh-97639 [https://github.com/python/cpython/issues/97639]: Remove
tokenize.NL
check fromtabnanny
.gh-97545 [https://github.com/python/cpython/issues/97545]: Make Semaphore run faster.
gh-73588 [https://github.com/python/cpython/issues/73588]: Fix generation of the default name of
tkinter.Checkbutton
. Previously, checkbuttons in different parent widgets could have the same short name and share the same state if arguments "name" and "variable" are not specified. Now they are globally unique.gh-96865 [https://github.com/python/cpython/issues/96865]: fix Flag to use boundary CONFORM
This restores previous Flag behavior of allowing flags with non-sequential values to be combined; e.g.
class Skip(Flag): TWO = 2 EIGHT = 8
Skip.TWO | Skip.EIGHT ->
gh-97005 [https://github.com/python/cpython/issues/97005]: Update bundled libexpat to 2.4.9
gh-85760 [https://github.com/python/cpython/issues/85760]: Fix race condition in
asyncio
whereprocess_exited()
called before thepipe_data_received()
leading to inconsistent output. Patch by Kumar Aditya.gh-96704 [https://github.com/python/cpython/issues/96704]: Pass the correct
contextvars.Context
when aasyncio
exception handler is called on behalf of a task or callback handle. This adds a newTask
method,get_context
, and also a newHandle
method with the same name. If this method is not found on a task object (perhaps because it is a third-party library that does not yet provide this method), the context prevailing at the time the exception handler is called is used.gh-96819 [https://github.com/python/cpython/issues/96819]: Fixed check in
multiprocessing.resource_tracker
that guarantees that the length of a write to a pipe is not greater thanPIPE_BUF
.gh-95865 [https://github.com/python/cpython/issues/95865]: Reduce
urllib.parse.quote_from_bytes()
memory use on large values.
Contributed by Dennis Sweeney.
gh-96741 [https://github.com/python/cpython/issues/96741]: Corrected type annotation for dataclass attribute
pstats.FunctionProfile.ncalls
to bestr
.gh-96734 [https://github.com/python/cpython/issues/96734]: Update
unicodedata
database to Unicode 15.0.0.gh-96735 [https://github.com/python/cpython/issues/96735]: Fix undefined behaviour in
struct.unpack()
.gh-46412 [https://github.com/python/cpython/issues/46412]: Improve performance of
bool(db)
for large ndb/gdb databases. Previously this would calllen(db)
which would iterate over all keys — the answer (empty or not) is known after the first key.gh-96652 [https://github.com/python/cpython/issues/96652]: Fix the faulthandler implementation of
faulthandler.register(signal, chain=True)
if thesigaction()
function is not available: don't call the previous signal handler if it's NULL. Patch by Victor Stinner.gh-68163 [https://github.com/python/cpython/issues/68163]: Correct conversion of
numbers.Rational
's tofloat
.gh-96538 [https://github.com/python/cpython/issues/96538]: Speed up
bisect.bisect()
functions by taking advantage of type-stability.gh-96465 [https://github.com/python/cpython/issues/96465]: Fraction hashes are now cached.
gh-96079 [https://github.com/python/cpython/issues/96079]: In
typing
, fix missing fieldname
and incorrect__module__
in _AnnotatedAlias.gh-96415 [https://github.com/python/cpython/issues/96415]: Remove
types._cell_factory
from module namespace.gh-95987 [https://github.com/python/cpython/issues/95987]: Fix
repr
ofAny
subclasses.gh-96388 [https://github.com/python/cpython/issues/96388]: Work around missing socket functions in
socket
's_repr_
.gh-96385 [https://github.com/python/cpython/issues/96385]: Fix
TypeVarTuple.__typing_prepare_subst__
.TypeError
was not raised when using more than oneTypeVarTuple
, like[*T, *V]
in type alias substitutions.gh-96142 [https://github.com/python/cpython/issues/96142]: Add
match_args
,kw_only
,slots
, andweakref_slot
to_DataclassParams
.gh-96073 [https://github.com/python/cpython/issues/96073]: In
inspect
, fix overeager replacement of "typing.
" in formatting annotations.gh-89258 [https://github.com/python/cpython/issues/89258]: Added a
getChildren()
method tologging.Logger
, to get the immediate child loggers of a logger.gh-96346 [https://github.com/python/cpython/issues/96346]: Use double caching for compiled RE patterns.
gh-96349 [https://github.com/python/cpython/issues/96349]: Fixed a minor performance regression in
threading.Event.__init__()
gh-90467 [https://github.com/python/cpython/issues/90467]: Fix
asyncio.streams.StreamReaderProtocol
to keep a strong reference to the created task, so that it's not garbage collectedgh-96172 [https://github.com/python/cpython/issues/96172]: Fix a bug in
unicodedata
:east_asian_width
used to return the wrong value for unassigned characters; and for yet unassigned, but reserved characters.gh-96159 [https://github.com/python/cpython/issues/96159]: Fix a performance regression in logging TimedRotatingFileHandler. Only check for special files when the rollover time has passed.
gh-96175 [https://github.com/python/cpython/issues/96175]: Fix unused
localName
parameter in theAttr
class inxml.dom.minidom
.gh-96145 [https://github.com/python/cpython/issues/96145]: Add AttrDict to JSON module for use with object_hook.
gh-96052 [https://github.com/python/cpython/issues/96052]: Fix handling compiler warnings (SyntaxWarning and DeprecationWarning) in
codeop.compile_command()
when checking for incomplete input. Previously it emitted warnings and raised a SyntaxError. Now it always returnsNone
for incomplete input without emitting any warnings.gh-96125 [https://github.com/python/cpython/issues/96125]: Fix incorrect condition that causes
sys.thread_info.name
to be wrong on pthread platforms.gh-96019 [https://github.com/python/cpython/issues/96019]: Fix a bug in the
makeunicodedata.py
script leading to about 13 KiB of space saving in theunicodedata
module, specifically the character decomposition data.gh-95463 [https://github.com/python/cpython/issues/95463]: Remove an incompatible change from bpo-28080 [https://bugs.python.org/issue?@action=redirect&bpo=28080] that caused a regression that ignored the utf8 in
ZipInfo.flag_bits
. Patch by Pablo Galindo.gh-69142 [https://github.com/python/cpython/issues/69142]: Add
%:z
strftime format code (generates tzoffset with colons as separator), see strftime() 和 strptime() 的行为.gh-95899 [https://github.com/python/cpython/issues/95899]: Fix
asyncio.Runner
to callasyncio.set_event_loop()
only once to avoid callingattach_loop()
multiple times on child watchers. Patch by Kumar Aditya.gh-95736 [https://github.com/python/cpython/issues/95736]: Fix
unittest.IsolatedAsyncioTestCase
to set event loop before calling setup functions. Patch by Kumar Aditya.gh-95865 [https://github.com/python/cpython/issues/95865]: Speed up
urllib.parse.quote_from_bytes()
by replacing a list comprehension withmap()
.gh-95861 [https://github.com/python/cpython/issues/95861]: Add support for computing Spearman's correlation coefficient to the existing statistics.correlation() function.
gh-95804 [https://github.com/python/cpython/issues/95804]: Fix
logging
shutdown handler so it respectsMemoryHandler.flushOnClose
.gh-95704 [https://github.com/python/cpython/issues/95704]: When a task catches
asyncio.CancelledError
and raises some other error, the other error should generally not silently be suppressed.gh-95149 [https://github.com/python/cpython/issues/95149]: The
HTTPStatus
enum offers a couple of properties to indicate the HTTP status category e.g.HTTPStatus.OK.is_success
.gh-95609 [https://github.com/python/cpython/issues/95609]: Update bundled pip to 22.2.2.
gh-95289 [https://github.com/python/cpython/issues/95289]: Fix
asyncio.TaskGroup
to propagate exception whenasyncio.CancelledError
was replaced with another exception by a context manager. Patch by Kumar Aditya and Guido van Rossum.gh-94909 [https://github.com/python/cpython/issues/94909]: Fix incorrect joining of relative Windows paths with drives in
pathlib.PurePath
initializer.gh-95385 [https://github.com/python/cpython/issues/95385]: Faster
json.dumps()
when sorting of keys is not requested (default).gh-83901 [https://github.com/python/cpython/issues/83901]: Improve
Signature.bind
error message for missing keyword-only arguments.gh-95339 [https://github.com/python/cpython/issues/95339]: Update bundled pip to 22.2.1.
gh-95045 [https://github.com/python/cpython/issues/95045]: Fix GC crash when deallocating
_lsprof.Profiler
by untracking it before calling any callbacks. Patch by Kumar Aditya.gh-95231 [https://github.com/python/cpython/issues/95231]: Fail gracefully if
EPERM
orENOSYS
is raised when loadingcrypt
methods. This may happen when trying to loadMD5
on a Linux kernel with FIPS enabled.gh-95097 [https://github.com/python/cpython/issues/95097]: Fix
asyncio.run()
forasyncio.Task
implementations withoutuncancel()
method. Patch by Kumar Aditya.gh-95087 [https://github.com/python/cpython/issues/95087]: Fix IndexError in parsing invalid date in the
email
module.gh-95199 [https://github.com/python/cpython/issues/95199]: Upgrade bundled setuptools to 63.2.0.
gh-95194 [https://github.com/python/cpython/issues/95194]: Upgrade bundled pip to 22.2.
gh-93899 [https://github.com/python/cpython/issues/93899]: Fix check for existence of
os.EFD_CLOEXEC
,os.EFD_NONBLOCK
andos.EFD_SEMAPHORE
flags on older kernel versions where these flags are not present. Patch by Kumar Aditya.gh-95166 [https://github.com/python/cpython/issues/95166]: Fix
concurrent.futures.Executor.map()
to cancel the currently waiting on future on an error - e.g. TimeoutError or KeyboardInterrupt.gh-95132 [https://github.com/python/cpython/issues/95132]: Fix a
sqlite3
regression where*args
and**kwds
were incorrectly relayed fromconnect()
to theConnection
factory. The regression was introduced in 3.11a1 with PR 24421 (gh-85128 [https://github.com/python/cpython/issues/85128]). Patch by Erlend E. Aasland.gh-93157 [https://github.com/python/cpython/issues/93157]: Fix
fileinput
module didn't supporterrors
option wheninplace
is true.gh-91212 [https://github.com/python/cpython/issues/91212]: Fixed flickering of the turtle window when the tracer is turned off. Patch by Shin-myoung-serp.
gh-95077 [https://github.com/python/cpython/issues/95077]: Add deprecation warning for enum
member.member
access (e.g.Color.RED.BLUE
). RemoveEnumMeta.__getattr__
.gh-95109 [https://github.com/python/cpython/issues/95109]: Ensure that timeouts scheduled with
asyncio.Timeout
that have already expired are delivered promptly.gh-95105 [https://github.com/python/cpython/issues/95105]:
wsgiref.types.InputStream.__iter__()
should returnIterator[bytes]
, notIterable[bytes]
. Patch by Shantanu Jain.gh-95066 [https://github.com/python/cpython/issues/95066]: Replaced assert with exception in
ast.parse()
, whenfeature_version
has an invalid major version. Patch by Shantanu Jain.gh-77617 [https://github.com/python/cpython/issues/77617]: Add
sqlite3
commandline interface. Patch by Erlend Aasland.gh-95005 [https://github.com/python/cpython/issues/95005]: Replace _PyAccu with _PyUnicodeWriter in JSON encoder and StringIO and remove the _PyAccu implementation.
gh-90085 [https://github.com/python/cpython/issues/90085]: Remove
-c/--clock
and-t/--time
CLI options oftimeit
. The options had been deprecated since Python 3.3 and the functionality was removed in Python 3.7. Patch by Shantanu Jain.gh-94857 [https://github.com/python/cpython/issues/94857]: Fix refleak in
_io.TextIOWrapper.reconfigure
. Patch by Kumar Aditya.gh-94821 [https://github.com/python/cpython/issues/94821]: Fix binding of unix socket to empty address on Linux to use an available address from the abstract namespace, instead of "0".
gh-94736 [https://github.com/python/cpython/issues/94736]: Fix crash when deallocating an instance of a subclass of
_multiprocessing.SemLock
. Patch by Kumar Aditya.gh-81620 [https://github.com/python/cpython/issues/81620]: Add random.binomialvariate().
gh-74116 [https://github.com/python/cpython/issues/74116]: Allow
asyncio.StreamWriter.drain()
to be awaited concurrently by multiple tasks. Patch by Kumar Aditya.gh-87822 [https://github.com/python/cpython/issues/87822]: When called with
capture_locals=True
, thetraceback
module functions swallow exceptions raised from calls torepr()
on local variables of frames. This is in order to prioritize the original exception over rendering errors. An indication of the failure is printed in place of the missing value. (Patch by Simon-Martin Schroeder).gh-88050 [https://github.com/python/cpython/issues/88050]: Fix
asyncio
subprocess transport to kill process cleanly when process is blocked and avoidRuntimeError
when loop is closed. Patch by Kumar Aditya.gh-94637 [https://github.com/python/cpython/issues/94637]:
SSLContext.set_default_verify_paths()
now releases the GIL aroundSSL_CTXsetdefault_verify_paths
call. The function call performs I/O and CPU intensive work.gh-94309 [https://github.com/python/cpython/issues/94309]: Deprecate aliases
typing.Hashable
andtyping.Sized
gh-92546 [https://github.com/python/cpython/issues/92546]: An undocumented
python -m pprint
benchmark is moved intopprint
suite of pyperformance. Patch by Oleg Iarygin.gh-94607 [https://github.com/python/cpython/issues/94607]: Fix subclassing complex generics with type variables in
typing
. Previously an error message sayingSome type variables … are not listed in Generic[…]
was shown.typing
no longer populates__parameters__
with the__parameters__
of a Python class.gh-94619 [https://github.com/python/cpython/issues/94619]: Remove the long-deprecated
module_repr()
fromimportlib
.gh-93910 [https://github.com/python/cpython/issues/93910]: The ability to access the other values of an enum on an enum (e.g.
Color.RED.BLUE
) has been restored in order to fix a performance regression.gh-93896 [https://github.com/python/cpython/issues/93896]: Fix
asyncio.run()
andunittest.IsolatedAsyncioTestCase
to always the set event loop as it was done in Python 3.10 and earlier. Patch by Kumar Aditya.gh-94343 [https://github.com/python/cpython/issues/94343]: Allow setting the attributes of
reprlib.Repr
during object initializationgh-94382 [https://github.com/python/cpython/issues/94382]: Port static types of
_multiprocessing
module to heap types. Patch by Kumar Aditya.gh-78724 [https://github.com/python/cpython/issues/78724]: Fix crash in
struct.Struct
when it was not completely initialized by initializing it in_new_()
. Patch by Kumar Aditya.gh-94510 [https://github.com/python/cpython/issues/94510]: Reentrant calls to
sys.setprofile()
andsys.settrace()
now raiseRuntimeError
. Patch by Pablo Galindo.gh-92336 [https://github.com/python/cpython/issues/92336]: Fix bug where
linecache.getline()
fails on bad files withUnicodeDecodeError
orSyntaxError
. It now returns an empty string as per the documentation.gh-94398 [https://github.com/python/cpython/issues/94398]: Once a
asyncio.TaskGroup
has started shutting down (i.e., at least one task has failed and the task group has started cancelling the remaining tasks), it should not be possible to add new tasks to the task group.gh-94383 [https://github.com/python/cpython/issues/94383]:
xml.etree
: Remove theElementTree.Element.copy()
method of the pure Python implementation, deprecated in Python 3.10, use thecopy.copy()
function instead. The C implementation ofxml.etree
has nocopy()
method, only a_copy_()
method. Patch by Victor Stinner.gh-94379 [https://github.com/python/cpython/issues/94379]:
zipimport
: Removefind_loader()
andfind_module()
methods, deprecated in Python 3.10: use thefind_spec()
method instead. See PEP 451 [https://peps.python.org/pep-0451/] for the rationale. Patch by Victor Stinner.gh-94352 [https://github.com/python/cpython/issues/94352]:
shlex.split()
: PassingNone
for s argument now raises an exception, rather than readingsys.stdin
. The feature was deprecated in Python 3.9. Patch by Victor Stinner.gh-94318 [https://github.com/python/cpython/issues/94318]: Strip trailing spaces in
pydoc
text output.gh-89988 [https://github.com/python/cpython/issues/89988]: Fix memory leak in
pickle.Pickler
when looking updispatch_table
. Patch by Kumar Aditya.gh-90016 [https://github.com/python/cpython/issues/90016]: Deprecate
sqlite3
default adapters and converters. Patch by Erlend E. Aasland.gh-94254 [https://github.com/python/cpython/issues/94254]: Fixed types of
struct
module to be immutable. Patch by Kumar Aditya.gh-93259 [https://github.com/python/cpython/issues/93259]: Now raise
ValueError
whenNone
or an empty string are passed toDistribution.from_name
(and other callers).gh-74696 [https://github.com/python/cpython/issues/74696]:
shutil.make_archive()
now passes the root_dir argument to custom archivers which support it.gh-94216 [https://github.com/python/cpython/issues/94216]: The
dis
module now has the opcodes for pseudo instructions (those which are used by the compiler during code generation but then removed or replaced by real opcodes before the final bytecode is emitted).gh-93096 [https://github.com/python/cpython/issues/93096]: Removed undocumented
python -m codecs
. Usepython -m unittest test.test_codecs.EncodedFileTest
instead.gh-94207 [https://github.com/python/cpython/issues/94207]: Made
_struct.Struct
GC-tracked in order to fix a reference leak in the_struct
module.gh-93096 [https://github.com/python/cpython/issues/93096]: Removed undocumented
-t
argument ofpython -m base64
. Usepython -m unittest test.test_base64.LegacyBase64TestCase.test_encodebytes
instead.gh-94226 [https://github.com/python/cpython/issues/94226]: Remove the
locale.format()
function, deprecated in Python 3.7: uselocale.format_string()
instead. Patch by Victor Stinner.gh-94199 [https://github.com/python/cpython/issues/94199]: Remove the
ssl.match_hostname()
function. Thessl.match_hostname()
was deprecated in Python 3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer uses thessl.match_hostname()
function. Patch by Victor Stinner.gh-94214 [https://github.com/python/cpython/issues/94214]: Document the
context
object used in thevenv.EnvBuilder
class, and add the new environment's library path to it.gh-94199 [https://github.com/python/cpython/issues/94199]: Remove the
ssl.wrap_socket()
function, deprecated in Python 3.7: instead, create assl.SSLContext
object and call itsssl.SSLContext.wrap_socket
method. Any package that still usesssl.wrap_socket()
is broken and insecure. The function neither sends a SNI TLS extension nor validates server hostname. Code is subject to CWE 295 [https://cwe.mitre.org/data/definitions/295.html] Improper Certificate Validation. Patch by Victor Stinner.gh-94199 [https://github.com/python/cpython/issues/94199]: Remove the
ssl.RAND_pseudo_bytes()
function, deprecated in Python 3.6: useos.urandom()
orssl.RAND_bytes()
instead. Patch by Victor Stinner.gh-94199 [https://github.com/python/cpython/issues/94199]:
hashlib
: Remove the pure Python implementation ofhashlib.pbkdf2_hmac()
, deprecated in Python 3.10. Python 3.10 and newer requires OpenSSL 1.1.1 ( PEP 644 [https://peps.python.org/pep-0644/]): this OpenSSL version provides a C implementation ofpbkdf2_hmac()
which is faster. Patch by Victor Stinner.gh-94196 [https://github.com/python/cpython/issues/94196]:
gzip
: Remove thefilename
attribute ofgzip.GzipFile
, deprecated since Python 2.6, use thename
attribute instead. In write mode, thefilename
attribute added'.gz'
file extension if it was not present. Patch by Victor Stinner.gh-94182 [https://github.com/python/cpython/issues/94182]: run the
asyncio.PidfdChildWatcher
on the running loop, this allows event loops to run subprocesses when there is no default event loop running on the main threadgh-94169 [https://github.com/python/cpython/issues/94169]: Remove
io.OpenWrapper
and_pyio.OpenWrapper
, deprecated in Python 3.10: just useopen()
instead. Theopen()
(io.open()
) function is a builtin function. Since Python 3.10,_pyio.open()
is also a static method. Patch by Victor Stinner.gh-91742 [https://github.com/python/cpython/issues/91742]: Fix
pdb
crash after jump caused by a null pointer dereference. Patch by Kumar Aditya.gh-94101 [https://github.com/python/cpython/issues/94101]: Manual instantiation of
ssl.SSLSession
objects is no longer allowed as it lead to misconfigured instances that crashed the interpreter when attributes where accessed on them.gh-84753 [https://github.com/python/cpython/issues/84753]:
inspect.iscoroutinefunction()
,inspect.isgeneratorfunction()
, andinspect.isasyncgenfunction()
now properly returnTrue
for duck-typed function-like objects like instances ofunittest.mock.AsyncMock
.
This makes inspect.iscoroutinefunction()
consistent with the behavior of asyncio.iscoroutinefunction()
. Patch by Mehdi ABAAKOUK.
gh-94028 [https://github.com/python/cpython/issues/94028]: Fix a regression in the
sqlite3
where statement objects were not properly cleared and reset after use in cursor iters. The regression was introduced by PR 27884 in Python 3.11a1. Patch by Erlend E. Aasland.gh-93973 [https://github.com/python/cpython/issues/93973]: Add keyword argument
all_errors
toasyncio.create_connection
so that multiple connection errors can be raised as anExceptionGroup
.gh-93963 [https://github.com/python/cpython/issues/93963]: Officially deprecate from
importlib.abc
classes moved toimportlib.resources.abc
.gh-93858 [https://github.com/python/cpython/issues/93858]: Prevent error when activating venv in nested fish instances.
gh-93820 [https://github.com/python/cpython/issues/93820]: Pickle
enum.Flag
by name.gh-93847 [https://github.com/python/cpython/issues/93847]: Fix repr of enum of generic aliases.
gh-91404 [https://github.com/python/cpython/issues/91404]: Revert the
re
memory leak when a match is terminated by a signal or memory allocation failure as the implemented fix caused a major performance regression.gh-83499 [https://github.com/python/cpython/issues/83499]: Fix double closing of file description in
tempfile
.gh-93820 [https://github.com/python/cpython/issues/93820]: Fixed a regression when
copy.copy()
-ingenum.Flag
with multiple flag members.gh-79512 [https://github.com/python/cpython/issues/79512]: Fixed names and
__module__
value ofweakref
classesReferenceType
,ProxyType
,CallableProxyType
. It makes them pickleable.gh-91389 [https://github.com/python/cpython/issues/91389]: Fix an issue where
dis
utilities could report missing or incorrect position information in the presence ofCACHE
entries.gh-93626 [https://github.com/python/cpython/issues/93626]: Set
__future__.annotations
to have aNone
mandatoryRelease to indicate that it is currently 'TBD'.gh-90473 [https://github.com/python/cpython/issues/90473]: Emscripten and WASI have no home directory and cannot provide PEP 370 [https://peps.python.org/pep-0370/] user site directory.
gh-90494 [https://github.com/python/cpython/issues/90494]:
copy.copy()
andcopy.deepcopy()
now always raise a TypeError if__reduce__()
returns a tuple with length 6 instead of silently ignore the 6th item or produce incorrect result.gh-90549 [https://github.com/python/cpython/issues/90549]: Fix a multiprocessing bug where a global named resource (such as a semaphore) could leak when a child process is spawned (as opposed to forked).
gh-93521 [https://github.com/python/cpython/issues/93521]: Fixed a case where dataclasses would try to add
__weakref__
into the__slots__
for a dataclass that specifiedweakref_slot=True
when it was already defined in one of its bases. This resulted in aTypeError
upon the new class being created.gh-79579 [https://github.com/python/cpython/issues/79579]:
sqlite3
now correctly detects DML queries with leading comments. Patch by Erlend E. Aasland.gh-93421 [https://github.com/python/cpython/issues/93421]: Update
sqlite3.Cursor.rowcount
when a DML statement has run to completion. This fixes the row count for SQL queries likeUPDATE … RETURNING
. Patch by Erlend E. Aasland.gh-93475 [https://github.com/python/cpython/issues/93475]: Expose
FICLONE
andFICLONERANGE
constants infcntl
. Patch by Illia Volochii.gh-93370 [https://github.com/python/cpython/issues/93370]: Deprecate
sqlite3.version
andsqlite3.version_info
.gh-91810 [https://github.com/python/cpython/issues/91810]: Suppress writing an XML declaration in open files in
ElementTree.write()
withencoding='unicode'
andxml_declaration=None
.gh-91162 [https://github.com/python/cpython/issues/91162]: Support splitting of unpacked arbitrary-length tuple over
TypeVar
andTypeVarTuple
parameters. For example:A[T, Ts][tuple[int, …]]
->A[int, *tuple[int, …]]
A[*Ts, T][*tuple[int, …]]
->A[*tuple[int, …], int]
gh-93353 [https://github.com/python/cpython/issues/93353]: Fix the
importlib.resources.as_file()
context manager to remove the temporary file if destroyed late during Python finalization: keep a local reference to theos.remove()
function. Patch by Victor Stinner.gh-83658 [https://github.com/python/cpython/issues/83658]: Make
multiprocessing.Pool
raise an exception ifmaxtasksperchild
is notNone
or a positive int.gh-93312 [https://github.com/python/cpython/issues/93312]: Add
os.PIDFD_NONBLOCK
flag to open a file descriptor for a process withos.pidfd_open()
in nonblocking mode. Patch by Kumar Aditya.gh-88123 [https://github.com/python/cpython/issues/88123]: Implement
Enum.__contains__
that returnsTrue
orFalse
to replace the deprecated behaviour that would sometimes raise aTypeError
.gh-93297 [https://github.com/python/cpython/issues/93297]: Make asyncio task groups prevent child tasks from being GCed
gh-85308 [https://github.com/python/cpython/issues/85308]: Changed
argparse.ArgumentParser
to use filesystem encoding and error handler instead of default text encoding to read arguments from file (e.g.fromfile_prefix_chars
option). This change affects Windows; argument file should be encoded with UTF-8 instead of ANSI Codepage.gh-93156 [https://github.com/python/cpython/issues/93156]: Accessing the
pathlib.PurePath.parents
sequence of an absolute path using negative index values produced incorrect results.gh-93162 [https://github.com/python/cpython/issues/93162]: Add the ability for
logging.config.dictConfig()
to usefully configureQueueHandler
andQueueListener
as a pair, and addlogging.getHandlerByName()
andlogging.getHandlerNames()
APIs to allow access to handlers by name.gh-93243 [https://github.com/python/cpython/issues/93243]: The
smtpd
module was removed per the schedule in PEP 594 [https://peps.python.org/pep-0594/].gh-92886 [https://github.com/python/cpython/issues/92886]: Replace
assert
statements withraise AssertionError()
inBaseHandler
so that the tested behaviour is maintained running with optimizations(-O)
.gh-90155 [https://github.com/python/cpython/issues/90155]: Fix broken
asyncio.Semaphore
when acquire is cancelled.gh-90817 [https://github.com/python/cpython/issues/90817]: The
locale.resetlocale()
function is deprecated and will be removed in Python 3.13. Uselocale.setlocale(locale.LC_ALL, "")
instead. Patch by Victor Stinner.gh-91513 [https://github.com/python/cpython/issues/91513]: Added
taskName
attribute tologging
module for use withasyncio
tasks.gh-74696 [https://github.com/python/cpython/issues/74696]:
shutil.make_archive()
no longer temporarily changes the current working directory during creation of standard.zip
or tar archives.gh-92728 [https://github.com/python/cpython/issues/92728]: The
re.template()
function and the correspondingre.TEMPLATE
andre.T
flags are restored after they were removed in 3.11.0b1, but they are now deprecated, so they might be removed from Python 3.13.gh-93033 [https://github.com/python/cpython/issues/93033]: Search in some strings (platform dependent i.e [U+0xFFFF, U+0x0100] on Windows or [U+0xFFFFFFFF, U+0x00010000] on Linux 64-bit) are now up to 10 times faster.
gh-89973 [https://github.com/python/cpython/issues/89973]: Fix
re.error
raised infnmatch
if the pattern contains a character range with upper bound lower than lower bound (e.g.[c-a]
). Now such ranges are interpreted as empty ranges.gh-93044 [https://github.com/python/cpython/issues/93044]: No longer convert the database argument of
sqlite3.connect()
to bytes before passing it to the factory.gh-93010 [https://github.com/python/cpython/issues/93010]: In a very special case, the email package tried to append the nonexistent
InvalidHeaderError
to the defect list. It should have beenInvalidHeaderDefect
.gh-92986 [https://github.com/python/cpython/issues/92986]: Fix
ast.unparse()
whenImportFrom.level
isNone
gh-92932 [https://github.com/python/cpython/issues/92932]: Now
dis()
andget_instructions()
handle operand values for instructions prefixed byEXTENDED_ARG_QUICK
. Patch by Sam Gross and Donghee Na.gh-92675 [https://github.com/python/cpython/issues/92675]: Fix
venv.ensure_directories()
to acceptpathlib.Path
arguments in addition tostr
paths. Patch by David Foster.gh-87901 [https://github.com/python/cpython/issues/87901]: Removed the
encoding
argument fromos.popen()
that was added in 3.11b1.gh-91922 [https://github.com/python/cpython/issues/91922]: Fix function
sqlite.connect()
and thesqlite.Connection
constructor on non-UTF-8 locales. Also, they now support bytes paths non-decodable with the current FS encoding.gh-92869 [https://github.com/python/cpython/issues/92869]: Added
c_time_t
toctypes
, which has the same size as thetime_t
type in C.gh-92839 [https://github.com/python/cpython/issues/92839]: Fixed crash resulting from calling bisect.insort() or bisect.insort_left() with the key argument not equal to
None
.gh-90473 [https://github.com/python/cpython/issues/90473]:
subprocess
now fails early on Emscripten and WASI platforms to work around missingos.pipe()
on WASI.gh-89325 [https://github.com/python/cpython/issues/89325]: Removed many old deprecated
unittest
features:TestCase
method aliases, undocumented and brokenTestCase
methodassertDictContainsSubset
, undocumentedTestLoader.loadTestsFromModule
parameter useloadtests, and an underscored alias of theTextTestResult
class.gh-92734 [https://github.com/python/cpython/issues/92734]: Allow multi-element reprs emitted by
reprlib
to be pretty-printed using configurable indentation.gh-92671 [https://github.com/python/cpython/issues/92671]: Fixed
ast.unparse()
for empty tuples in the assignment target context.gh-91581 [https://github.com/python/cpython/issues/91581]:
utcfromtimestamp()
no longer attempts to resolvefold
in the pure Python implementation, since the fold is never 1 in UTC. In addition to being slightly faster in the common case, this also prevents some errors when the timestamp is close todatetime.min
. Patch by Paul Ganssle.gh-86388 [https://github.com/python/cpython/issues/86388]: Removed randrange() functionality deprecated since Python 3.10. Formerly, randrange(10.0) losslessly converted to randrange(10). Now, it raises a TypeError. Also, the exception raised for non-integral values such as randrange(10.5) or randrange('10') has been changed from ValueError to TypeError.
gh-90385 [https://github.com/python/cpython/issues/90385]: Add
pathlib.Path.walk()
as an alternative toos.walk()
.gh-92550 [https://github.com/python/cpython/issues/92550]: Fix
pathlib.Path.rglob()
for empty pattern.gh-92591 [https://github.com/python/cpython/issues/92591]: Allow
logging
filters to return alogging.LogRecord
instance so that filters attached tologging.Handler
s can enrich records without side effects on other handlers.gh-92445 [https://github.com/python/cpython/issues/92445]: Fix a bug in
argparse
wherenargs="*"
would raise an error instead of returning an empty list when 0 arguments were supplied if choice was also defined inparser.add_argument
.gh-92547 [https://github.com/python/cpython/issues/92547]: Remove undocumented
sqlite3
features deprecated in Python 3.10:sqlite3.enable_shared_cache()
sqlite3.OptimizedUnicode
Patch by Erlend E. Aasland.
gh-92530 [https://github.com/python/cpython/issues/92530]: Fix an issue that occurred after interrupting
threading.Condition.notify()
.gh-92531 [https://github.com/python/cpython/issues/92531]: The statistics.median_grouped() function now always return a float. Formerly, it did not convert the input type when for sequences of length one.
gh-84131 [https://github.com/python/cpython/issues/84131]: The
pathlib.Path
deprecated methodlink_to
has been removed. Use 3.10'shardlink_to()
method instead as its semantics are consistent with that ofsymlink_to()
.gh-89336 [https://github.com/python/cpython/issues/89336]: Removed
configparser
module APIs: theSafeConfigParser
class alias, theParsingError.filename
property and parameter, and theConfigParser.readfp
method, all of which were deprecated since Python 3.2.gh-92391 [https://github.com/python/cpython/issues/92391]: Add
__class_getitem__()
tocsv.DictReader
andcsv.DictWriter
, allowing them to be parameterized at runtime. Patch by Marc Mueller.gh-91968 [https://github.com/python/cpython/issues/91968]: Add
SO_RTABLE
andSO_USER_COOKIE
constants tosocket
.gh-91810 [https://github.com/python/cpython/issues/91810]:
ElementTree
methodwrite()
and functiontostring()
now use the text file's encoding ("UTF-8" if not available) instead of locale encoding in XML declaration whenencoding="unicode"
is specified.gh-81790 [https://github.com/python/cpython/issues/81790]:
os.path.splitdrive()
now understands DOS device paths with UNC links (beginning\?\UNC\
). Contributed by Barney Gale.gh-91760 [https://github.com/python/cpython/issues/91760]: Apply more strict rules for numerical group references and group names in regular expressions. Only sequence of ASCII digits is now accepted as a numerical reference. The group name in bytes patterns and replacement strings can now only contain ASCII letters and digits and underscore.
gh-90622 [https://github.com/python/cpython/issues/90622]: Worker processes for
concurrent.futures.ProcessPoolExecutor
are no longer spawned on demand (a feature added in 3.9) when the multiprocessing context start method is"fork"
as that can lead to deadlocks in the child processes due to a fork happening while threads are running.gh-91577 [https://github.com/python/cpython/issues/91577]: Move imports in
SharedMemory
methods to module level so that they can be executed late in python finalization.gh-91581 [https://github.com/python/cpython/issues/91581]: Remove an unhandled error case in the C implementation of calls to
datetime.fromtimestamp
with no time zone (i.e. getting a local time from an epoch timestamp). This should have no user-facing effect other than giving a possibly more accurate error message when called with timestamps that fall on 10000-01-01 in the local time. Patch by Paul Ganssle.gh-91539 [https://github.com/python/cpython/issues/91539]: Improve performance of
urllib.request.getproxies_environment
when there are many environment variablesgh-91524 [https://github.com/python/cpython/issues/91524]: Speed up the regular expression substitution (functions
re.sub()
andre.subn()
and correspondingre.Pattern
methods) for replacement strings containing group references by 2—3 times.gh-91447 [https://github.com/python/cpython/issues/91447]: Fix findtext in the xml module to only give an empty string when the text attribute is set to
None
.gh-91456 [https://github.com/python/cpython/issues/91456]: Deprecate current default auto() behavior: In 3.13 the default will be for for auto() to always return the largest member value incremented by 1, and to raise if incompatible value types are used.
bpo-47231 [https://bugs.python.org/issue?@action=redirect&bpo=47231]: Fixed an issue with inconsistent trailing slashes in tarfile longname directories.
bpo-39064 [https://bugs.python.org/issue?@action=redirect&bpo=39064]:
zipfile.ZipFile
now raiseszipfile.BadZipFile
instead ofValueError
when reading a corrupt zip file in which the central directory offset is negative.bpo-41287 [https://bugs.python.org/issue?@action=redirect&bpo=41287]: Fix handling of the
doc
argument in subclasses ofproperty()
.gh-90005 [https://github.com/python/cpython/issues/90005]:
ctypes
dependencylibffi
is now detected withpkg-config
.bpo-32547 [https://bugs.python.org/issue?@action=redirect&bpo=32547]: The constructors for
DictWriter
andDictReader
now coerce thefieldnames
argument to alist
if it is an iterator.bpo-35540 [https://bugs.python.org/issue?@action=redirect&bpo=35540]: Fix
dataclasses.asdict()
crash whencollections.defaultdict
is present in the attributes.bpo-47063 [https://bugs.python.org/issue?@action=redirect&bpo=47063]: Add an index_pages parameter to support using non-default index page names.
bpo-47025 [https://bugs.python.org/issue?@action=redirect&bpo=47025]: Drop support for
bytes
onsys.path
.bpo-46951 [https://bugs.python.org/issue?@action=redirect&bpo=46951]: Order the contents of zipapp archives, to make builds more reproducible.
bpo-42777 [https://bugs.python.org/issue?@action=redirect&bpo=42777]: Implement
pathlib.Path.is_mount()
for Windows paths.bpo-46755 [https://bugs.python.org/issue?@action=redirect&bpo=46755]: In
QueueHandler
, clearstack_info
fromLogRecord
to prevent stack trace from being written twice.bpo-45393 [https://bugs.python.org/issue?@action=redirect&bpo=45393]: Fix the formatting for
await x
andnot x
in the operator precedence table when using thehelp()
system.bpo-46642 [https://bugs.python.org/issue?@action=redirect&bpo=46642]: Improve error message when trying to subclass an instance of
typing.TypeVar
,typing.ParamSpec
,typing.TypeVarTuple
, etc. Based on patch by Gregory Beauregard.bpo-46364 [https://bugs.python.org/issue?@action=redirect&bpo=46364]: Restrict use of sockets instead of pipes for stdin of subprocesses created by
asyncio
to AIX platform only.bpo-28249 [https://bugs.python.org/issue?@action=redirect&bpo=28249]: Set
doctest.DocTest.lineno
toNone
when an object does not have__doc__
.bpo-46197 [https://bugs.python.org/issue?@action=redirect&bpo=46197]: Fix
ensurepip
environment isolation for subprocess runningpip
.bpo-45924 [https://bugs.python.org/issue?@action=redirect&bpo=45924]: Fix
asyncio
incorrect traceback when future's exception is raised multiple times. Patch by Kumar Aditya.bpo-45046 [https://bugs.python.org/issue?@action=redirect&bpo=45046]: Add support of context managers in
unittest
: methodsenterContext()
andenterClassContext()
of classTestCase
, methodenterAsyncContext()
of classIsolatedAsyncioTestCase
and functionunittest.enterModuleContext()
.bpo-44173 [https://bugs.python.org/issue?@action=redirect&bpo=44173]: Enable fast seeking of uncompressed unencrypted
zipfile.ZipExtFile
bpo-42627 [https://bugs.python.org/issue?@action=redirect&bpo=42627]: Fix incorrect parsing of Windows registry proxy settings
bpo-42047 [https://bugs.python.org/issue?@action=redirect&bpo=42047]: Add
threading.get_native_id()
support for DragonFly BSD. Patch by David Carlier.bpo-14243 [https://bugs.python.org/issue?@action=redirect&bpo=14243]: The
tempfile.NamedTemporaryFile
function has a new optional parameter delete_on_closebpo-41246 [https://bugs.python.org/issue?@action=redirect&bpo=41246]: Give the same callback function for when the overlapped operation is done to the functions
recv
,recv_into
,recvfrom
,sendto
,send
andsendfile
insideIocpProactor
.bpo-39264 [https://bugs.python.org/issue?@action=redirect&bpo=39264]: Fixed
collections.UserDict.get()
to not call_missing_()
when a value is not found. This matches the behavior ofdict
. Patch by Bar Harel.bpo-38693 [https://bugs.python.org/issue?@action=redirect&bpo=38693]:
importlib
now uses fstrings internally instead ofstr.format
.bpo-38267 [https://bugs.python.org/issue?@action=redirect&bpo=38267]: Add timeout parameter to
asyncio.loop.shutdown_default_executor()
. The default value isNone
, which means the executor will be given an unlimited amount of time. When called fromasyncio.Runner
orasyncio.run()
, the default timeout is 5 minutes.bpo-34828 [https://bugs.python.org/issue?@action=redirect&bpo=34828]:
sqlite3.Connection.iterdump()
now handles databases that useAUTOINCREMENT
in one or more tables.bpo-32990 [https://bugs.python.org/issue?@action=redirect&bpo=32990]: Support reading wave files with the
WAVE_FORMAT_EXTENSIBLE
format in thewave
module.bpo-26253 [https://bugs.python.org/issue?@action=redirect&bpo=26253]: Allow adjustable compression level for tarfile streams in
tarfile.open()
.