Skip to content

Latest commit

 

History

History
878 lines (620 loc) · 17.9 KB

3.7.0b1.rst

File metadata and controls

878 lines (620 loc) · 17.9 KB

Fix coroutine's ResourceWarning when there's an active error set when it's being finalized.

Pdb and other debuggers dependent on bdb.py will correctly step over (next command) native coroutines. Patch by Pablo Galindo.

Optimize list.sort() and sorted() by using type specialized comparisons when possible.

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 semi-colon instead of a newline. Patch by Nitish Chandra.

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.

The locals() dictionary now displays in the lexical order that variables were defined. Previously, the order was reversed.

Add .isascii() method to str, bytes and bytearray. It can be used to test that string contains only ASCII characters.

Enforce 479 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.

Added built-in 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.

Expose preadv and pwritev system calls in the os module. Patch by Pablo Galindo

hasattr(obj, name) and getattr(obj, name, default) are about 4 times faster than before when name is not found and obj doesn't override __getattr__ or __getattribute__.

Improved frozenset() hash to create more distinct hash values when faced with datasets containing many similar values.

Remove the STORE_ANNOTATION bytecode.

Expose posix_spawn as a low level API in the os module.

Fixed estimation of the code stack size.

Implement 567 Context Variables.

repr() on a dict containing its own values() or items() no longer raises RecursionError; OrderedDict similarly. Instead, use ..., as for other recursive structures. Patch by Ben North.

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.

Leading whitespace is now correctly ignored when generating suggestions for converting Py2 print statements to Py3 builtin print function calls. Patch by Sanyam Khurana.

Make dict.copy() up to 5.5 times faster.

Get rid of recursion in the compiler for normal control flow.

Deprecate exposing the contents of collections.abc in the regular collections module.

The default cipher suite selection of the ssl module now uses a blacklist approach rather than a hard-coded 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.

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.

Added support for setting the compression level for zipfile.ZipFile.

Implement asyncio.BufferedProtocol (provisional API).

In dataclasses, allow easier overriding of dunder methods without specifying decorator parameters.

termios makes available FIONREAD, FIONCLEX, FIOCLEX, FIOASYNC and FIONBIO also under Solaris/derivatives.

Fix email address header parsing error when the username is an empty quoted string. Patch by Xiang Zhang.

Under Solaris and derivatives, os.stat_result provides a st_fstype attribute.

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().

Implement asyncio.StreamWriter.wait_closed and asyncio.StreamWriter.is_closing methods

Make Task._step, Task._wakeup and Future._schedule_callbacks methods private.

Refactor decimal module to use contextvars to store decimal context.

Add asyncio.AbstractEventLoop.sendfile method.

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.

uuid.uuid1 no longer raises an exception if a 64-bit hardware address is encountered.

concurrent.futures imports ThreadPoolExecutor and ProcessPoolExecutor lazily (using 562). It makes import asyncio about 15% faster because asyncio uses only ThreadPoolExecutor by default.

Add _ignore_ to Enum so temporary variables can be used during class construction without being turned into members.

Use queue.SimpleQueue() in places where it can be invoked from a weakref callback.

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.

The nis module is now compatible with new libnsl and headers location.

collections.abc.ValuesView now inherits from collections.abc.Collection.

Improve ABCMeta._dump_registry() output readability

New argument capture_output for subprocess.run

glibc has removed Sun RPC. Use replacement libtirpc headers and library in nis module.

UUID module fixes build for FreeBSD/OpenBSD

Pickling with protocol 4 no longer creates too small frames.

Create enum for pstats sorting options

Add close(fd) function to the socket module.

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.

The hmac module now has hmac.digest(), which provides an optimized HMAC digest.

Sockets now auto-detect family, type and protocol from file descriptor by default.

Fix bug where datetime.datetime.fromtimestamp did not call __new__ in datetime.datetime subclasses.

Improved speed of datetime.date and datetime.datetime alternate constructors.

Ensure that truncate() preserves the file position (as reported by tell()) after writes longer than the buffer size.

Implement loop.sock_sendfile for asyncio event loop.

Added seek and tell to the ZipExtFile class. This only works if the file object used to open the zipfile is seekable.

Add socket.getblocking() method.

Add importlib.resources and importlib.abc.ResourceReader as the unified API for reading resources contained within packages. Loaders wishing to support resource reading must implement the get_resource_reader() method. File-based and zipimport-based loaders both implement these APIs. importlib.abc.ResourceLoader is deprecated in favor of these new APIs.

collections.namedtuple() now supports default values.

Add contextlib.AsyncExitStack. Patch by Alexander Mohr and Ilya Kulakov.

Removed in Python 3.7.0b2. The args argument of subprocess.Popen can now be a path-like object. If args is given as a sequence, it's first element can now be a path-like object as well.

The locale.localeconv function now sets temporarily the LC_CTYPE locale to the LC_NUMERIC locale to decode decimal_point and thousands_sep byte strings if they are non-ASCII or longer than 1 byte, and the LC_NUMERIC locale is different than the LC_CTYPE locale. This temporary change affects other threads.

Same change for the str.format method when formatting a number (int, float, float and subclasses) with the n type (ex: '{:n}'.format(1234)).

Use super().method instead of socket.method in SSLSocket. They were there most likely for legacy reasons.

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.

Add a queue.SimpleQueue class, an unbounded FIFO queue with a reentrant C implementation of put().

Add references to some commands in the documentation of Pdb. Patch by Stéphane Wirtel

Complete the C API documentation, profiling and tracing part with the newly added per-opcode events.

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.

Fix test_hashlib to not fail if the _md5 module is not built.

Add test cases for IDNA 2003 and 2008 host names. IDNA 2003 internationalized host names are working since bpo-31399 has landed. IDNA 2008 are still broken.

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.

Add test certs and test for ECDSA cert and EC/RSA dual mode.

On Travis CI, Python now Compiles and uses a local copy of OpenSSL 1.1.0g for testing.

Fix segfault of the crypt module when libxcrypt is provided instead of libcrypt at the system.

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.

Drop support of FreeBSD 9 and older.

If the SOURCE_DATE_EPOCH environment variable is set, py_compile will always create hash-based .pyc files.

Create standalone _distutils_findvs module and add missing _queue module to installer.

Ensure separate Modify and Uninstall buttons are displayed.

Use app-local UCRT install rather than the proper update for old versions of Windows.

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.

No longer add /Library/Python/3.x/site-packages to sys.path for macOS framework builds to avoid future conflicts.

Fix uninitialized variable 'res' in the C implementation of os.dup2. Patch by Stéphane Wirtel

Add C API access to the datetime.timezone constructor and datetime.timzone.UTC singleton.