安全性
bpo-35746 [https://bugs.python.org/issue?@action=redirect&bpo=35746]: CVE 2019-5010 [https://www.cve.org/CVERecord?id=CVE-2019-5010]: Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL distribution points with empty DP or URI correctly. A malicious or buggy certificate can result into segfault. Vulnerability (TALOS-2018-0758) reported by Colin Read and Nicolas Edet of Cisco.
bpo-34812 [https://bugs.python.org/issue?@action=redirect&bpo=34812]: The
-I
command line option (run Python in isolated mode) is now also copied by themultiprocessing
anddistutils
modules when spawning child processes. Previously, only-E
and-s
options (enabled by-I
) were copied.bpo-34791 [https://bugs.python.org/issue?@action=redirect&bpo=34791]: The xml.sax and xml.dom.domreg no longer use environment variables to override parser implementations when sys.flags.ignore_environment is set by -E or -I arguments.
bpo-17239 [https://bugs.python.org/issue?@action=redirect&bpo=17239]: The xml.sax and xml.dom.minidom parsers no longer processes external entities by default. External DTD and ENTITY declarations no longer load files or create network connections.
bpo-34623 [https://bugs.python.org/issue?@action=redirect&bpo=34623]: CVE 2018-14647 [https://www.cve.org/CVERecord?id=CVE-2018-14647]: The C accelerated _elementtree module now initializes hash randomization salt from PyHashSecret instead of libexpat's default CSPRNG.
bpo-34405 [https://bugs.python.org/issue?@action=redirect&bpo=34405]: Updated to OpenSSL 1.1.0i for Windows builds.
bpo-33871 [https://bugs.python.org/issue?@action=redirect&bpo=33871]: Fixed sending the part of the file in
os.sendfile()
on macOS. Using the trailers argument could cause sending more bytes from the input file than was specified.bpo-32533 [https://bugs.python.org/issue?@action=redirect&bpo=32533]: Fixed threadsafety of error handling in _ssl.
bpo-33136 [https://bugs.python.org/issue?@action=redirect&bpo=33136]: Harden ssl module against LibreSSL CVE 2018-8970 [https://www.cve.org/CVERecord?id=CVE-2018-8970]. X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new test ensures that NULL bytes are not allowed.
bpo-33001 [https://bugs.python.org/issue?@action=redirect&bpo=33001]: Minimal fix to prevent buffer overrun in os.symlink on Windows
bpo-32981 [https://bugs.python.org/issue?@action=redirect&bpo=32981]: Regexes in difflib and poplib were vulnerable to catastrophic backtracking. These regexes formed potential DOS vectors (REDOS). They have been refactored. This resolves CVE 2018-1060 [https://www.cve.org/CVERecord?id=CVE-2018-1060] and CVE 2018-1061 [https://www.cve.org/CVERecord?id=CVE-2018-1061]. Patch by Jamie Davis.
bpo-28414 [https://bugs.python.org/issue?@action=redirect&bpo=28414]: The ssl module now allows users to perform their own IDN en/decoding when using SNI.
核心与内置函数
bpo-35877 [https://bugs.python.org/issue?@action=redirect&bpo=35877]: Make parenthesis optional for named expressions in while statement. Patch by Karthikeyan Singaravelan.
bpo-35814 [https://bugs.python.org/issue?@action=redirect&bpo=35814]: Allow same right hand side expressions in annotated assignments as in normal ones. In particular,
x: Tuple[int, int] = 1, 2
(without parentheses on the right) is now allowed.bpo-35766 [https://bugs.python.org/issue?@action=redirect&bpo=35766]: Add the option to parse PEP 484 type comments in the ast module. (Off by default.) This is merging the key functionality of the third party fork thereof, typed_ast).
bpo-35713 [https://bugs.python.org/issue?@action=redirect&bpo=35713]: Reorganize Python initialization to get working exceptions and sys.stderr earlier.
bpo-33416 [https://bugs.python.org/issue?@action=redirect&bpo=33416]: Add end line and end column position information to the Python AST nodes. This is a C-level backwards incompatible change.
bpo-35720 [https://bugs.python.org/issue?@action=redirect&bpo=35720]: Fixed a minor memory leak in pymain_parse_cmdline_impl function in Modules/main.c
bpo-35634 [https://bugs.python.org/issue?@action=redirect&bpo=35634]:
func(**kwargs)
will now raise an error whenkwargs
is a mapping containing multiple entries with the same key. An error was already raised when other keyword arguments are passed before**kwargs
since Python 3.6.bpo-35623 [https://bugs.python.org/issue?@action=redirect&bpo=35623]: Fix a crash when sorting very long lists. Patch by Stephan Hohe.
bpo-35214 [https://bugs.python.org/issue?@action=redirect&bpo=35214]: clang Memory Sanitizer build instrumentation was added to work around false positives from posix, socket, time, test_io, and test_faulthandler.
bpo-35560 [https://bugs.python.org/issue?@action=redirect&bpo=35560]: Fix an assertion error in
format()
in debug build for floating-point formatting with "n" format, zero padding and small width. Release build is not impacted. Patch by Karthikeyan Singaravelan.bpo-35552 [https://bugs.python.org/issue?@action=redirect&bpo=35552]: Format characters
%s
and%V
inPyUnicode_FromFormat()
and%s
inPyBytes_FromFormat()
no longer read memory past the limit if precision is specified.bpo-35504 [https://bugs.python.org/issue?@action=redirect&bpo=35504]: Fix segfaults and
SystemError
s when deleting certain attributes. Patch by Zackery Spytz.bpo-35504 [https://bugs.python.org/issue?@action=redirect&bpo=35504]: Fixed a SystemError when delete the characters_written attribute of an OSError.
bpo-35494 [https://bugs.python.org/issue?@action=redirect&bpo=35494]: Improved syntax error messages for unbalanced parentheses in fstring.
bpo-35444 [https://bugs.python.org/issue?@action=redirect&bpo=35444]: Fixed error handling in pickling methods when fail to look up builtin "getattr". Sped up pickling iterators.
bpo-35436 [https://bugs.python.org/issue?@action=redirect&bpo=35436]: Fix various issues with memory allocation error handling. Patch by Zackery Spytz.
bpo-35423 [https://bugs.python.org/issue?@action=redirect&bpo=35423]: Separate the signal handling trigger in the eval loop from the "pending calls" machinery. There is no semantic change and the difference in performance is insignificant.
bpo-35357 [https://bugs.python.org/issue?@action=redirect&bpo=35357]: Internal attributes' names of unittest.mock._Call and unittest.mock.MagicProxy (name, parent & from_kall) are now prefixed with mock in order to prevent clashes with widely used object attributes. Fixed minor typo in test function name.
bpo-35372 [https://bugs.python.org/issue?@action=redirect&bpo=35372]: Fixed the code page decoder for input longer than 2 GiB containing undecodable bytes.
bpo-35336 [https://bugs.python.org/issue?@action=redirect&bpo=35336]: Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C locale if the LC_CTYPE locale is "C".
bpo-31241 [https://bugs.python.org/issue?@action=redirect&bpo=31241]: The lineno and col_offset attributes of AST nodes for list comprehensions, generator expressions and tuples are now point to the opening parenthesis or square brace. For tuples without parenthesis they point to the position of the first item.
bpo-33954 [https://bugs.python.org/issue?@action=redirect&bpo=33954]: For
str.format()
,float.__format__()
andcomplex.__format__()
methods for nonASCII decimal point when using the "n" formatter.bpo-35269 [https://bugs.python.org/issue?@action=redirect&bpo=35269]: Fix a possible segfault involving a newly created coroutine. Patch by Zackery Spytz.
bpo-35224 [https://bugs.python.org/issue?@action=redirect&bpo=35224]: Implement PEP 572 [https://peps.python.org/pep-0572/] (assignment expressions). Patch by Emily Morehouse.
bpo-32492 [https://bugs.python.org/issue?@action=redirect&bpo=32492]: Speed up
namedtuple()
attribute access by 1.6x using a C fastpath for the name descriptors. Patch by Pablo Galindo.bpo-35214 [https://bugs.python.org/issue?@action=redirect&bpo=35214]: Fixed an out of bounds memory access when parsing a truncated unicode escape sequence at the end of a string such as
'\N'
. It would read one byte beyond the end of the memory allocation.bpo-35214 [https://bugs.python.org/issue?@action=redirect&bpo=35214]: The interpreter and extension modules have had annotations added so that they work properly under clang's Memory Sanitizer. A new configure flag —with-memory-sanitizer has been added to make test builds of this nature easier to perform.
bpo-35193 [https://bugs.python.org/issue?@action=redirect&bpo=35193]: Fix an off by one error in the bytecode peephole optimizer where it could read bytes beyond the end of bounds of an array when removing unreachable code. This bug was present in every release of Python 3.6 and 3.7 until now.
bpo-35169 [https://bugs.python.org/issue?@action=redirect&bpo=35169]: Improved error messages for forbidden assignments.
bpo-34022 [https://bugs.python.org/issue?@action=redirect&bpo=34022]: Fix handling of hash-based bytecode files in
zipimport
. Patch by Elvis Pranskevichus.bpo-28401 [https://bugs.python.org/issue?@action=redirect&bpo=28401]: Debug builds will no longer to attempt to import extension modules built for the ABI as they were never compatible to begin with. Patch by Stefano Rivera.
bpo-29341 [https://bugs.python.org/issue?@action=redirect&bpo=29341]: Clarify in the docstrings of
os
methods that pathlike objects are also accepted as input parameters.bpo-35050 [https://bugs.python.org/issue?@action=redirect&bpo=35050]:
socket
: Fix off-by-one bug in length check forAF_ALG
name and type.bpo-29743 [https://bugs.python.org/issue?@action=redirect&bpo=29743]: Raise
ValueError
instead ofOverflowError
in case of a negativelength
in actypes.Array
subclass. Also raiseTypeError
instead ofAttributeError
for non-integerlength
. Original patch by Oren Milman.bpo-16806 [https://bugs.python.org/issue?@action=redirect&bpo=16806]: Fix
lineno
andcol_offset
for multiline string tokens.bpo-35029 [https://bugs.python.org/issue?@action=redirect&bpo=35029]:
SyntaxWarning
raised as an exception at code generation time will be now replaced with aSyntaxError
for better error reporting.bpo-34983 [https://bugs.python.org/issue?@action=redirect&bpo=34983]: Expose
symtable.Symbol.is_nonlocal()
in the symtable module. Patch by Pablo Galindo.bpo-34974 [https://bugs.python.org/issue?@action=redirect&bpo=34974]:
bytes
andbytearray
constructors no longer convert unexpected exceptions (e.g.MemoryError
andKeyboardInterrupt
) toTypeError
.bpo-34939 [https://bugs.python.org/issue?@action=redirect&bpo=34939]: Allow annotated names in module namespace that are declared global before the annotation happens. Patch by Pablo Galindo.
bpo-34973 [https://bugs.python.org/issue?@action=redirect&bpo=34973]: Fixed crash in
bytes()
when thelist
argument is mutated while it is iterated.bpo-34876 [https://bugs.python.org/issue?@action=redirect&bpo=34876]: The lineno and col_offset attributes of the AST for decorated function and class refer now to the position of the corresponding
def
,async def
andclass
instead of the position of the first decorator. This leads to more correct line reporting in tracing. This is the only case when the position of child AST nodes can precede the position of the parent AST node.bpo-34879 [https://bugs.python.org/issue?@action=redirect&bpo=34879]: Fix a possible null pointer dereference in bytesobject.c. Patch by Zackery Spytz.
bpo-34784 [https://bugs.python.org/issue?@action=redirect&bpo=34784]: Fix the implementation of PyStructSequence_NewType in order to create heap allocated StructSequences.
bpo-32912 [https://bugs.python.org/issue?@action=redirect&bpo=32912]: A
SyntaxWarning
is now emitted instead of aDeprecationWarning
for invalid escape sequences in string and bytes literals.bpo-34854 [https://bugs.python.org/issue?@action=redirect&bpo=34854]: Fixed a crash in compiling string annotations containing a lambda with a keyword-only argument that doesn't have a default value.
bpo-34850 [https://bugs.python.org/issue?@action=redirect&bpo=34850]: The compiler now produces a
SyntaxWarning
when identity checks (is
andis not
) are used with certain types of literals (e.g. strings, ints). These can often work by accident in CPython, but are not guaranteed by the language spec. The warning advises users to use equality tests (==
and!=
) instead.bpo-34824 [https://bugs.python.org/issue?@action=redirect&bpo=34824]: Fix a possible null pointer dereference in Modules/_ssl.c. Patch by Zackery Spytz.
bpo-30156 [https://bugs.python.org/issue?@action=redirect&bpo=30156]: The C function
property_descr_get()
uses a "cached" tuple to optimize function calls. But this tuple can be discovered in debug mode withsys.getobjects()
. Remove the optimization, it's not really worth it and it causes 3 different crashes last years.bpo-34762 [https://bugs.python.org/issue?@action=redirect&bpo=34762]: Fix contextvars C API to use PyObject* pointer types.
bpo-34751 [https://bugs.python.org/issue?@action=redirect&bpo=34751]: The hash function for tuples is now based on xxHash which gives better collision results on (formerly) pathological cases. Additionally, on 64-bit systems it improves tuple hashes in general. Patch by Jeroen Demeyer with substantial contributions by Tim Peters.
bpo-34735 [https://bugs.python.org/issue?@action=redirect&bpo=34735]: Fix a memory leak in Modules/timemodule.c. Patch by Zackery Spytz.
bpo-34683 [https://bugs.python.org/issue?@action=redirect&bpo=34683]: Fixed a bug where some SyntaxError error pointed to locations that were off-by-one.
bpo-34651 [https://bugs.python.org/issue?@action=redirect&bpo=34651]: Only allow the main interpreter to fork. The avoids the possibility of affecting the main interpreter, which is critical to operation of the runtime.
bpo-34653 [https://bugs.python.org/issue?@action=redirect&bpo=34653]: Remove unused function PyParser_SimpleParseStringFilename.
bpo-32236 [https://bugs.python.org/issue?@action=redirect&bpo=32236]: Warn that line buffering is not supported if
open()
is called with binary mode andbuffering=1
.bpo-34641 [https://bugs.python.org/issue?@action=redirect&bpo=34641]: Further restrict the syntax of the left-hand side of keyword arguments in function calls. In particular,
f((keyword)=arg)
is now disallowed.bpo-34637 [https://bugs.python.org/issue?@action=redirect&bpo=34637]: Make the start argument to sum() visible as a keyword argument.
bpo-1621 [https://bugs.python.org/issue?@action=redirect&bpo=1621]: Do not assume signed integer overflow behavior (C undefined behavior) when performing set hash table resizing.
bpo-34588 [https://bugs.python.org/issue?@action=redirect&bpo=34588]: Fix an off-by-one in the recursive call pruning feature of traceback formatting.
bpo-34485 [https://bugs.python.org/issue?@action=redirect&bpo=34485]: On Windows, the LC_CTYPE is now set to the user preferred locale at startup. Previously, the LC_CTYPE locale was "C" at startup, but changed when calling setlocale(LC_CTYPE, "") or setlocale(LC_ALL, "").
bpo-34485 [https://bugs.python.org/issue?@action=redirect&bpo=34485]: Standard streams like sys.stdout now use the "surrogateescape" error handler, instead of "strict", on the POSIX locale (when the C locale is not coerced and the UTF-8 Mode is disabled).
bpo-34485 [https://bugs.python.org/issue?@action=redirect&bpo=34485]: Fix the error handler of standard streams like sys.stdout: PYTHONIOENCODING=":" is now ignored instead of setting the error handler to "strict".
bpo-34485 [https://bugs.python.org/issue?@action=redirect&bpo=34485]: Python now gets the locale encoding with C code to initialize the encoding of standard streams like sys.stdout. Moreover, the encoding is now initialized to the Python codec name to get a normalized encoding name and to ensure that the codec is loaded. The change avoids importing bootlocale and locale modules at startup by default.
bpo-34527 [https://bugs.python.org/issue?@action=redirect&bpo=34527]: On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if the LC_CTYPE locale is "C".
bpo-34527 [https://bugs.python.org/issue?@action=redirect&bpo=34527]: The UTF-8 Mode is now also enabled by the "POSIX" locale, not only by the "C" locale.
bpo-34403 [https://bugs.python.org/issue?@action=redirect&bpo=34403]: On HP-UX with C or POSIX locale, sys.getfilesystemencoding() now returns "ascii" instead of "roman8" (when the UTF-8 Mode is disabled and the C locale is not coerced).
bpo-34523 [https://bugs.python.org/issue?@action=redirect&bpo=34523]: The Python filesystem encoding is now read earlier during the Python initialization.
bpo-12458 [https://bugs.python.org/issue?@action=redirect&bpo=12458]: Tracebacks show now correct line number for subexpressions in multiline expressions. Tracebacks show now the line number of the first line for multiline expressions instead of the line number of the last subexpression.
bpo-34408 [https://bugs.python.org/issue?@action=redirect&bpo=34408]: Prevent a null pointer dereference and resource leakage in
PyInterpreterState_New()
.bpo-34400 [https://bugs.python.org/issue?@action=redirect&bpo=34400]: Fix undefined behavior in parsetok.c. Patch by Zackery Spytz.
bpo-33073 [https://bugs.python.org/issue?@action=redirect&bpo=33073]: Added as_integer_ratio to ints to make them more interoperable with floats.
bpo-34377 [https://bugs.python.org/issue?@action=redirect&bpo=34377]: Update valgrind suppression list to use
PyObjectFree
/PyObjectRealloc
instead ofPyObject_Free
/PyObject_Realloc
.bpo-34353 [https://bugs.python.org/issue?@action=redirect&bpo=34353]: Added the "socket" option in the
stat.filemode()
Python implementation to match the C implementation.bpo-34320 [https://bugs.python.org/issue?@action=redirect&bpo=34320]: Fix
dict(od)
didn't copy iteration order of OrderedDict.bpo-34113 [https://bugs.python.org/issue?@action=redirect&bpo=34113]: Fixed crash on debug builds when opcode stack was adjusted with negative numbers. Patch by Constantin Petrisor.
bpo-34100 [https://bugs.python.org/issue?@action=redirect&bpo=34100]: Compiler now merges constants in tuples and frozensets recursively. Code attributes like
co_names
are merged too.bpo-34151 [https://bugs.python.org/issue?@action=redirect&bpo=34151]: Performance of list concatenation, repetition and slicing operations is slightly improved. Patch by Sergey Fedoseev.
bpo-34170 [https://bugs.python.org/issue?@action=redirect&bpo=34170]: -X dev: it is now possible to override the memory allocator using PYTHONMALLOC even if the developer mode is enabled.
bpo-33237 [https://bugs.python.org/issue?@action=redirect&bpo=33237]: Improved
AttributeError
message for partially initialized module.bpo-34149 [https://bugs.python.org/issue?@action=redirect&bpo=34149]: Fix min and max functions to get default behavior when key is None.
bpo-34125 [https://bugs.python.org/issue?@action=redirect&bpo=34125]: Profiling of unbound builtin methods now works when
**kwargs
is given.bpo-34141 [https://bugs.python.org/issue?@action=redirect&bpo=34141]: Optimized pickling atomic types (None, bool, int, float, bytes, str).
bpo-34126 [https://bugs.python.org/issue?@action=redirect&bpo=34126]: Fix crashes when profiling certain invalid calls of unbound methods. Patch by Jeroen Demeyer.
bpo-24618 [https://bugs.python.org/issue?@action=redirect&bpo=24618]: Fixed reading invalid memory when create the code object with too small varnames tuple or too large argument counts.
bpo-34068 [https://bugs.python.org/issue?@action=redirect&bpo=34068]: In
io.IOBase.close()
, ensure that theclosed
attribute is not set with a live exception. Patch by Zackery Spytz and Serhiy Storchaka.bpo-34087 [https://bugs.python.org/issue?@action=redirect&bpo=34087]: Fix buffer overflow while converting unicode to numeric values.
bpo-34080 [https://bugs.python.org/issue?@action=redirect&bpo=34080]: Fixed a memory leak in the compiler when it raised some uncommon errors during tokenizing.
bpo-34066 [https://bugs.python.org/issue?@action=redirect&bpo=34066]: Disabled interruption by Ctrl-C between calling
open()
and entering a with block inwith open()
.bpo-34042 [https://bugs.python.org/issue?@action=redirect&bpo=34042]: Fix dict.copy() to maintain correct total refcount (as reported by sys.gettotalrefcount()).
bpo-33418 [https://bugs.python.org/issue?@action=redirect&bpo=33418]: Fix potential memory leak in function object when it creates reference cycle.
bpo-33985 [https://bugs.python.org/issue?@action=redirect&bpo=33985]: Implement contextvars.ContextVar.name attribute.
bpo-33956 [https://bugs.python.org/issue?@action=redirect&bpo=33956]: Update vendored Expat library copy to version 2.2.5.
bpo-24596 [https://bugs.python.org/issue?@action=redirect&bpo=24596]: Decref the module object in
PyRun_SimpleFileExFlags()
before callingPyErr_Print()
. Patch by Zackery Spytz.bpo-33451 [https://bugs.python.org/issue?@action=redirect&bpo=33451]: Close directly executed pyc files before calling
PyEval_EvalCode()
.bpo-1617161 [https://bugs.python.org/issue?@action=redirect&bpo=1617161]: The hash of
BuiltinMethodType
instances (methods of builtin classes) now depends on the hash of the identity of self instead of its value. The hash and equality ofModuleType
andMethodWrapperType
instances (methods of user-defined classes and some methods of builtin classes likestr.__add__
) now depend on the hash and equality of the identity of self instead of its value.MethodWrapperType
instances no longer support ordering.bpo-33824 [https://bugs.python.org/issue?@action=redirect&bpo=33824]: Fix "LC_ALL=C python3.7 -V": reset properly the command line parser when the encoding changes after reading the Python configuration.
bpo-33803 [https://bugs.python.org/issue?@action=redirect&bpo=33803]: Fix a crash in hamt.c caused by enabling GC tracking for an object that hadn't all of its fields set to NULL.
bpo-33738 [https://bugs.python.org/issue?@action=redirect&bpo=33738]: Seven macro incompatibilities with the Limited API were fixed, and the macros
PyIter_Check()
,PyIndex_Check()
andPyExceptionClass_Name()
were added as functions. A script for automatic macro checks was added.bpo-33786 [https://bugs.python.org/issue?@action=redirect&bpo=33786]: Fix asynchronous generators to handle GeneratorExit in athrow() correctly
bpo-30167 [https://bugs.python.org/issue?@action=redirect&bpo=30167]:
PyRun_SimpleFileExFlags
removes__cached__
from module in addition to__file__
.bpo-33706 [https://bugs.python.org/issue?@action=redirect&bpo=33706]: Fix a crash in Python initialization when parsing the command line options. Thanks Christoph Gohlke for the bug report and the fix!
bpo-33597 [https://bugs.python.org/issue?@action=redirect&bpo=33597]: Reduce
PyGC_Head
size from 3 words to 2 words.bpo-30654 [https://bugs.python.org/issue?@action=redirect&bpo=30654]: Fixed reset of the SIGINT handler to SIG_DFL on interpreter shutdown even when there was a custom handler set previously. Patch by Philipp Kerling.
bpo-33622 [https://bugs.python.org/issue?@action=redirect&bpo=33622]: Fixed a leak when the garbage collector fails to add an object with the
__del__
method or referenced by it into thegc.garbage
list.PyGC_Collect()
can now be called when an exception is set and preserves it.bpo-33462 [https://bugs.python.org/issue?@action=redirect&bpo=33462]: Make dict and dict views reversible. Patch by Rémi Lapeyre.
bpo-23722 [https://bugs.python.org/issue?@action=redirect&bpo=23722]: A
RuntimeError
is now raised when the custom metaclass doesn't provide the__classcell__
entry in the namespace passed totype._new_
. ADeprecationWarning
was emitted in Python 3.6—3.7.bpo-33499 [https://bugs.python.org/issue?@action=redirect&bpo=33499]: Add
PYTHONPYCACHEPREFIX
environment variable and-X
pycache_prefix
commandline option to set an alternate root directory for writing module bytecode cache files.bpo-25711 [https://bugs.python.org/issue?@action=redirect&bpo=25711]: The
zipimport
module has been rewritten in pure Python.bpo-33509 [https://bugs.python.org/issue?@action=redirect&bpo=33509]: Fix module_globals parameter of warnings.warn_explicit(): don't crash if module_globals is not a dict.
bpo-31849 [https://bugs.python.org/issue?@action=redirect&bpo=31849]: Fix signed/unsigned comparison warning in pyhash.c.
bpo-33475 [https://bugs.python.org/issue?@action=redirect&bpo=33475]: Fixed miscellaneous bugs in converting annotations to strings and optimized parentheses in the string representation.
bpo-20104 [https://bugs.python.org/issue?@action=redirect&bpo=20104]: Added support for the
setpgroup
,resetids
,setsigmask
,setsigdef
andscheduler
parameters ofposix_spawn
. Patch by Pablo Galindo.bpo-33391 [https://bugs.python.org/issue?@action=redirect&bpo=33391]: Fix a leak in set_symmetric_difference().
bpo-33363 [https://bugs.python.org/issue?@action=redirect&bpo=33363]: Raise a SyntaxError for
async with
andasync for
statements outside of async functions.bpo-28055 [https://bugs.python.org/issue?@action=redirect&bpo=28055]: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer.
bpo-33128 [https://bugs.python.org/issue?@action=redirect&bpo=33128]: Fix a bug that causes PathFinder to appear twice on sys.meta_path. Patch by Pablo Galindo Salgado.
bpo-33331 [https://bugs.python.org/issue?@action=redirect&bpo=33331]: Modules imported last are now cleared first at interpreter shutdown.
bpo-33312 [https://bugs.python.org/issue?@action=redirect&bpo=33312]: Fixed clang ubsan (undefined behavior sanitizer) warnings in dictobject.c by adjusting how the internal struct _dictkeysobject shared keys structure is declared.
bpo-33305 [https://bugs.python.org/issue?@action=redirect&bpo=33305]: Improved syntax error messages for invalid numerical literals.
bpo-33306 [https://bugs.python.org/issue?@action=redirect&bpo=33306]: Improved syntax error messages for unbalanced parentheses.
bpo-33234 [https://bugs.python.org/issue?@action=redirect&bpo=33234]: The list constructor will presize and not overallocate when the input length is known.
bpo-33270 [https://bugs.python.org/issue?@action=redirect&bpo=33270]: Intern the names for all anonymous code objects. Patch by Zackery Spytz.
bpo-30455 [https://bugs.python.org/issue?@action=redirect&bpo=30455]: The C and Python code and the documentation related to tokens are now generated from a single source file
Grammar/Tokens
.bpo-33176 [https://bugs.python.org/issue?@action=redirect&bpo=33176]: Add a
toreadonly()
method to memoryviews.bpo-33231 [https://bugs.python.org/issue?@action=redirect&bpo=33231]: Fix potential memory leak in
normalizestring()
.bpo-33205 [https://bugs.python.org/issue?@action=redirect&bpo=33205]: Change dict growth function from
round_up_to_power_2(used*2+hashtable_size/2)
toround_up_to_power_2(used*3)
. Previously, dict is shrinked only whenused == 0
. Now dict has more chance to be shrinked.bpo-29922 [https://bugs.python.org/issue?@action=redirect&bpo=29922]: Improved error messages in 'async with' when
__aenter__()
or__aexit__()
return non-awaitable object.bpo-33199 [https://bugs.python.org/issue?@action=redirect&bpo=33199]: Fix
ma_version_tag
in dict implementation is uninitialized when copying from key-sharing dict.bpo-33053 [https://bugs.python.org/issue?@action=redirect&bpo=33053]: When using the -m switch, sys.path[0] is now explicitly expanded as the starting working directory, rather than being left as the empty path (which allows imports from the current working directory at the time of the import)
bpo-33138 [https://bugs.python.org/issue?@action=redirect&bpo=33138]: Changed standard error message for non-pickleable and non-copyable types. It now says "cannot pickle" instead of "can't pickle" or "cannot serialize".
bpo-33018 [https://bugs.python.org/issue?@action=redirect&bpo=33018]: Improve consistency of errors raised by
issubclass()
when called with a non-class and an abstract base class as the first and second arguments, respectively. Patch by Josh Bronson.bpo-33083 [https://bugs.python.org/issue?@action=redirect&bpo=33083]:
math.factorial
no longer accepts arguments that are not int-like. Patch by Pablo Galindo.bpo-33041 [https://bugs.python.org/issue?@action=redirect&bpo=33041]: Added new opcode
END_ASYNC_FOR
and fixes the following issues:Setting global
StopAsyncIteration
no longer breaksasync for
loops.跳入一个
async for
循环现在被禁止了。跳出一个
async for
循环不再会破坏堆栈了。
bpo-25750 [https://bugs.python.org/issue?@action=redirect&bpo=25750]: Fix rare Python crash due to bad refcounting in
type_getattro()
if a descriptor deletes itself from the class. Patch by Jeroen Demeyer.bpo-33041 [https://bugs.python.org/issue?@action=redirect&bpo=33041]: Fixed bytecode generation for "async for" with a complex target. A StopAsyncIteration raised on assigning or unpacking will be now propagated instead of stopping the iteration.
bpo-33026 [https://bugs.python.org/issue?@action=redirect&bpo=33026]: Fixed jumping out of "with" block by setting f_lineno.
bpo-33005 [https://bugs.python.org/issue?@action=redirect&bpo=33005]: Fix a crash on fork when using a custom memory allocator (ex: using PYTHONMALLOC env var). PyGILStateReinit() and PyInterpreterStateEnable() now use the default RAW memory allocator to allocate a new interpreters mutex on fork.
bpo-32911 [https://bugs.python.org/issue?@action=redirect&bpo=32911]: Due to unexpected compatibility issues discovered during downstream beta testing, reverted bpo-29463 [https://bugs.python.org/issue?@action=redirect&bpo=29463].
docstring
field is removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes which was added in 3.7a1. Docstring expression is restored as a first statement in their body. Based on patch by Inada Naoki.bpo-17288 [https://bugs.python.org/issue?@action=redirect&bpo=17288]: Prevent jumps from 'return' and 'exception' trace events.
bpo-32946 [https://bugs.python.org/issue?@action=redirect&bpo=32946]: Importing names from already imported module with "from … import …" is now 30% faster if the module is not a package.
bpo-32932 [https://bugs.python.org/issue?@action=redirect&bpo=32932]: Make error message more revealing when there are non-str objects in
__all__
.bpo-32925 [https://bugs.python.org/issue?@action=redirect&bpo=32925]: Optimized iterating and containing test for literal lists consisting of non-constants:
x in [a, b]
andfor x in [a, b]
. The case of all constant elements already was optimized.bpo-32889 [https://bugs.python.org/issue?@action=redirect&bpo=32889]: Update Valgrind suppression list to account for the rename of
Py_ADDRESS_IN_RANG
toaddress_in_range
.bpo-32836 [https://bugs.python.org/issue?@action=redirect&bpo=32836]: Don't use temporary variables in cases of list/dict/set comprehensions
bpo-31356 [https://bugs.python.org/issue?@action=redirect&bpo=31356]: Remove the new API added in bpo-31356 [https://bugs.python.org/issue?@action=redirect&bpo=31356] (gc.ensure_disabled() context manager).
bpo-32305 [https://bugs.python.org/issue?@action=redirect&bpo=32305]: For namespace packages, ensure that both
__file__
and__spec__.origin
are set to None.bpo-32303 [https://bugs.python.org/issue?@action=redirect&bpo=32303]: Make sure
__spec__.loader
matches__loader__
for namespace packages.bpo-32711 [https://bugs.python.org/issue?@action=redirect&bpo=32711]: Fix the warning messages for Python/ast_unparse.c. Patch by Stéphane Wirtel
bpo-32583 [https://bugs.python.org/issue?@action=redirect&bpo=32583]: Fix possible crashing in builtin Unicode decoders caused by write out-of-bound errors when using customized decode error handlers.
bpo-32489 [https://bugs.python.org/issue?@action=redirect&bpo=32489]: A
continue
statement is now allowed in thefinally
clause.bpo-17611 [https://bugs.python.org/issue?@action=redirect&bpo=17611]: Simplified the interpreter loop by moving the logic of unrolling the stack of blocks into the compiler. The compiler emits now explicit instructions for adjusting the stack of values and calling the cleaning up code for
break
,continue
andreturn
.
Removed opcodes BREAK_LOOP
, CONTINUE_LOOP
, SETUP_LOOP
and SETUP_EXCEPT
. Added new opcodes ROT_FOUR
, BEGIN_FINALLY
and CALL_FINALLY
and POP_FINALLY
. Changed the behavior of END_FINALLY
and WITH_CLEANUP_START
.
bpo-32285 [https://bugs.python.org/issue?@action=redirect&bpo=32285]: New function unicodedata.is_normalized, which can check whether a string is in a specific normal form.
bpo-10544 [https://bugs.python.org/issue?@action=redirect&bpo=10544]: Yield expressions are now disallowed in comprehensions and generator expressions except the expression for the outermost iterable.
bpo-32117 [https://bugs.python.org/issue?@action=redirect&bpo=32117]: Iterable unpacking is now allowed without parentheses in yield and return statements, e.g.
yield 1, 2, 3, *rest
. Thanks to David Cuthbert for the change and Jordan Chapman for added tests.bpo-31902 [https://bugs.python.org/issue?@action=redirect&bpo=31902]: Fix the
col_offset
attribute for ast nodesast.AsyncFor
,ast.AsyncFunctionDef
, andast.AsyncWith
. Previously,col_offset
pointed to the keyword afterasync
.bpo-25862 [https://bugs.python.org/issue?@action=redirect&bpo=25862]: Fix assertion failures in the
tell()
method ofio.TextIOWrapper
. Patch by Zackery Spytz.bpo-21983 [https://bugs.python.org/issue?@action=redirect&bpo=21983]: Fix a crash in
ctypes.cast()
in case the type argument is a ctypes structured data type. Patch by Eryk Sun and Oren Milman.bpo-31577 [https://bugs.python.org/issue?@action=redirect&bpo=31577]: Fix a crash in
os.utime()
in case of a bad ns argument. Patch by Oren Milman.bpo-29832 [https://bugs.python.org/issue?@action=redirect&bpo=29832]: Remove references to 'getsockaddrarg' from various socket error messages. Patch by Oren Milman.