Skip to content

Latest commit

 

History

History
905 lines (645 loc) · 19.7 KB

3.9.0a3.rst

File metadata and controls

905 lines (645 loc) · 19.7 KB

Document all possibilities for the -X options in the command line help section. Patch by Pablo Galindo.

Fix possible crashes when operating with the functions in the :mod:`heapq` module and custom comparison operators.

Prevent double awaiting of async iterator.

Add :class:`functools.TopologicalSorter` to the :mod:`functools` module to offers functionality to perform topological sorting of graphs. Patch by Pablo Galindo, Tim Peters and Larry Hastings.

Replace four complex bytecodes for building sequences with three simpler ones.

The following four bytecodes have been removed:

  • BUILD_LIST_UNPACK
  • BUILD_TUPLE_UNPACK
  • BUILD_SET_UNPACK
  • BUILD_TUPLE_UNPACK_WITH_CALL

The following three bytecodes have been added:

  • LIST_TO_TUPLE
  • LIST_EXTEND
  • SET_UPDATE

Import loaders which publish immutable module objects can now publish immutable packages in addition to individual modules.

Added a new function :func:`gc.is_finalized` to check if an object has been finalized by the garbage collector. Patch by Pablo Galindo.

Improve the displayed error message when incorrect types are passed to async with statements by looking up the :meth:`__aenter__` special method before the :meth:`__aexit__` special method when entering an asynchronous context manager. Patch by Géry Ogam.

Fix AST end location for lone generator expression in function call, e.g. f(i for i in a).

Correctly handle multi-line tokens in interactive mode. Patch by Pablo Galindo.

Port _json extension module to multiphase initialization (PEP 489).

Fix constant folding optimization for positional only arguments - by Anthony Sottile.

Fix SystemError when nested function has annotation on positional-only argument - by Anthony Sottile.

Correct the error message when calling the :func:`min` or :func:`max` with no arguments. Patch by Donghee Na.

Correct the error message when trying to construct :class:`range` objects with no arguments. Patch by Pablo Galindo.

Fix incorrect line execution reporting in trace functions when tracing the last iteration of asynchronous for loops. Patch by Pablo Galindo.

Fix incorrect line execution reporting in trace functions when tracing exception handlers with name binding. Patch by Pablo Galindo.

Split the COMPARE_OP bytecode instruction into four distinct instructions.

  • COMPARE_OP for rich comparisons
  • IS_OP for 'is' and 'is not' tests
  • CONTAINS_OP for 'in' and 'is not' tests
  • JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.

This improves the clarity of the interpreter and should provide a modest speedup.

Fix possible crashes in dict and list when calling :c:func:`PyObject_RichCompareBool`.

By default, sys.stderr is line-buffered now, even if stderr is redirected to a file. You can still make sys.stderr unbuffered by passing the :option:`-u` command-line option or setting the :envvar:`PYTHONUNBUFFERED` environment variable.

(Contributed by Jendrik Seipp in bpo-13601.)

Fix possible crashes in several list methods by holding strong references to list elements when calling :c:func:`PyObject_RichCompareBool`.

Include brotli .br encoding in mimetypes encodings_map

Fixed race condition in lazy imports in :mod:`tarfile`.

The :func:`os.unsetenv` function is now also available on Windows.

Fixed a regression with the ignore callback of :func:`shutil.copytree`. The argument types are now str and List[str] again.

The :func:`os.putenv` and :func:`os.unsetenv` functions are now always available.

If setenv() C function is available, :func:`os.putenv` is now implemented with setenv() instead of putenv(), so Python doesn't have to handle the environment variable memory.

Fix math.nextafter(-0.0, +0.0) on AIX 7.1.

Allow :func:`tarfile.is_tarfile` to be used with file and file-like objects, like :func:`zipfile.is_zipfile`. Patch by William Woodruff.

Removed encoding option from :func:`json.loads`. It has been deprecated since Python 3.1.

Write accurate compression level metadata in :mod:`gzip` archives, rather than always signaling maximum compression.

The previously deprecated xpath() and xgtitle() methods of :class:`!nntplib.NNTP` have been removed.

Remove the buffering parameter of :class:`bz2.BZ2File`. Since Python 3.0, it was ignored and using it was emitting :exc:`DeprecationWarning`. Pass an open file object, to control how the file is opened. The compresslevel parameter becomes keyword-only.

Deprecate binhex4 and hexbin4 standards. Deprecate the :mod:`binhex` module and the following :mod:`binascii` functions: :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`, :func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`, :func:`~binascii.crc_hqx`.

Remove base64.encodestring() and base64.decodestring(), aliases deprecated since Python 3.1: use :func:`base64.encodebytes` and :func:`base64.decodebytes` instead.

Remove fractions.gcd() function, deprecated since Python 3.5 (:issue:`22486`): use :func:`math.gcd` instead.

:class:`~smtplib.LMTP` constructor now has an optional timeout parameter. Patch by Donghee Na.

Add a new exec_function option (--exec-function in the CLI) to RefactoringTool for making exec a function. Patch by Batuhan Taskaya.

:class:`~ftplib.FTP_TLS` and :class:`~ftplib.FTP_TLS` now raise a :class:`ValueError` if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket. Patch by Donghee Na.

:class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise a :class:`ValueError` if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket. Patch by Donghee Na.

Add :func:`math.ulp`: return the value of the least significant bit of a float.

Improved performance of importlib.metadata distribution discovery and resilients to inaccessible sys.path entries (importlib_metadata v1.4.0).

:class:`!NNTP` and :class:`!NNTP_SSL` now raise a :class:`ValueError` if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket. Patch by Donghee Na.

