构建
bpo-39395 [https://bugs.python.org/issue?@action=redirect&bpo=39395]: On non-Windows platforms, the
setenv()
andunsetenv()
functions are now required to build Python.bpo-39160 [https://bugs.python.org/issue?@action=redirect&bpo=39160]: Updated the documentation in
./configure --help
to show default values, reference documentation where required and add additional explanation where needed.bpo-39144 [https://bugs.python.org/issue?@action=redirect&bpo=39144]: The ctags and etags build targets both include Modules/_ctypes and Python standard library source files.
IDLE
bpo-39050 [https://bugs.python.org/issue?@action=redirect&bpo=39050]: Make IDLE Settings dialog Help button work again.
bpo-34118 [https://bugs.python.org/issue?@action=redirect&bpo=34118]: Tag memoryview, range, and tuple as classes, the same as list, etcetera, in the library manual builtin functions list.
bpo-32989 [https://bugs.python.org/issue?@action=redirect&bpo=32989]: Add tests for editor newline_and_indent_event method. Remove dead code from pyparse find_good_parse_start method.
C API
bpo-39372 [https://bugs.python.org/issue?@action=redirect&bpo=39372]: Clean header files of interfaces defined but with no implementation. The public API symbols being removed are:
PyBytesInsertThousandsGroupingLocale
,PyBytesInsertThousandsGrouping
,PyInitializeFromArgs
,PyInitializeFromWideArgs
,PyFloatRepr
,PyFloatDigits
,PyFloatDigitsInit
,PyFrame_ExtendStack
,PyAIterWrapperType
,PyNullImporter_Type
,PyCmpWrapper_Type
,PySortWrapper_Type
,PyNoArgsFunction
.bpo-39164 [https://bugs.python.org/issue?@action=redirect&bpo=39164]: Add a private
PyErrGetExcInfo()
function to retrieve exception information of the specified Python thread state.
Python 3.9.0 alpha 2
发布日期: 2019-12-18
安全性
bpo-38945 [https://bugs.python.org/issue?@action=redirect&bpo=38945]: Newline characters have been escaped when performing uu encoding to prevent them from overflowing into to content section of the encoded file. This prevents malicious or accidental modification of data during the decoding process.
bpo-37228 [https://bugs.python.org/issue?@action=redirect&bpo=37228]: Due to significant security concerns, the reuse_address parameter of
asyncio.loop.create_datagram_endpoint()
is no longer supported. This is because of the behavior ofSO_REUSEADDR
in UDP. For more details, see the documentation forloop.create_datagram_endpoint()
. (Contributed by Kyle Stanley, Antoine Pitrou, and Yury Selivanov in bpo-37228 [https://bugs.python.org/issue?@action=redirect&bpo=37228].)bpo-38804 [https://bugs.python.org/issue?@action=redirect&bpo=38804]: Fixes a ReDoS vulnerability in
http.cookiejar
. Patch by Ben Caller.
核心与内置函数
bpo-39028 [https://bugs.python.org/issue?@action=redirect&bpo=39028]: Slightly improve the speed of keyword argument parsing with many kwargs by strengthening the assumption that kwargs are interned strings.
bpo-39080 [https://bugs.python.org/issue?@action=redirect&bpo=39080]: Fix the value of end_col_offset for Starred Expression AST nodes when they are among the elements in the args attribute of Call AST nodes.
bpo-39031 [https://bugs.python.org/issue?@action=redirect&bpo=39031]: When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node. Patch by Lysandros Nikolaou.
bpo-20443 [https://bugs.python.org/issue?@action=redirect&bpo=20443]: In Python 3.9.0a1, sys.argv[0] was made an absolute path if a filename was specified on the command line. Revert this change, since most users expect sys.argv to be unmodified.
bpo-39008 [https://bugs.python.org/issue?@action=redirect&bpo=39008]:
PySys_Audit()
now requiresPy_ssize_t
to be used for size arguments in the format string, regardless of whetherPY_SSIZE_T_CLEAN
was defined at include time.bpo-38673 [https://bugs.python.org/issue?@action=redirect&bpo=38673]: In REPL mode, don't switch to PS2 if the line starts with comment or whitespace. Based on work by Batuhan Taşkaya.
bpo-38922 [https://bugs.python.org/issue?@action=redirect&bpo=38922]: Calling
replace
on a code object now raises thecode._new_
audit event.bpo-38920 [https://bugs.python.org/issue?@action=redirect&bpo=38920]: Add audit hooks for when
sys.excepthook()
andsys.unraisablehook()
are invoked.bpo-38892 [https://bugs.python.org/issue?@action=redirect&bpo=38892]: Improve documentation for audit events table and functions.
bpo-38852 [https://bugs.python.org/issue?@action=redirect&bpo=38852]: Set the thread stack size to 8 Mb for debug builds on android platforms.
bpo-38858 [https://bugs.python.org/issue?@action=redirect&bpo=38858]: Each Python subinterpreter now has its own "small integer singletons": numbers in [-5; 257] range. It is no longer possible to change the number of small integers at build time by overriding
NSMALLNEGINTS
andNSMALLPOSINTS
macros: macros should now be modified manually inpycore_pystate.h
header file.bpo-36854 [https://bugs.python.org/issue?@action=redirect&bpo=36854]: The garbage collector state becomes per interpreter (
PyInterpreterState.gc
), rather than being global (_PyRuntimeState.gc
).bpo-38835 [https://bugs.python.org/issue?@action=redirect&bpo=38835]: The
PyFPE_START_PROTECT()
andPyFPE_END_PROTECT()
macros are empty: they have been doing nothing for the last year, so stop using them.bpo-38328 [https://bugs.python.org/issue?@action=redirect&bpo=38328]: Sped up the creation time of constant
list
andset
displays. Patch by Brandt Bucher.bpo-38707 [https://bugs.python.org/issue?@action=redirect&bpo=38707]:
MainThread.native_id
is now correctly reset in child processes spawned usingmultiprocessing.Process
, instead of retaining the parent's value.bpo-38629 [https://bugs.python.org/issue?@action=redirect&bpo=38629]: Added
__floor__
and__ceil__
methods to float object. Patch by Batuhan Taşkaya.bpo-27145 [https://bugs.python.org/issue?@action=redirect&bpo=27145]: int + int and int - int operators can now return small integer singletons. Patch by hongweipeng.
bpo-38021 [https://bugs.python.org/issue?@action=redirect&bpo=38021]: Provide a platform tag for AIX that is sufficient for PEP425 binary distribution identification. Patch by Michael Felt.
bpo-35409 [https://bugs.python.org/issue?@action=redirect&bpo=35409]: Ignore GeneratorExit exceptions when throwing an exception into the aclose coroutine of an asynchronous generator.
bpo-33387 [https://bugs.python.org/issue?@action=redirect&bpo=33387]: Removed WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Replaced with RERAISE and WITH_EXCEPT_START bytecodes. The compiler now generates different code for exceptional and non-exceptional branches for 'with' and 'try-except' statements. For 'try-finally' statements the 'finally' block is replicated for each exit from the 'try' body.
库
bpo-39033 [https://bugs.python.org/issue?@action=redirect&bpo=39033]: Fix
NameError
inzipimport
. Patch by Karthikeyan Singaravelan.bpo-39022 [https://bugs.python.org/issue?@action=redirect&bpo=39022]: Update importlib.metadata to include improvements from importlib_metadata 1.3 including better serialization of EntryPoints and improved documentation for custom finders.
bpo-39006 [https://bugs.python.org/issue?@action=redirect&bpo=39006]: Fix asyncio when the ssl module is missing: only check for ssl.SSLSocket instance if the ssl module is available.
bpo-38708 [https://bugs.python.org/issue?@action=redirect&bpo=38708]: Fix a potential IndexError in email parser when parsing an empty msg-id.
bpo-38698 [https://bugs.python.org/issue?@action=redirect&bpo=38698]: Add a new
InvalidMessageID
token to email parser to represent invalid MessageID headers. Also, add defects when there is remaining value after parsing the header.bpo-38994 [https://bugs.python.org/issue?@action=redirect&bpo=38994]: Implement
__class_getitem__
foros.PathLike
,pathlib.Path
.bpo-38979 [https://bugs.python.org/issue?@action=redirect&bpo=38979]: Return class from
ContextVar.__class_getitem__
to simplify subclassing.bpo-38978 [https://bugs.python.org/issue?@action=redirect&bpo=38978]: Implement
__class_getitem__
on asyncio objects (Future, Task, Queue). Patch by Batuhan Taskaya.bpo-38916 [https://bugs.python.org/issue?@action=redirect&bpo=38916]:
array.array
: Removetostring()
andfromstring()
methods. They were aliases totobytes()
andfrombytes()
, deprecated since Python 3.2.bpo-38986 [https://bugs.python.org/issue?@action=redirect&bpo=38986]: Make repr of C accelerated TaskWakeupMethWrapper the same as of pure Python version.
bpo-38982 [https://bugs.python.org/issue?@action=redirect&bpo=38982]: Fix asyncio
PidfdChildWatcher
: handlewaitpid()
error. Ifwaitpid()
is called elsewhere,waitpid()
call fails withChildProcessError
: use return code 255 in this case, and log a warning. It ensures that the pidfd file descriptor is closed if this error occurs.bpo-38529 [https://bugs.python.org/issue?@action=redirect&bpo=38529]: Drop too noisy asyncio warning about deletion of a stream without explicit
.close()
call.bpo-27413 [https://bugs.python.org/issue?@action=redirect&bpo=27413]: Added ability to pass through
ensure_ascii
options to json.dumps in thejson.tool
commandline interface.bpo-38634 [https://bugs.python.org/issue?@action=redirect&bpo=38634]: The
readline
module now detects if Python is linked to libedit at runtime on all platforms. Previously, the check was only done on macOS.bpo-33684 [https://bugs.python.org/issue?@action=redirect&bpo=33684]: Fix
json.tool
failed to read a JSON file with nonASCII characters when locale encoding is not UTF-8.bpo-38698 [https://bugs.python.org/issue?@action=redirect&bpo=38698]: Prevent UnboundLocalError to pop up in parse_message_id.
parse_message_id() was improperly using a token defined inside an exception handler, which was raising UnboundLocalError
on parsing an invalid value. Patch by Claudiu Popa.
bpo-38927 [https://bugs.python.org/issue?@action=redirect&bpo=38927]: Use
python -m pip
instead ofpip
to upgrade dependencies in venv.bpo-26730 [https://bugs.python.org/issue?@action=redirect&bpo=26730]: Fix
SpooledTemporaryFile.rollover()
might corrupt the file when it is in text mode. Patch by Serhiy Storchaka.bpo-38881 [https://bugs.python.org/issue?@action=redirect&bpo=38881]: random.choices() now raises a ValueError when all the weights are zero.
bpo-38876 [https://bugs.python.org/issue?@action=redirect&bpo=38876]: Raise pickle.UnpicklingError when loading an item from memo for invalid input.
The previous code was raising a KeyError
for both the Python and C implementation. This was caused by the specified index of an invalid input which did not exist in the memo structure, where the pickle stores what objects it has seen. The malformed input would have caused either a BINGET
or LONG_BINGET
load from the memo, leading to a KeyError
as the determined index was bogus. Patch by Claudiu Popa.
bpo-38688 [https://bugs.python.org/issue?@action=redirect&bpo=38688]: Calling func:
shutil.copytree
to copy a directory tree from one directory to another subdirectory resulted in an endless loop and a RecursionError. A fix was added to consume an iterator and create the list of the entries to be copied, avoiding the recursion for newly created directories. Patch by Bruno P. Kinoshita.bpo-38863 [https://bugs.python.org/issue?@action=redirect&bpo=38863]: Improve
is_cgi()
function inhttp.server
, which enables processing the case that cgi directory is a child of another directory other than root.bpo-37838 [https://bugs.python.org/issue?@action=redirect&bpo=37838]:
typing.get_type_hints()
properly handles functions decorated withfunctools.wraps()
.bpo-38870 [https://bugs.python.org/issue?@action=redirect&bpo=38870]: Expose
ast.unparse()
as a function of theast
module that can be used to unparse anast.AST
object and produce a string with code that would produce an equivalentast.AST
object when parsed. Patch by Pablo Galindo and Batuhan Taskaya.bpo-38859 [https://bugs.python.org/issue?@action=redirect&bpo=38859]: AsyncMock now returns StopAsyncIteration on the exhaustion of a side_effects iterable. Since PEP-479 its Impossible to raise a StopIteration exception from a coroutine.
bpo-38857 [https://bugs.python.org/issue?@action=redirect&bpo=38857]: AsyncMock fix for return values that are awaitable types. This also covers side_effect iterable values that happened to be awaitable, and wraps callables that return an awaitable type. Before these awaitables were being awaited instead of being returned as is.
bpo-38834 [https://bugs.python.org/issue?@action=redirect&bpo=38834]:
typing.TypedDict
subclasses now track which keys are optional using the__required_keys__
and__optional_keys__
attributes, to enable runtime validation by downstream projects. Patch by Zac Hatfield-Dodds.bpo-38821 [https://bugs.python.org/issue?@action=redirect&bpo=38821]: Fix unhandled exceptions in
argparse
when internationalizing error messages for arguments withnargs
set to special (non-integer) values. Patch by Federico Bond.bpo-38820 [https://bugs.python.org/issue?@action=redirect&bpo=38820]: Make Python compatible with OpenSSL 3.0.0.
ssl.SSLSocket.getpeercert()
no longer returns IPv6 addresses with a trailing new line.bpo-38811 [https://bugs.python.org/issue?@action=redirect&bpo=38811]: Fix an unhandled exception in
pathlib
whenos.link()
is missing. Patch by Toke Høiland-Jørgensen.bpo-38686 [https://bugs.python.org/issue?@action=redirect&bpo=38686]: Added support for multiple
qop
values inurllib.request.AbstractDigestAuthHandler
.bpo-38712 [https://bugs.python.org/issue?@action=redirect&bpo=38712]: Add the Linux-specific
signal.pidfd_send_signal()
function, which allows sending a signal to a process identified by a file descriptor rather than a pid.bpo-38348 [https://bugs.python.org/issue?@action=redirect&bpo=38348]: Add
-i
and--indent
(indentation level), and--no-type-comments
(type comments) command line options to ast parsing tool.bpo-37523 [https://bugs.python.org/issue?@action=redirect&bpo=37523]: Change
zipfile.ZipExtFile
to raiseValueError
when trying to access the underlying file object after it has been closed. This new behavior is consistent with how accessing closed files is handled in other parts of Python.bpo-38045 [https://bugs.python.org/issue?@action=redirect&bpo=38045]: Improve the performance of
enum._decompose()
inenum
. Patch by hongweipeng.bpo-36820 [https://bugs.python.org/issue?@action=redirect&bpo=36820]: Break cycle generated when saving an exception in socket.py, codeop.py and dyld.py as they keep alive not only the exception but user objects through the
__traceback__
attribute. Patch by Mario Corchero.bpo-36406 [https://bugs.python.org/issue?@action=redirect&bpo=36406]: Handle namespace packages in
doctest
. Patch by Karthikeyan Singaravelan.bpo-34776 [https://bugs.python.org/issue?@action=redirect&bpo=34776]: Fix dataclasses to support forward references in type annotations
bpo-20928 [https://bugs.python.org/issue?@action=redirect&bpo=20928]: ElementTree supports recursive XInclude processing. Patch by Stefan Behnel.
bpo-29636 [https://bugs.python.org/issue?@action=redirect&bpo=29636]: Add whitespace options for formatting JSON with the
json.tool
CLI. The following mutually exclusive options are now supported:--indent
for setting the indent level in spaces;--tab
for indenting with tabs;--no-indent
for suppressing newlines; and--compact
for suppressing all whitespace. The default behavior remains the same as--indent=4
.
文档
bpo-38928 [https://bugs.python.org/issue?@action=redirect&bpo=38928]: Correct when venv's
upgrade_dependencies()
and--upgrade-deps
are added.bpo-38899 [https://bugs.python.org/issue?@action=redirect&bpo=38899]: Update documentation to state that to activate virtual environments under fish one should use
source
, not.
as documented at https://fishshell.com/docs/current/cmds/source.html.bpo-22377 [https://bugs.python.org/issue?@action=redirect&bpo=22377]: Improves documentation of the values that
datetime.datetime.strptime()
accepts for%Z
. Patch by Karl Dubost.
测试
bpo-38546 [https://bugs.python.org/issue?@action=redirect&bpo=38546]: Fix test_ressources_gced_in_workers() of test_concurrent_futures: explicitly stop the manager to prevent leaking a child process running in the background after the test completes.
bpo-38546 [https://bugs.python.org/issue?@action=redirect&bpo=38546]: Multiprocessing and concurrent.futures tests now stop the resource tracker process when tests complete.
bpo-38614 [https://bugs.python.org/issue?@action=redirect&bpo=38614]: Replace hardcoded timeout constants in tests with new
test.support
constants:LOOPBACK_TIMEOUT
,INTERNET_TIMEOUT
,SHORT_TIMEOUT
andLONG_TIMEOUT
. It becomes easier to adjust these four timeout constants for all tests at once, rather than having to adjust every single test file.bpo-38547 [https://bugs.python.org/issue?@action=redirect&bpo=38547]: Fix test_pty: if the process is the session leader, closing the master file descriptor raises a SIGHUP signal: simply ignore SIGHUP when running the tests.
bpo-38992 [https://bugs.python.org/issue?@action=redirect&bpo=38992]: Fix a test for
math.fsum()
that was failing due to constant folding.bpo-38991 [https://bugs.python.org/issue?@action=redirect&bpo=38991]:
test.support
:run_python_until_end()
,assert_python_ok()
andassert_python_failure()
functions no longer strip whitespaces from stderr. Removetest.support.strip_python_stderr()
function.bpo-38965 [https://bugs.python.org/issue?@action=redirect&bpo=38965]: Fix test_faulthandler on GCC 10. Use the "volatile" keyword in
faulthandler._stack_overflow()
to prevent tail call optimization on any compiler, rather than relying on compiler specific pragma.bpo-38875 [https://bugs.python.org/issue?@action=redirect&bpo=38875]: test_capi: trashcan tests now require the test "cpu" resource.
bpo-38841 [https://bugs.python.org/issue?@action=redirect&bpo=38841]: Skip asyncio test_create_datagram_endpoint_existing_sock_unix on platforms lacking a functional bind() for named unix domain sockets.
bpo-38692 [https://bugs.python.org/issue?@action=redirect&bpo=38692]: Skip the test_posix.test_pidfd_open() test if
os.pidfd_open()
fails with aPermissionError
. This situation can happen in a Linux sandbox using a syscall whitelist which doesn't allow thepidfd_open()
syscall yet.bpo-38839 [https://bugs.python.org/issue?@action=redirect&bpo=38839]: Fix some unused functions in tests. Patch by Adam Johnson.
bpo-38669 [https://bugs.python.org/issue?@action=redirect&bpo=38669]: Raise
TypeError
when passing target as a string withunittest.mock.patch.object()
.bpo-37957 [https://bugs.python.org/issue?@action=redirect&bpo=37957]: test.regrtest now can receive a list of test patterns to ignore (using the -i/—ignore argument) or a file with a list of patterns to ignore (using the —ignorefile argument). Patch by Pablo Galindo.
构建
bpo-37404 [https://bugs.python.org/issue?@action=redirect&bpo=37404]:
asyncio
now raisesTypeError
when calling incompatible methods with anssl.SSLSocket
socket. Patch by Ido Michael.bpo-36500 [https://bugs.python.org/issue?@action=redirect&bpo=36500]: Added an optional "regen" project to the Visual Studio solution that will regenerate all grammar, tokens, and opcodes.
Windows
bpo-39007 [https://bugs.python.org/issue?@action=redirect&bpo=39007]: Add auditing events to functions in
winreg
.bpo-33125 [https://bugs.python.org/issue?@action=redirect&bpo=33125]: Add support for building and releasing Windows ARM64 packages.
macOS
- bpo-37931 [https://bugs.python.org/issue?@action=redirect&bpo=37931]: Fixed a crash on OSX dynamic builds that occurred when reinitializing the posix module after a Py_Finalize if the environment had changed since the previous
import posix
. Patch by Benoît Hudson.
IDLE
bpo-38944 [https://bugs.python.org/issue?@action=redirect&bpo=38944]: Escape key now closes IDLE completion windows. Patch by Johnny Najera.
bpo-38943 [https://bugs.python.org/issue?@action=redirect&bpo=38943]: Fix IDLE autocomplete windows not always appearing on some systems. Patch by Johnny Najera.
bpo-38862 [https://bugs.python.org/issue?@action=redirect&bpo=38862]: 'Strip Trailing Whitespace' on the Format menu removes extra newlines at the end of non-shell files.
bpo-38636 [https://bugs.python.org/issue?@action=redirect&bpo=38636]: Fix IDLE Format menu tab toggle and file indent width. These functions (default shortcuts Alt-T and Alt-U) were mistakenly disabled in 3.7.5 and 3.8.0.
C API
bpo-38896 [https://bugs.python.org/issue?@action=redirect&bpo=38896]: Remove
PyUnicode_ClearFreeList()
function: the Unicode free list has been removed in Python 3.3.bpo-37340 [https://bugs.python.org/issue?@action=redirect&bpo=37340]: Remove
PyMethod_ClearFreeList()
andPyCFunction_ClearFreeList()
functions: the free lists of bound method objects have been removed.bpo-38835 [https://bugs.python.org/issue?@action=redirect&bpo=38835]: Exclude
PyFPE_START_PROTECT()
andPyFPE_END_PROTECT()
macros ofpyfpe.h
fromPy_LIMITED_API
(stable API).
Python 3.9.0 alpha 1
发布日期: 2019-11-19