构建
- bpo-33163 [https://bugs.python.org/issue?@action=redirect&bpo=33163]: Upgrade pip to 9.0.3 and setuptools to v39.0.1.
Windows
bpo-33016 [https://bugs.python.org/issue?@action=redirect&bpo=33016]: Fix potential use of uninitialized memory in nt._getfinalpathname
bpo-32903 [https://bugs.python.org/issue?@action=redirect&bpo=32903]: Fix a memory leak in os.chdir() on Windows if the current directory is set to a UNC path.
macOS
- bpo-32726 [https://bugs.python.org/issue?@action=redirect&bpo=32726]: Build and link with private copy of Tcl/Tk 8.6 for the macOS 10.6+ installer. The 10.9+ installer variant already does this. This means that the Python 3.7 provided by the python.org macOS installers no longer need or use any external versions of Tcl/Tk, either system-provided or user-installed, such as ActiveTcl.
IDLE
bpo-32984 [https://bugs.python.org/issue?@action=redirect&bpo=32984]: Set
__file__
while running a startup file. Like Python, IDLE optionally runs one startup file in the Shell window before presenting the first interactive input prompt. For IDLE,-s
runs a file named in environmental variableIDLESTARTUP
orPYTHONSTARTUP
;-r file
runsfile
. Python sets__file__
to the startup file name before running the file and unsets it before the first prompt. IDLE now does the same when run normally, without the-n
option.bpo-32940 [https://bugs.python.org/issue?@action=redirect&bpo=32940]: Simplify and rename StringTranslatePseudoMapping in pyparse.
工具/示例
- bpo-32885 [https://bugs.python.org/issue?@action=redirect&bpo=32885]: Add an
-n
flag forTools/scripts/pathfix.py
to disable automatic backup creation (files with~
suffix).
C API
bpo-33042 [https://bugs.python.org/issue?@action=redirect&bpo=33042]: Embedding applications may once again call PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to calling Py_Initialize.
bpo-32374 [https://bugs.python.org/issue?@action=redirect&bpo=32374]: Document that m_traverse for multiphase initialized modules can be called with m_state=NULL, and add a sanity check
Python 3.7.0 beta 2
发布日期: 2018-02-27
安全性
- 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-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-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-32960 [https://bugs.python.org/issue?@action=redirect&bpo=32960]: For dataclasses, disallow inheriting frozen from non-frozen classes, and also disallow inheriting non-frozen from frozen classes. This restriction will be relaxed at a future date.
bpo-32713 [https://bugs.python.org/issue?@action=redirect&bpo=32713]: Fixed tarfile.itn handling of out-of-bounds float values. Patch by Joffrey Fuhrer.
bpo-32951 [https://bugs.python.org/issue?@action=redirect&bpo=32951]: Direct instantiation of SSLSocket and SSLObject objects is now prohibited. The constructors were never documented, tested, or designed as public constructors. Users were suppose to use ssl.wrap_socket() or SSLContext.
bpo-32929 [https://bugs.python.org/issue?@action=redirect&bpo=32929]: Remove the tri-state parameter "hash", and add the boolean "unsafehash". If unsafehash is True, add a hash function, but if a hash exists, raise TypeError. If unsafe_hash is False, add a __hash based on the values of eq= and frozen=. The unsafe_hash=False behavior is the same as the old hash=None behavior. unsafe_hash=False is the default, just as hash=None used to be.
bpo-32947 [https://bugs.python.org/issue?@action=redirect&bpo=32947]: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3 for future compatibility with OpenSSL 1.1.1.
bpo-30622 [https://bugs.python.org/issue?@action=redirect&bpo=30622]: The ssl module now detects missing NPN support in LibreSSL.
bpo-32922 [https://bugs.python.org/issue?@action=redirect&bpo=32922]: dbm.open() now encodes filename with the filesystem encoding rather than default encoding.
bpo-32859 [https://bugs.python.org/issue?@action=redirect&bpo=32859]: In
os.dup2
, don't check every call whether thedup3
syscall exists or not.bpo-32556 [https://bugs.python.org/issue?@action=redirect&bpo=32556]: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes.
bpo-25988 [https://bugs.python.org/issue?@action=redirect&bpo=25988]: Emit a
DeprecationWarning
when using or importing an ABC directly fromcollections
rather than fromcollections.abc
.bpo-21060 [https://bugs.python.org/issue?@action=redirect&bpo=21060]: Rewrite confusing message from setup.py upload from "No dist file created in earlier command" to the more helpful "Must create and upload files in one command".
bpo-32852 [https://bugs.python.org/issue?@action=redirect&bpo=32852]: Make sure sys.argv remains as a list when running trace.
bpo-31333 [https://bugs.python.org/issue?@action=redirect&bpo=31333]:
_abc
module is added. It is a speedup module with C implementations for various functions and methods inabc
. Creating an ABC subclass and callingisinstance
orissubclass
with an ABC subclass are up to 1.5x faster. In addition, this makes Python startup up to 10% faster. Note that the new implementation hides internal registry and caches, previously accessible via private attributesabcregistry
,abccache
, andabcnegative_cache
. There are three debugging helper methods that can be used insteaddumpregistry
,abcregistry_clear
, andabccaches_clear
.bpo-32841 [https://bugs.python.org/issue?@action=redirect&bpo=32841]: Fixed
asyncio.Condition
issue which silently ignored cancellation after notifying and cancelling a conditional lock. Patch by Bar Harel.bpo-32819 [https://bugs.python.org/issue?@action=redirect&bpo=32819]: ssl.match_hostname() has been simplified and no longer depends on re and ipaddress module for wildcard and IP addresses. Error reporting for invalid wildcards has been improved.
bpo-32394 [https://bugs.python.org/issue?@action=redirect&bpo=32394]: socket: Remove TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version Windows during runtime.
bpo-31787 [https://bugs.python.org/issue?@action=redirect&bpo=31787]: Fixed refleaks of
__init__()
methods in various modules. (Contributed by Oren Milman)bpo-30157 [https://bugs.python.org/issue?@action=redirect&bpo=30157]: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when only the last field is quoted. Patch by Jake Davis.
bpo-32792 [https://bugs.python.org/issue?@action=redirect&bpo=32792]: collections.ChainMap() preserves the order of the underlying mappings.
bpo-32775 [https://bugs.python.org/issue?@action=redirect&bpo=32775]:
fnmatch.translate()
no longer produces patterns which contain set operations. Sets starting with '[' or containing '—', '&&', '~~' or '||' will be interpreted differently in regular expressions in future versions. Currently they emit warnings. fnmatch.translate() now avoids producing patterns containing such sets by accident.bpo-32622 [https://bugs.python.org/issue?@action=redirect&bpo=32622]: Implement native fast sendfile for Windows proactor event loop.
bpo-32777 [https://bugs.python.org/issue?@action=redirect&bpo=32777]: Fix a rare but potential preexec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4.
bpo-32647 [https://bugs.python.org/issue?@action=redirect&bpo=32647]: The ctypes module used to depend on indirect linking for dlopen. The shared extension is now explicitly linked against libdl on platforms with dl.
bpo-32741 [https://bugs.python.org/issue?@action=redirect&bpo=32741]: Implement
asyncio.TimerHandle.when()
method.bpo-32691 [https://bugs.python.org/issue?@action=redirect&bpo=32691]: Use mod_spec.parent when running modules with pdb
bpo-32734 [https://bugs.python.org/issue?@action=redirect&bpo=32734]: Fixed
asyncio.Lock()
safety issue which allowed acquiring and locking the same lock multiple times, without it being free. Patch by Bar Harel.bpo-32727 [https://bugs.python.org/issue?@action=redirect&bpo=32727]: Do not include name field in SMTP envelope from address. Patch by Stéphane Wirtel
bpo-31453 [https://bugs.python.org/issue?@action=redirect&bpo=31453]: Add TLSVersion constants and SSLContext.maximum_version / minimum_version attributes. The new API wraps OpenSSL 1.1 https://web.archive.org/web/20180309043602/https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTXsetminprotoversion.html feature.
bpo-24334 [https://bugs.python.org/issue?@action=redirect&bpo=24334]: Internal implementation details of ssl module were cleaned up. The SSLSocket has one less layer of indirection. Owner and session information are now handled by the SSLSocket and SSLObject constructor. Channel binding implementation has been simplified.
bpo-31848 [https://bugs.python.org/issue?@action=redirect&bpo=31848]: Fix the error handling in Aifc_read.initfp() when the SSND chunk is not found. Patch by Zackery Spytz.
bpo-32585 [https://bugs.python.org/issue?@action=redirect&bpo=32585]: Add Ttk spinbox widget to
tkinter.ttk
. Patch by Alan D Moore.bpo-32221 [https://bugs.python.org/issue?@action=redirect&bpo=32221]: Various functions returning tuple containing IPv6 addresses now omit
%scope
part since the same information is already encoded in scopeid tuple item. Especially this speeds upsocket.recvfrom()
when it receives multicast packet since useless resolving of network interface name is omitted.bpo-30693 [https://bugs.python.org/issue?@action=redirect&bpo=30693]: The TarFile class now recurses directories in a reproducible way.
bpo-30693 [https://bugs.python.org/issue?@action=redirect&bpo=30693]: The ZipFile class now recurses directories in a reproducible way.
文档
bpo-28124 [https://bugs.python.org/issue?@action=redirect&bpo=28124]: The ssl module function ssl.wrap_socket() has been de-emphasized and deprecated in favor of the more secure and efficient SSLContext.wrap_socket() method.
bpo-17232 [https://bugs.python.org/issue?@action=redirect&bpo=17232]: Clarify docs for -O and -OO. Patch by Terry Reedy.
bpo-32436 [https://bugs.python.org/issue?@action=redirect&bpo=32436]: Add documentation for the contextvars module (PEP 567).
bpo-32800 [https://bugs.python.org/issue?@action=redirect&bpo=32800]: Update link to w3c doc for xml default namespaces.
bpo-11015 [https://bugs.python.org/issue?@action=redirect&bpo=11015]: Update
test.support
documentation.bpo-8722 [https://bugs.python.org/issue?@action=redirect&bpo=8722]: Document
__getattr__()
behavior when propertyget()
method raisesAttributeError
.bpo-32614 [https://bugs.python.org/issue?@action=redirect&bpo=32614]: Modify RE examples in documentation to use raw strings to prevent
DeprecationWarning
and add text to REGEX HOWTO to highlight the deprecation.bpo-31972 [https://bugs.python.org/issue?@action=redirect&bpo=31972]: Improve docstrings for
pathlib.PurePath
subclasses.
测试
- bpo-31809 [https://bugs.python.org/issue?@action=redirect&bpo=31809]: Add tests to verify connection with secp ECDH curves.
构建
- bpo-32898 [https://bugs.python.org/issue?@action=redirect&bpo=32898]: Fix the python debug build when using COUNT_ALLOCS.
Windows
bpo-32901 [https://bugs.python.org/issue?@action=redirect&bpo=32901]: Update Tcl and Tk versions to 8.6.8
bpo-31966 [https://bugs.python.org/issue?@action=redirect&bpo=31966]: Fixed WindowsConsoleIO.write() for writing empty data.
bpo-32409 [https://bugs.python.org/issue?@action=redirect&bpo=32409]: Ensures activate.bat can handle Unicode contents.
bpo-32457 [https://bugs.python.org/issue?@action=redirect&bpo=32457]: Improves handling of denormalized executable path when launching Python.
bpo-32370 [https://bugs.python.org/issue?@action=redirect&bpo=32370]: Use the correct encoding for ipconfig output in the uuid module. Patch by Segev Finer.
bpo-29248 [https://bugs.python.org/issue?@action=redirect&bpo=29248]: Fix
os.readlink()
on Windows, which was mistakenly treating thePrintNameOffset
field of the reparse data buffer as a number of characters instead of bytes. Patch by Craig Holmquist and SSE4.
macOS
- bpo-32901 [https://bugs.python.org/issue?@action=redirect&bpo=32901]: Update macOS 10.9+ installer to Tcl/Tk 8.6.8.
IDLE
bpo-32916 [https://bugs.python.org/issue?@action=redirect&bpo=32916]: Change
str
tocode
in pyparse.bpo-32905 [https://bugs.python.org/issue?@action=redirect&bpo=32905]: Remove unused code in pyparse module.
bpo-32874 [https://bugs.python.org/issue?@action=redirect&bpo=32874]: Add tests for pyparse.
bpo-32837 [https://bugs.python.org/issue?@action=redirect&bpo=32837]: Using the system and place-dependent default encoding for open() is a bad idea for IDLE's system and location-independent files.
bpo-32826 [https://bugs.python.org/issue?@action=redirect&bpo=32826]: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI test test_file_buttons() only looks at initial ascii-only lines, but failed on systems where open() defaults to 'ascii' because readline() internally reads and decodes far enough ahead to encounter a nonascii character in CREDITS.txt.
bpo-32765 [https://bugs.python.org/issue?@action=redirect&bpo=32765]: Update configdialog General tab docstring to add new widgets to the widget list.
工具/示例
- bpo-32222 [https://bugs.python.org/issue?@action=redirect&bpo=32222]: Fix pygettext not extracting docstrings for functions with type annotated arguments. Patch by Toby Harradine.
Python 3.7.0 beta 1
发布日期: 2018-01-30
核心与内置函数
bpo-32703 [https://bugs.python.org/issue?@action=redirect&bpo=32703]: Fix coroutine's ResourceWarning when there's an active error set when it's being finalized.
bpo-32650 [https://bugs.python.org/issue?@action=redirect&bpo=32650]: Pdb and other debuggers dependent on bdb.py will correctly step over (next command) native coroutines. Patch by Pablo Galindo.
bpo-28685 [https://bugs.python.org/issue?@action=redirect&bpo=28685]: Optimize list.sort() and sorted() by using type specialized comparisons when possible.
bpo-32685 [https://bugs.python.org/issue?@action=redirect&bpo=32685]: Improve suggestion when the Python 2 form of print statement is either present on the same line as the header of a compound statement or else terminated by a semicolon instead of a newline. Patch by Nitish Chandra.
bpo-32697 [https://bugs.python.org/issue?@action=redirect&bpo=32697]: Python now explicitly preserves the definition order of keyword-only parameters. It's always preserved their order, but this behavior was never guaranteed before; this behavior is now guaranteed and tested.
bpo-32690 [https://bugs.python.org/issue?@action=redirect&bpo=32690]: The locals() dictionary now displays in the lexical order that variables were defined. Previously, the order was reversed.
bpo-32677 [https://bugs.python.org/issue?@action=redirect&bpo=32677]: Add
.isascii()
method tostr
,bytes
andbytearray
. It can be used to test that string contains only ASCII characters.bpo-32670 [https://bugs.python.org/issue?@action=redirect&bpo=32670]: Enforce PEP 479 [https://peps.python.org/pep-0479/] for all code. This means that manually raising a StopIteration exception from a generator is prohibited for all code, regardless of whether 'from future import generator_stop' was used or not.
bpo-32591 [https://bugs.python.org/issue?@action=redirect&bpo=32591]: Added builtin support for tracking the origin of coroutine objects; see sys.set_coroutine_origin_tracking_depth and CoroutineType.cr_origin. This replaces the asyncio debug mode's use of coroutine wrapping for native coroutine objects.
bpo-31368 [https://bugs.python.org/issue?@action=redirect&bpo=31368]: Expose preadv and pwritev system calls in the os module. Patch by Pablo Galindo
bpo-32544 [https://bugs.python.org/issue?@action=redirect&bpo=32544]:
hasattr(obj, name)
andgetattr(obj, name, default)
are about 4 times faster than before whenname
is not found andobj
doesn't override__getattr__
or__getattribute__
.bpo-26163 [https://bugs.python.org/issue?@action=redirect&bpo=26163]: Improved frozenset() hash to create more distinct hash values when faced with datasets containing many similar values.
bpo-32550 [https://bugs.python.org/issue?@action=redirect&bpo=32550]: Remove the STORE_ANNOTATION bytecode.
bpo-20104 [https://bugs.python.org/issue?@action=redirect&bpo=20104]: Expose posix_spawn as a low level API in the os module. (removed before 3.7.0rc1)
bpo-24340 [https://bugs.python.org/issue?@action=redirect&bpo=24340]: Fixed estimation of the code stack size.
bpo-32436 [https://bugs.python.org/issue?@action=redirect&bpo=32436]: Implement PEP 567 [https://peps.python.org/pep-0567/] Context Variables.
bpo-18533 [https://bugs.python.org/issue?@action=redirect&bpo=18533]:
repr()
on a dict containing its ownvalues()
oritems()
no longer raisesRecursionError
; OrderedDict similarly. Instead, use…
, as for other recursive structures. Patch by Ben North.bpo-20891 [https://bugs.python.org/issue?@action=redirect&bpo=20891]: Py_Initialize() now creates the GIL. The GIL is no longer created "on demand" to fix a race condition when PyGILState_Ensure() is called in a non-Python thread.
bpo-32028 [https://bugs.python.org/issue?@action=redirect&bpo=32028]: Leading whitespace is now correctly ignored when generating suggestions for converting Py2 print statements to Py3 builtin print function calls. Patch by Sanyam Khurana.
bpo-31179 [https://bugs.python.org/issue?@action=redirect&bpo=31179]: Make dict.copy() up to 5.5 times faster.
bpo-31113 [https://bugs.python.org/issue?@action=redirect&bpo=31113]: Get rid of recursion in the compiler for normal control flow.
库
bpo-25988 [https://bugs.python.org/issue?@action=redirect&bpo=25988]: Deprecate exposing the contents of collections.abc in the regular collections module.
bpo-31429 [https://bugs.python.org/issue?@action=redirect&bpo=31429]: The default cipher suite selection of the ssl module now uses a blacklist approach rather than a hardcoded whitelist. Python no longer re-enables ciphers that have been blocked by OpenSSL security update. Default cipher suite selection can be configured on compile time.
bpo-30306 [https://bugs.python.org/issue?@action=redirect&bpo=30306]: contextlib.contextmanager now releases the arguments passed to the underlying generator as soon as the context manager is entered. Previously it would keep them alive for as long as the context manager was alive, even when not being used as a function decorator. Patch by Martin Teichmann.
bpo-21417 [https://bugs.python.org/issue?@action=redirect&bpo=21417]: Added support for setting the compression level for zipfile.ZipFile.
bpo-32251 [https://bugs.python.org/issue?@action=redirect&bpo=32251]: Implement asyncio.BufferedProtocol (provisional API).
bpo-32513 [https://bugs.python.org/issue?@action=redirect&bpo=32513]: In dataclasses, allow easier overriding of dunder methods without specifying decorator parameters.
bpo-32660 [https://bugs.python.org/issue?@action=redirect&bpo=32660]:
termios
makes availableFIONREAD
,FIONCLEX
,FIOCLEX
,FIOASYNC
andFIONBIO
also under Solaris/derivatives.bpo-27931 [https://bugs.python.org/issue?@action=redirect&bpo=27931]: Fix email address header parsing error when the username is an empty quoted string. Patch by Xiang Zhang.
bpo-32659 [https://bugs.python.org/issue?@action=redirect&bpo=32659]: Under Solaris and derivatives,
os.stat_result
provides a st_fstype attribute.bpo-32662 [https://bugs.python.org/issue?@action=redirect&bpo=32662]: Implement Server.start_serving(), Server.serve_forever(), and Server.is_serving() methods. Add 'start_serving' keyword parameter to loop.create_server() and loop.create_unix_server().
bpo-32391 [https://bugs.python.org/issue?@action=redirect&bpo=32391]: Implement
asyncio.StreamWriter.wait_closed()
andasyncio.StreamWriter.is_closing()
methodsbpo-32643 [https://bugs.python.org/issue?@action=redirect&bpo=32643]: Make Task._step, Task._wakeup and Future._schedule_callbacks methods private.
bpo-32630 [https://bugs.python.org/issue?@action=redirect&bpo=32630]: Refactor decimal module to use contextvars to store decimal context.
bpo-32622 [https://bugs.python.org/issue?@action=redirect&bpo=32622]: Add
asyncio.AbstractEventLoop.sendfile()
method.bpo-32304 [https://bugs.python.org/issue?@action=redirect&bpo=32304]: distutils' upload command no longer corrupts tar files ending with a CR byte, and no longer tries to convert CR to CRLF in any of the upload text fields.
bpo-32502 [https://bugs.python.org/issue?@action=redirect&bpo=32502]: uuid.uuid1 no longer raises an exception if a 64-bit hardware address is encountered.
bpo-32596 [https://bugs.python.org/issue?@action=redirect&bpo=32596]:
concurrent.futures
importsThreadPoolExecutor
andProcessPoolExecutor
lazily (using PEP 562 [https://peps.python.org/pep-0562/]). It makesimport asyncio
about 15% faster because asyncio uses onlyThreadPoolExecutor
by default.bpo-31801 [https://bugs.python.org/issue?@action=redirect&bpo=31801]: Add
ignore
toEnum
so temporary variables can be used during class construction without being turned into members.bpo-32576 [https://bugs.python.org/issue?@action=redirect&bpo=32576]: Use queue.SimpleQueue() in places where it can be invoked from a weakref callback.
bpo-32574 [https://bugs.python.org/issue?@action=redirect&bpo=32574]: Fix memory leak in asyncio.Queue, when the queue has limited size and it is full, the cancelation of queue.put() can cause a memory leak. Patch by: José Melero.
bpo-32521 [https://bugs.python.org/issue?@action=redirect&bpo=32521]: The nis module is now compatible with new libnsl and headers location.
bpo-32467 [https://bugs.python.org/issue?@action=redirect&bpo=32467]: collections.abc.ValuesView now inherits from collections.abc.Collection.
bpo-32473 [https://bugs.python.org/issue?@action=redirect&bpo=32473]: Improve ABCMeta.dumpregistry() output readability
bpo-32102 [https://bugs.python.org/issue?@action=redirect&bpo=32102]: New argument
capture_output
for subprocess.runbpo-32521 [https://bugs.python.org/issue?@action=redirect&bpo=32521]: glibc has removed Sun RPC. Use replacement libtirpc headers and library in nis module.
bpo-32493 [https://bugs.python.org/issue?@action=redirect&bpo=32493]: UUID module fixes build for FreeBSD/OpenBSD
bpo-32503 [https://bugs.python.org/issue?@action=redirect&bpo=32503]: Pickling with protocol 4 no longer creates too small frames.
bpo-29237 [https://bugs.python.org/issue?@action=redirect&bpo=29237]: Create enum for pstats sorting options
bpo-32454 [https://bugs.python.org/issue?@action=redirect&bpo=32454]: Add close(fd) function to the socket module.
bpo-25942 [https://bugs.python.org/issue?@action=redirect&bpo=25942]: The subprocess module is now more graceful when handling a Ctrl-C KeyboardInterrupt during subprocess.call, subprocess.run, or a Popen context manager. It now waits a short amount of time for the child (presumed to have also gotten the SIGINT) to exit, before continuing the KeyboardInterrupt exception handling. This still includes a SIGKILL in the call() and run() APIs, but at least the child had a chance first.
bpo-32433 [https://bugs.python.org/issue?@action=redirect&bpo=32433]: The hmac module now has hmac.digest(), which provides an optimized HMAC digest.
bpo-28134 [https://bugs.python.org/issue?@action=redirect&bpo=28134]: Sockets now auto-detect family, type and protocol from file descriptor by default.
bpo-32404 [https://bugs.python.org/issue?@action=redirect&bpo=32404]: Fix bug where
datetime.datetime.fromtimestamp()
did not call new indatetime.datetime
subclasses.bpo-32403 [https://bugs.python.org/issue?@action=redirect&bpo=32403]: Improved speed of
datetime.date
anddatetime.datetime
alternate constructors.bpo-32228 [https://bugs.python.org/issue?@action=redirect&bpo=32228]: Ensure that
truncate()
preserves the file position (as reported bytell()
) after writes longer than the buffer size.bpo-32410 [https://bugs.python.org/issue?@action=redirect&bpo=32410]: Implement
loop.sock_sendfile
for asyncio event loop.bpo-22908 [https://bugs.python.org/issue?@action=redirect&bpo=22908]: Added seek and tell to the ZipExtFile class. This only works if the file object used to open the zipfile is seekable.
bpo-32373 [https://bugs.python.org/issue?@action=redirect&bpo=32373]: Add socket.getblocking() method.
bpo-32248 [https://bugs.python.org/issue?@action=redirect&bpo=32248]: Add
importlib.resources
andimportlib.abc.ResourceReader
as the unified API for reading resources contained within packages. Loaders wishing to support resource reading must implement theget_resource_reader()
method. File-based and zipimport-based loaders both implement these APIs.importlib.abc.ResourceLoader
is deprecated in favor of these new APIs.bpo-32320 [https://bugs.python.org/issue?@action=redirect&bpo=32320]: collections.namedtuple() now supports default values.
bpo-29302 [https://bugs.python.org/issue?@action=redirect&bpo=29302]: Add contextlib.AsyncExitStack. Patch by Alexander Mohr and Ilya Kulakov.
bpo-31961 [https://bugs.python.org/issue?@action=redirect&bpo=31961]: Removed in Python 3.7.0b2. The args argument of subprocess.Popen can now be a pathlike object. If args is given as a sequence, it's first element can now be a pathlike object as well.
bpo-31900 [https://bugs.python.org/issue?@action=redirect&bpo=31900]: The
locale.localeconv()
function now sets temporarily theLC_CTYPE
locale to theLC_NUMERIC
locale to decodedecimal_point
andthousands_sep
byte strings if they are nonASCII or longer than 1 byte, and theLC_NUMERIC
locale is different than theLC_CTYPE
locale. This temporary change affects other threads. Same change for thestr.format()
method when formatting a number (int
,float
,float
and subclasses) with then
type (ex:'{:n}'.format(1234)
).bpo-31853 [https://bugs.python.org/issue?@action=redirect&bpo=31853]: Use super().method instead of socket.method in SSLSocket. They were there most likely for legacy reasons.
bpo-31399 [https://bugs.python.org/issue?@action=redirect&bpo=31399]: The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. Subject common name fallback can be disabled with SSLContext.hostname_checks_common_name.
bpo-14976 [https://bugs.python.org/issue?@action=redirect&bpo=14976]: Add a queue.SimpleQueue class, an unbounded FIFO queue with a reentrant C implementation of put().
文档
bpo-32724 [https://bugs.python.org/issue?@action=redirect&bpo=32724]: Add references to some commands in the documentation of Pdb. Patch by Stéphane Wirtel
bpo-32649 [https://bugs.python.org/issue?@action=redirect&bpo=32649]: Complete the C API documentation, profiling and tracing part with the newly added per-opcode events.
bpo-17799 [https://bugs.python.org/issue?@action=redirect&bpo=17799]: Explain real behaviour of sys.settrace and sys.setprofile and their C-API counterparts regarding which type of events are received in each function. Patch by Pablo Galindo Salgado.
测试
bpo-32721 [https://bugs.python.org/issue?@action=redirect&bpo=32721]: Fix test_hashlib to not fail if the _md5 module is not built.
bpo-28414 [https://bugs.python.org/issue?@action=redirect&bpo=28414]: Add test cases for IDNA 2003 and 2008 host names. IDNA 2003 internationalized host names are working since bpo-31399 [https://bugs.python.org/issue?@action=redirect&bpo=31399] has landed. IDNA 2008 are still broken.
bpo-32604 [https://bugs.python.org/issue?@action=redirect&bpo=32604]: Add a new "_xxsubinterpreters" extension module that exposes the existing subinterpreter C-API and a new cross-interpreter data sharing mechanism. The module is primarily intended for more thorough testing of the existing subinterpreter support. Note that the _xxsubinterpreters module has been removed in 3.7.0rc1.
bpo-32602 [https://bugs.python.org/issue?@action=redirect&bpo=32602]: Add test certs and test for ECDSA cert and EC/RSA dual mode.
bpo-32549 [https://bugs.python.org/issue?@action=redirect&bpo=32549]: On Travis CI, Python now Compiles and uses a local copy of OpenSSL 1.1.0g for testing.
构建
bpo-32635 [https://bugs.python.org/issue?@action=redirect&bpo=32635]: Fix segfault of the crypt module when libxcrypt is provided instead of libcrypt at the system.
bpo-32598 [https://bugs.python.org/issue?@action=redirect&bpo=32598]: Use autoconf to detect OpenSSL libs, headers and supported features. The ax_check_openssl M4 macro uses pkg-config to locate OpenSSL and falls back to manual search.
bpo-32593 [https://bugs.python.org/issue?@action=redirect&bpo=32593]: Drop support of FreeBSD 9 and older.
bpo-29708 [https://bugs.python.org/issue?@action=redirect&bpo=29708]: If the
SOURCE_DATE_EPOCH
environment variable is set,py_compile
will always create hash-based.pyc
files.
Windows
bpo-32588 [https://bugs.python.org/issue?@action=redirect&bpo=32588]: Create standalone distutilsfindvs module and add missing _queue module to installer.
bpo-29911 [https://bugs.python.org/issue?@action=redirect&bpo=29911]: Ensure separate Modify and Uninstall buttons are displayed.
bpo-32507 [https://bugs.python.org/issue?@action=redirect&bpo=32507]: Use app-local UCRT install rather than the proper update for old versions of Windows.
macOS
bpo-32726 [https://bugs.python.org/issue?@action=redirect&bpo=32726]: Provide an additional, more modern macOS installer variant that supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied third-party libraries to OpenSSL 1.1.0g and to SQLite 3.22.0. The 10.9+ installer now links with and supplies its own copy of Tcl/Tk 8.6.
bpo-28440 [https://bugs.python.org/issue?@action=redirect&bpo=28440]: No longer add LibraryPython/3.x/site-packages to sys.path for macOS framework builds to avoid future conflicts.
C API
bpo-32681 [https://bugs.python.org/issue?@action=redirect&bpo=32681]: Fix uninitialized variable 'res' in the C implementation of os.dup2. Patch by Stéphane Wirtel
bpo-10381 [https://bugs.python.org/issue?@action=redirect&bpo=10381]: Add C API access to the
datetime.timezone
constructor anddatetime.timzone.UTC
singleton.
Python 3.7.0 alpha 4
发布日期: 2018-01-08
核心与内置函数
bpo-31975 [https://bugs.python.org/issue?@action=redirect&bpo=31975]: The default warning filter list now starts with a "default::DeprecationWarning:main" entry, so deprecation warnings are once again shown by default in single-file scripts and at the interactive prompt.
bpo-32226 [https://bugs.python.org/issue?@action=redirect&bpo=32226]:
__class_getitem__
is now an automatic class method.bpo-32399 [https://bugs.python.org/issue?@action=redirect&bpo=32399]: Add AIX uuid library support for RFC4122 using uuid_create() in libc.a
bpo-32390 [https://bugs.python.org/issue?@action=redirect&bpo=32390]: Fix the compilation failure on AIX after the f_fsid field has been added to the object returned by os.statvfs() (bpo-32143 [https://bugs.python.org/issue?@action=redirect&bpo=32143]). Original patch by Michael Felt.
bpo-32379 [https://bugs.python.org/issue?@action=redirect&bpo=32379]: Make MRO computation faster when a class inherits from a single base.
bpo-32259 [https://bugs.python.org/issue?@action=redirect&bpo=32259]: The error message of a TypeError raised when unpack non-iterable is now more specific.
bpo-27169 [https://bugs.python.org/issue?@action=redirect&bpo=27169]: The
__debug__
constant is now optimized out at compile time. This fixes also bpo-22091 [https://bugs.python.org/issue?@action=redirect&bpo=22091].bpo-32329 [https://bugs.python.org/issue?@action=redirect&bpo=32329]: The
-R
option now turns on hash randomization when thePYTHONHASHSEED
environment variable is set to0
. Previously, the option was ignored. Moreover,sys.flags.hash_randomization
is now properly set to 0 when hash randomization is turned off byPYTHONHASHSEED=0
.bpo-30416 [https://bugs.python.org/issue?@action=redirect&bpo=30416]: The optimizer is now protected from spending much time doing complex calculations and consuming much memory for creating large constants in constant folding. Increased limits for constants that can be produced in constant folding.
bpo-32282 [https://bugs.python.org/issue?@action=redirect&bpo=32282]: Fix an unnecessary ifdef in the include of VersionHelpers.h in socketmodule on Windows.
bpo-30579 [https://bugs.python.org/issue?@action=redirect&bpo=30579]: Implement TracebackType.new to allow Python-level creation of traceback objects, and make TracebackType.tb_next mutable.
bpo-32260 [https://bugs.python.org/issue?@action=redirect&bpo=32260]: Don't byte swap the input keys to the SipHash algorithm on big-endian platforms. This should ensure siphash gives consistent results across platforms.
bpo-31506 [https://bugs.python.org/issue?@action=redirect&bpo=31506]: Improve the error message logic for object.new and object.init. Patch by Sanyam Khurana.
bpo-20361 [https://bugs.python.org/issue?@action=redirect&bpo=20361]:
-b
and-bb
now inject'default::BytesWarning'
anderror::BytesWarning
entries intosys.warnoptions
, ensuring that they take precedence over any other warning filters configured via the-W
option or thePYTHONWARNINGS
environment variable.bpo-32230 [https://bugs.python.org/issue?@action=redirect&bpo=32230]:
-X dev
now injects a'default'
entry into sys.warnoptions, ensuring that it behaves identically to actually passing-Wdefault
at the command line.bpo-29240 [https://bugs.python.org/issue?@action=redirect&bpo=29240]: Add a new UTF-8 mode: implementation of the PEP 540 [https://peps.python.org/pep-0540/].
bpo-32226 [https://bugs.python.org/issue?@action=redirect&bpo=32226]: PEP 560 [https://peps.python.org/pep-0560/]: Add support for
__mro_entries__
and__class_getitem__
. Implemented by Ivan Levkivskyi.bpo-32225 [https://bugs.python.org/issue?@action=redirect&bpo=32225]: PEP 562 [https://peps.python.org/pep-0562/]: Add support for module
__getattr__
and__dir__
. Implemented by Ivan Levkivskyi.bpo-31901 [https://bugs.python.org/issue?@action=redirect&bpo=31901]: The
atexit
module now has its callback stored per interpreter.bpo-31650 [https://bugs.python.org/issue?@action=redirect&bpo=31650]: Implement PEP 552 [https://peps.python.org/pep-0552/] (Deterministic pycs). Python now supports invalidating bytecode cache files bashed on a source content hash rather than source last-modified time.
bpo-29469 [https://bugs.python.org/issue?@action=redirect&bpo=29469]: Move constant folding from bytecode layer to AST layer. Original patch by Eugene Toder.
库
bpo-32506 [https://bugs.python.org/issue?@action=redirect&bpo=32506]: Now that dict is defined as keeping insertion order, drop OrderedDict and just use plain dict.
bpo-32279 [https://bugs.python.org/issue?@action=redirect&bpo=32279]: Add params to dataclasses.make_dataclasses(): init, repr, eq, order, hash, and frozen. Pass them through to dataclass().
bpo-32278 [https://bugs.python.org/issue?@action=redirect&bpo=32278]: Make type information optional on dataclasses.make_dataclass(). If omitted, the string 'typing.Any' is used.
bpo-32499 [https://bugs.python.org/issue?@action=redirect&bpo=32499]: Add dataclasses.is_dataclass(obj), which returns True if obj is a dataclass or an instance of one.
bpo-32468 [https://bugs.python.org/issue?@action=redirect&bpo=32468]: Improve frame repr() to mention filename, code name and current line number.
bpo-23749 [https://bugs.python.org/issue?@action=redirect&bpo=23749]: asyncio: Implement loop.start_tls()
bpo-32441 [https://bugs.python.org/issue?@action=redirect&bpo=32441]: Return the new file descriptor (i.e., the second argument) from
os.dup2
. Previously,None
was always returned.bpo-32422 [https://bugs.python.org/issue?@action=redirect&bpo=32422]:
functools.lru_cache
uses less memory (3 words for each cached key) and takes about 1/3 time for cyclic GC.bpo-31721 [https://bugs.python.org/issue?@action=redirect&bpo=31721]: Prevent Python crash from happening when Future._log_traceback is set to True manually. Now it can only be set to False, or a ValueError is raised.
bpo-32415 [https://bugs.python.org/issue?@action=redirect&bpo=32415]: asyncio: Add Task.get_loop() and Future.get_loop()
bpo-26133 [https://bugs.python.org/issue?@action=redirect&bpo=26133]: Don't unsubscribe signals in asyncio UNIX event loop on interpreter shutdown.
bpo-32363 [https://bugs.python.org/issue?@action=redirect&bpo=32363]: Make asyncio.Task.setexception() and setresult() raise NotImplementedError. Task._step() and Future.__await() raise proper exceptions when they are in an invalid state, instead of raising an AssertionError.
bpo-32357 [https://bugs.python.org/issue?@action=redirect&bpo=32357]: Optimize asyncio.iscoroutine() and loop.create_task() for non-native coroutines (e.g. async/await compiled with Cython). 'loop.create_task(python_coroutine)' used to be 20% faster than 'loop.create_task(cython_coroutine)'. Now, the latter is as fast.
bpo-32356 [https://bugs.python.org/issue?@action=redirect&bpo=32356]: asyncio.transport.resume_reading() and pause_reading() are now idempotent. New transport.is_reading() method is added.
bpo-32355 [https://bugs.python.org/issue?@action=redirect&bpo=32355]: Optimize asyncio.gather(); now up to 15% faster.
bpo-32351 [https://bugs.python.org/issue?@action=redirect&bpo=32351]: Use fastpath in asyncio.sleep if delay<0 (2x boost)
bpo-32348 [https://bugs.python.org/issue?@action=redirect&bpo=32348]: Optimize asyncio.Future schedule/add/remove callback. The optimization shows 3-6% performance improvements of async/await code.
bpo-32331 [https://bugs.python.org/issue?@action=redirect&bpo=32331]: Fix socket.settimeout() and socket.setblocking() to keep socket.type as is. Fix socket.socket() constructor to reset any bit flags applied to socket's type. This change only affects OSes that have SOCK_NONBLOCK and/or SOCK_CLOEXEC.
bpo-32248 [https://bugs.python.org/issue?@action=redirect&bpo=32248]: Add
importlib.abc.ResourceReader
as an ABC for loaders to provide a unified API for reading resources contained within packages. Also addimportlib.resources
as the port ofimportlib_resources
.bpo-32311 [https://bugs.python.org/issue?@action=redirect&bpo=32311]: Implement asyncio.create_task(coro) shortcut
bpo-32327 [https://bugs.python.org/issue?@action=redirect&bpo=32327]: Convert asyncio functions that were documented as coroutines to coroutines. Affected functions: loop.sock_sendall, loop.sock_recv, loop.sock_accept, loop.getaddrinfo, loop.getnameinfo.
bpo-32323 [https://bugs.python.org/issue?@action=redirect&bpo=32323]:
urllib.parse.urlsplit()
does not convert zone-id (scope) to lower case for scoped IPv6 addresses in hostnames now.bpo-32302 [https://bugs.python.org/issue?@action=redirect&bpo=32302]: Fix bdist_wininst of distutils for CRT v142: it binary compatible with CRT v140.
bpo-29711 [https://bugs.python.org/issue?@action=redirect&bpo=29711]: Fix
stop_serving
in asyncio proactor loop kill all listening serversbpo-32308 [https://bugs.python.org/issue?@action=redirect&bpo=32308]:
re.sub()
now replaces empty matches adjacent to a previous non-empty match.bpo-29970 [https://bugs.python.org/issue?@action=redirect&bpo=29970]: Abort asyncio SSLProtocol connection if handshake not complete within 10 seconds.
bpo-32314 [https://bugs.python.org/issue?@action=redirect&bpo=32314]: Implement asyncio.run().
bpo-17852 [https://bugs.python.org/issue?@action=redirect&bpo=17852]: Revert incorrect fix based on misunderstanding of PyPyAtExit() semantics.
bpo-32296 [https://bugs.python.org/issue?@action=redirect&bpo=32296]: Implement asyncio.getrunning_loop() and get_event_loop() in C. This makes them 4x faster.
bpo-32250 [https://bugs.python.org/issue?@action=redirect&bpo=32250]: Implement
asyncio.current_task()
andasyncio.all_tasks()
. Add helpers intended to be used by alternative task implementations:asyncio._register_task
,asyncio._enter_task
,asyncio._leave_task
andasyncio._unregister_task
. Deprecateasyncio.Task.current_task()
andasyncio.Task.all_tasks()
.bpo-32255 [https://bugs.python.org/issue?@action=redirect&bpo=32255]: A single empty field is now always quoted when written into a CSV file. This allows to distinguish an empty row from a row consisting of a single empty field. Patch by Licht Takeuchi.
bpo-32277 [https://bugs.python.org/issue?@action=redirect&bpo=32277]: Raise
NotImplementedError
instead ofSystemError
on platforms wherechmod(…, follow_symlinks=False)
is not supported. Patch by Anthony Sottile.bpo-30050 [https://bugs.python.org/issue?@action=redirect&bpo=30050]: New argument warn_on_full_buffer to signal.set_wakeup_fd lets you control whether Python prints a warning on stderr when the wakeup fd buffer overflows.
bpo-29137 [https://bugs.python.org/issue?@action=redirect&bpo=29137]: The
fpectl
library has been removed. It was never enabled by default, never worked correctly on x86-64, and it changed the Python ABI in ways that caused unexpected breakage of C extensions.bpo-32273 [https://bugs.python.org/issue?@action=redirect&bpo=32273]: Move asyncio.test_utils to test.test_asyncio.
bpo-32272 [https://bugs.python.org/issue?@action=redirect&bpo=32272]: Remove asyncio.async() function.
bpo-32269 [https://bugs.python.org/issue?@action=redirect&bpo=32269]: Add asyncio.get_running_loop() function.
bpo-32265 [https://bugs.python.org/issue?@action=redirect&bpo=32265]: All class and static methods of builtin types now are correctly classified by inspect.classify_class_attrs() and grouped in pydoc ouput. Added types.ClassMethodDescriptorType for unbound class methods of builtin types.
bpo-32253 [https://bugs.python.org/issue?@action=redirect&bpo=32253]: Deprecate
yield from lock
,await lock
,with (yield from lock)
andwith await lock
for asyncio synchronization primitives.bpo-22589 [https://bugs.python.org/issue?@action=redirect&bpo=22589]: Changed MIME type of .bmp from 'image/x-ms-bmp' to 'image/bmp'
bpo-32193 [https://bugs.python.org/issue?@action=redirect&bpo=32193]: Convert asyncio to use async/await syntax. Old styled
yield from
is still supported too.bpo-32206 [https://bugs.python.org/issue?@action=redirect&bpo=32206]: Add support to run modules with pdb
bpo-32227 [https://bugs.python.org/issue?@action=redirect&bpo=32227]:
functools.singledispatch
now supports registering implementations using type annotations.bpo-15873 [https://bugs.python.org/issue?@action=redirect&bpo=15873]: Added new alternate constructors
datetime.datetime.fromisoformat()
,datetime.time.fromisoformat()
anddatetime.date.fromisoformat()
as the inverse operation of each classes's respectiveisoformat
methods.bpo-32199 [https://bugs.python.org/issue?@action=redirect&bpo=32199]: The getnode() ip getter now uses 'ip link' instead of 'ip link list'.
bpo-32143 [https://bugs.python.org/issue?@action=redirect&bpo=32143]: os.statvfs() includes the f_fsid field from statvfs(2)
bpo-26439 [https://bugs.python.org/issue?@action=redirect&bpo=26439]: Fix ctypes.util.find_library() for AIX by implementing ctypes._aix.find_library() Patch by: Michael Felt
bpo-31993 [https://bugs.python.org/issue?@action=redirect&bpo=31993]: The pickler now uses less memory when serializing large bytes and str objects into a file. Pickles created with protocol 4 will require less memory for unpickling large bytes and str objects.
bpo-27456 [https://bugs.python.org/issue?@action=redirect&bpo=27456]: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner.
bpo-31778 [https://bugs.python.org/issue?@action=redirect&bpo=31778]: ast.literal_eval() is now more strict. Addition and subtraction of arbitrary numbers no longer allowed.
bpo-31802 [https://bugs.python.org/issue?@action=redirect&bpo=31802]: Importing native path module (
posixpath
,ntpath
) now works even if theos
module still is not imported.bpo-30241 [https://bugs.python.org/issue?@action=redirect&bpo=30241]: Add contextlib.AbstractAsyncContextManager. Patch by Jelle Zijlstra.
bpo-31699 [https://bugs.python.org/issue?@action=redirect&bpo=31699]: Fix deadlocks in
concurrent.futures.ProcessPoolExecutor
when task arguments or results cause pickling or unpickling errors. This should make sure that calls to theProcessPoolExecutor
API always eventually return.bpo-15216 [https://bugs.python.org/issue?@action=redirect&bpo=15216]:
TextIOWrapper.reconfigure()
supports changing encoding, errors, and newline.