When you specify prompt='.' or equivalently python -m venv --prompt . ... the basename of the current directory is used to set the created venv's prompt when it's activated.

Add :func:`math.nextafter`: return the next floating-point value after x towards y.

:class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a :class:`ValueError` if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket. Patch by Donghee Na.

Updated the Gmane domain from news.gmane.org to news.gmane.io which is used for examples of :class:`!NNTP` news reader server and nntplib tests.

Proxy the SimpleHTTPRequestHandler.guess_type to mimetypes.guess_type so the mimetypes.init is called lazily to avoid unnecessary costs when :mod:`http.server` module is imported.

The :meth:`select.epoll.unregister` method no longer ignores the :data:`~errno.EBADF` error.

In http.server script, restore binding to IPv4 on Windows.

Fix ttk.Scale.configure([name]) to return configuration tuple for name or all options. Giovanni Lombardo contributed part of the patch.

If an exception were to be thrown in Logger.isEnabledFor (say, by asyncio timeouts or stopit) , the logging global lock may not be released appropriately, resulting in deadlock. This change wraps that block of code with try...finally to ensure the lock is released.

Perform a check for running loop before starting a new task in loop.run_until_complete() to fail fast; it prevents the side effect of new task spawning before exception raising.

Correctly parenthesize filter-based statements that contain lambda expressions in :mod:`!lib2to3`. Patch by Donghee Na.

A change was made to logging.config.dictConfig to avoid converting instances of named tuples to ConvertingTuple. It's assumed that named tuples are too specialised to be treated like ordinary tuples; if a user of named tuples requires ConvertingTuple functionality, they will have to implement that themselves in their named tuple class.

ast.literal_eval() now supports empty sets.

Fix import path for asyncio.TimeoutError

:func:`urllib.request.proxy_bypass_environment` now ignores leading dots and no longer ignores a trailing newline.

Fixed handling invalid warning category in the -W option. No longer import the re module if it is not needed.

:func:`base64.b64decode` with validate=True raises now a binascii.Error if the input ends with a single \n.

Fix :func:`mock.patch.stopall` to stop active patches that were created with :func:`mock.patch.dict`.

Implement dummy __class_getitem__ for :class:`tempfile.SpooledTemporaryFile`.

Implement dummy __class_getitem__ for subprocess.Popen, subprocess.CompletedProcess

Adjusted the wording of the warning issued by distutils' check command when the author and maintainer fields are supplied but no corresponding e-mail field (author_email or maintainer_email) is found. The wording now reflects the fact that these fields are suggested, but not required. Patch by Juergen Gmach.

Fixed __subclasshook__ of :class:`os.PathLike` to return a correct result upon inheritance. Patch by Bar Harel.

:class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now have an optional timeout parameter for their constructors. Also, the :meth:`~imaplib.IMAP4.open` method now has an optional timeout parameter with this change. The overridden methods of :class:`~imaplib.IMAP4_SSL` and :class:`~imaplib.IMAP4_stream` were applied to this change. Patch by Donghee Na.

Fixed :func:`Popen.communicate` subsequent call crash when the child process has already closed any piped standard stream, but still continues to be running. Patch by Andriy Maletsky.

On Unix, :meth:`subprocess.Popen.send_signal` now polls the process status. Polling reduces the risk of sending a signal to the wrong process if the process completed, the :attr:`subprocess.Popen.returncode` attribute is still None, and the pid has been reassigned (recycled) to a new different process.

Removes trailing space in formatted currency with international=True and a locale with symbol following value. E.g. locale.currency(12.34, international=True) returned '12,34 EUR ' instead of '12,34 EUR'.

Use signature from inner mock for autospecced methods attached with :func:`unittest.mock.attach_mock`. Patch by Karthikeyan Singaravelan.

Fixed an issue where ident could include a leading path separator when :func:`syslog.openlog` was called without arguments.

Add :func:`copy.copy` and :func:`copy.deepcopy` support to :func:`property` objects.

Added the pstats.Stats.get_profile_dict() method to return the profile data as a StatsProfile instance.

Termios magic constants for the following baud rates: - B500000 - B576000 - B921600 - B1000000 - B1152000 - B1500000 - B2000000 - B2500000 - B3000000 - B3500000 - B4000000 Patch by Andrey Smirnov

Mention in docs that :func:`asyncio.get_event_loop` implicitly creates new event loop only if called from the main thread.

Add an entry for __module__ in the "function" & "method" sections of the :mod:`inspect` docs' :ref:`inspect-types` table.

In the :mod:`ast` module documentation, fix a misleading NodeTransformer example and add advice on when to use the fix_missing_locations function.

On non-Windows platforms, the :c:func:`setenv` and :c:func:`unsetenv` functions are now required to build Python.

Updated the documentation in ./configure --help to show default values, reference documentation where required and add additional explanation where needed.

The ctags and etags build targets both include Modules/_ctypes and Python standard library source files.

Make IDLE Settings dialog Help button work again.

Tag memoryview, range, and tuple as classes, the same as list, etcetera, in the library manual built-in functions list.

Add tests for editor newline_and_indent_event method. Remove dead code from pyparse find_good_parse_start method.

Clean header files of interfaces defined but with no implementation. The public API symbols being removed are: _PyBytes_InsertThousandsGroupingLocale, _PyBytes_InsertThousandsGrouping, _Py_InitializeFromArgs, _Py_InitializeFromWideArgs, _PyFloat_Repr, _PyFloat_Digits, _PyFloat_DigitsInit, PyFrame_ExtendStack, _PyAIterWrapper_Type, PyNullImporter_Type, PyCmpWrapper_Type, PySortWrapper_Type, PyNoArgsFunction.

Add a private _PyErr_GetExcInfo() function to retrieve exception information of the specified Python thread state.