Professional Documents
Culture Documents
Python News
+++++++++++
- gh-issue-109823: Fix bug where compiler does not adjust labels when
removing an empty basic block which is a jump target.
- gh-issue-109627: Fix bug where the compiler does not assign a new jump
target label to a duplicated small exit block.
Library
-------
Documentation
-------------
Windows
-------
macOS
-----
Tools/Demos
-----------
- gh-issue-105658: Fix bug where the line trace of an except block ending
with a conditional includes an excess event with the line of the
conditional expression.
- gh-issue-109219: Fix compiling type param scopes that use a name which is
also free in an inner scope.
- gh-issue-108959: Fix caret placement for error locations for subscript and
binary operations that involve non-semantic parentheses and spaces. Patch
by Pablo Galindo
Library
-------
Documentation
-------------
- gh-issue-102823: Document the return type of ``x // y`` when ``x`` and
``y`` have type :class:`float`.
Tests
-----
Build
-----
Security
--------
- gh-issue-108520: Fix
:meth:`multiprocessing.synchronize.SemLock.__setstate__` to properly
initialize :attr:`multiprocessing.synchronize.SemLock._is_fork_ctx`. This
fixes a regression when passing a SemLock accross nested processes.
Rename :attr:`multiprocessing.synchronize.SemLock.is_fork_ctx` to
:attr:`multiprocessing.synchronize.SemLock._is_fork_ctx` to avoid exposing
it as public API.
- gh-issue-108654: Restore locals shadowed by an inlined comprehension if
the comprehension raises an exception.
- gh-issue-91051: Fix abort / segfault when using all eight type watcher
slots, on platforms where ``char`` is signed by default.
Library
-------
Documentation
-------------
Tests
-----
- gh-issue-89392: Removed support of ``test_main()`` function in tests. They
now always use normal unittest test runner.
- gh-issue-107178: Add the C API test for functions in the Mapping Protocol,
the Sequence Protocol and some functions in the Object Protocol.
Build
-----
Windows
-------
macOS
-----
Tools/Demos
-----------
C API
-----
- gh-issue-107916: C API functions :c:func:`PyErr_SetFromErrnoWithFilename`,
:c:func:`PyErr_SetExcFromWindowsErrWithFilename` and
:c:func:`PyErr_SetFromWindowsErrWithFilename` save now the error code
before calling :c:func:`PyUnicode_DecodeFSDefault`.
Security
--------
Library
-------
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
macOS
-----
Tools/Demos
-----------
C API
-----
Security
--------
Library
-------
Documentation
-------------
Tests
-----
- gh-issue-101634: When running the Python test suite with ``-jN`` option,
if a worker stdout cannot be decoded from the locale encoding report a
failed testn so the exitcode is non-zero. Patch by Victor Stinner.
Build
-----
C API
-----
Library
-------
Tests
-----
Windows
-------
C API
-----
Security
--------
- gh-issue-103142: The version of OpenSSL used in our binary builds has been
upgraded to 1.1.1u to address several CVEs.
Library
-------
- gh-issue-103631: Fix
``pathlib.PurePosixPath(pathlib.PureWindowsPath(...))`` not converting
path separators to restore 3.11 compatible behavior.
- gh-issue-104399: Prepare the ``_tkinter`` module for building with Tcl 9.0
and future libtommath by replacing usage of deprecated functions
:c:func:`mp_to_unsigned_bin_n` and :c:func:`mp_unsigned_bin_size` when
necessary.
Documentation
-------------
Build
-----
Windows
-------
macOS
-----
IDLE
----
C API
-----
Security
--------
A new ``type X = ...`` syntax is added for type aliases, which resolves at
runtime to an instance of the new class ``typing.TypeAliasType``. The
value is lazily evaluated and is accessible through the ``.__value__``
attribute. This is implemented as a new AST node ``ast.TypeAlias``.
New syntax (``class X[T]: ...``, ``def func[T](): ...``) is added for
defining generic functions and classes. This is implemented as a new
``type_params`` attribute on the AST nodes for classes and functions. This
node holds instances of the new AST classes ``ast.TypeVar``,
``ast.ParamSpec``, and ``ast.TypeVarTuple``.
- gh-issue-103801: Adds three minor linting fixes to the wasm module caught
that were caught by ruff.
- gh-issue-103650: Change the perf map format to remove the '0x' prefix from
the addresses
- gh-issue-100530: Clarify the error message raised when the called part of
a class pattern isn't actually a class.
Library
-------
- gh-issue-103636: Added Enum for months and days in the calendar module.
- gh-issue-62432: The :mod:`unittest` runner will now exit with status code
5 if no tests were run. It is common for test runner misconfiguration to
fail to find any tests, this should be an error.
- bpo-24964: Added
:meth:`http.client.HTTPConnection.get_proxy_response_headers` that
provides access to the HTTP headers on a proxy server response to the
``CONNECT`` request.
Documentation
-------------
- gh-issue-86094: Add support for Unicode Path Extra Field in ZipFile. Patch
by Yeojin Kim and Andrea Giudiceandrea
Tests
-----
Build
-----
* loongarch64-linux-gnusf
* loongarch64-linux-gnuf32
* loongarch64-linux-gnu
Windows
-------
macOS
-----
IDLE
----
Tools/Demos
-----------
C API
-----
- gh-issue-96803: Add unstable C-API functions to get the code object, lasti
and line number from the internal ``_PyInterpreterFrame`` in the limited
API. The functions are:
This makes a few operations slightly more efficient, and will enable a
more compact and faster 2s-complement representation of most ints in
future.
Library
-------
- gh-issue-98886: Fix issues when defining dataclasses that have fields with
specific underscore names that aren't clearly reserved by
:mod:`dataclasses`.
- gh-issue-101673: Fix a :mod:`pdb` bug where ``ll`` clears the changes to
local variables.
- gh-issue-95495: When built against OpenSSL 3.0, the :mod:`ssl` module had
a bug where it reported unauthenticated EOFs (i.e. without close_notify)
as a clean TLS-level EOF. It now raises :exc:`~ssl.SSLEOFError`, matching
the behavior in previous versions of OpenSSL. The
:attr:`~ssl.SSLContext.options` attribute on :class:`~ssl.SSLContext` also
no longer includes :const:`~ssl.OP_IGNORE_UNEXPECTED_EOF` by default. This
option may be set to specify the previous OpenSSL 3.0 behavior.
Documentation
-------------
Tests
-----
- gh-issue-102980: Improve test coverage on :mod:`pdb`.
Build
-----
Windows
-------
Tools/Demos
-----------
C API
-----
Security
--------
- gh-issue-84783: Make the slice object hashable. Patch by Will Bradshaw and
Furkan Onder.
Library
-------
- gh-issue-101517: Fixed bug where :mod:`bdb` looks up the source line with
:mod:`linecache` with a ``lineno=None``, which causes it to fail with an
unhandled exception.
- gh-issue-101693: In :meth:`sqlite3.Cursor.execute`,
:exc:`DeprecationWarning` is now emitted when :ref:`named placeholders
<sqlite3-placeholders>` are used together with parameters supplied as a
:term:`sequence` instead of as a :class:`dict`. Starting from Python 3.14,
using named placeholders with parameters supplied as a sequence will raise
a :exc:`~sqlite3.ProgrammingError`. Patch by Erlend E. Aasland.
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
macOS
-----
C API
-----
Security
--------
Library
-------
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
- gh-issue-101543: Ensure the install path in the registry is only used when
the standard library hasn't been located in any other way.
Library
-------
- gh-issue-100690: ``Mock`` objects which are not unsafe will now raise an
``AttributeError`` when accessing an attribute that matches the name of an
assertion but without the prefix ``assert_``, e.g. accessing
``called_once`` instead of ``assert_called_once``. This is in addition to
this already happening for accessing attributes with prefixes ``assert``,
``assret``, ``asert``, ``aseert``, and ``assrt``.
Documentation
-------------
Tests
-----
- gh-issue-93018: Make two tests forgiving towards host system libexpat with
backported security fixes applied.
Build
-----
Windows
-------
macOS
-----
Tools/Demos
-----------
C API
-----
Security
--------
- gh-issue-99370: Fix zip path for venv created from a non-installed python
on POSIX platforms.
- gh-issue-99377: Add audit events for thread creation and clear operations.
Library
-------
- bpo-15999: All built-in functions now accept arguments of any type instead
of just ``bool`` and ``int`` for boolean parameters.
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
macOS
-----
Tools/Demos
-----------
C API
-----
Security
--------
- gh-issue-99254: The compiler now removes all unused constants from code
objects (except the first one, which may be a docstring).
Library
-------
Documentation
-------------
Tests
-----
- gh-issue-98903: The Python test suite now fails wit exit code 4 if no
tests ran. It should help detecting typos in test names and test methods.
- gh-issue-87390: Add tests for star-unpacking with PEP 646, and some other
miscellaneous PEP 646 tests.
- bpo-34272: Some C API tests were moved into the new Lib/test/test_capi/
directory.
Build
-----
- gh-issue-97731: Specify the full path to the source location for ``make
docclean`` (needed for cross-builds).
<https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md>`
__.
The tooling reads this file and writes ``Python/generated_cases.c.h``,
which is then included by ``Python/ceval.c`` to provide most of the cases
of the main interpreter switch.
Windows
-------
macOS
-----
C API
-----
Security
--------
Abstract sockets have no permissions and could allow any user on the
system in the same `network namespace
<https://man7.org/linux/man-pages/man7/network_namespaces.7.html>`_ (often
the whole system) to inject code into the multiprocessing *forkserver*
process. This was a potential privilege escalation. Filesystem based
socket permissions restrict this to the *forkserver* process user as was
the default in Python 3.8 and earlier.
- gh-issue-98461: Fix source location in bytecode for list, set and dict
comprehensions as well as generator expressions.
- gh-issue-97922: The Garbage Collector now runs only on the eval breaker
mechanism of the Python bytecode evaluation loop instead on object
allocations. The GC can also run when :c:func:`PyErr_CheckSignals` is
called so C extensions that need to run for a long time without executing
any Python code also have a chance to execute the GC periodically.
- gh-issue-96754: Make sure that all frame objects created are created from
valid interpreter frames. Prevents the possibility of invalid frames in
backtraces and signal handlers.
- gh-issue-96572: Fix use after free in trace refs build mode. Patch by
Kumar Aditya.
- gh-issue-90230: Fix compiler warnings and test failures when building with
``--enable-pystats``.
- gh-issue-93554: Change the jump opcodes so that all conditional jumps are
forward jumps. Backward jumps are converted by the assembler into a
conditional forward jump whose target is the fallthrough block (and with a
reversed condition), followed by an unconditional backward jump. For
example:
- gh-issue-96268: Loading a file with invalid UTF-8 will now report the
broken character at the correct location.
- gh-issue-96143: Add a new ``-X perf`` Python command line option as well
as :func:`sys.activate_stack_trampoline` and
:func:`sys.deactivate_stack_trampoline` function in the :mod:`sys` module
that allows to set/unset the interpreter in a way that the Linux ``perf``
profiler can detect Python calls. The new
:func:`sys.is_stack_trampoline_active` function allows to query the state
of the perf trampoline. Design by Pablo Galindo. Patch by Pablo Galindo
and Christian Heimes with contributions from Gregory P. Smith [Google] and
Mark Shannon.
- gh-issue-96071: Fix a deadlock in :c:func:`PyGILState_Ensure` when
allocating new thread state. Patch by Kumar Aditya.
- gh-issue-95245: Merge managed dict and values pointer into a single tagged
pointer to save one word in the pre-header.
- gh-issue-91256: Ensures the program name is known for help text during
interpreter startup.
- gh-issue-94694: Fix an issue that could cause code with multi-line method
lookups to have misleading or incorrect column offset information. In some
cases (when compiling a hand-built AST) this could have resulted in a hard
crash of the interpreter.
- gh-issue-94438: Account for instructions that can push NULL to the stack
when setting line number in a frame. Prevents some (unlikely) crashes.
- gh-issue-88116: Fix an issue when reading line numbers from code objects
if the encoded line numbers are close to ``INT_MIN``. Patch by Pablo
Galindo
- gh-issue-93662: Make sure that the end column offsets are correct in
multi-line method calls. Previously, the end column could precede the
column offset.
- gh-issue-92858: Improve error message for some suites with syntax error
before ':'
- bpo-46142: Make ``--help`` output shorter by moving some info to the new
``--help-env`` and ``--help-xoptions`` command-line options. Also add
``--help-all`` option to print complete usage.
Library
-------
- gh-issue-98307: A :meth:`~logging.handlers.SysLogHandler.createSocket`
method was added to :class:`~logging.handlers.SysLogHandler`.
- gh-issue-94597: Deprecated
:meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` and
:meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` methods to be
removed in Python 3.14. Patch by Kumar Aditya.
to
``It is deprecated to return a value that is not None from a test case``
- gh-issue-94216: The :mod:`dis` module now has the opcodes for pseudo
instructions (those which are used by the compiler during code generation
but then removed or replaced by real opcodes before the final bytecode is
emitted).
- gh-issue-84753: :func:`inspect.iscoroutinefunction`,
:func:`inspect.isgeneratorfunction`, and
:func:`inspect.isasyncgenfunction` now properly return ``True`` for
duck-typed function-like objects like instances of
:class:`unittest.mock.AsyncMock`.
- gh-issue-93297: Make asyncio task groups prevent child tasks from being
GCed
* ``sqlite3.enable_shared_cache()``
* ``sqlite3.OptimizedUnicode``
- gh-issue-91760: Apply more strict rules for numerical group references and
group names in regular expressions. Only sequence of ASCII digits is now
accepted as a numerical reference. The group name in bytes patterns and
replacement strings can now only contain ASCII letters and digits and
underscore.
- bpo-45393: Fix the formatting for ``await x`` and ``not x`` in the
operator precedence table when using the :func:`help` system.
- bpo-41246: Give the same callback function for when the overlapped
operation is done to the functions ``recv``, ``recv_into``, ``recvfrom``,
``sendto``, ``send`` and ``sendfile`` inside ``IocpProactor``.
Documentation
-------------
- gh-issue-95957: What's New 3.11 now has instructions for how to provide
compiler and linker flags for Tcl/Tk and OpenSSL on RHEL 7 and CentOS 7.
- gh-issue-92240: Added release dates for "What's New in Python 3.X" for
3.0, 3.1, 3.2, 3.8 and 3.10
- gh-issue-95027: On Windows, when the Python test suite is run with the
``-jN`` option, the ANSI code page is now used as the encoding for the
stdout temporary file, rather than using UTF-8 which can lead to decoding
errors. Patch by Victor Stinner.
- gh-issue-92670: Skip
``test_shutil.TestCopy.test_copyfile_nonexistent_dir`` test on AIX as the
test uses a trailing slash to force the OS consider the path as a
directory, but on AIX the trailing slash has no effect and is considered
as a file.
- bpo-47016: Create a GitHub Actions workflow for verifying bundled pip and
setuptools. Patch by Illia Volochii and Adam Turner.
Build
-----
- gh-issue-85936: CPython now uses the ThinLTO option as the default policy
if the Clang compiler accepts the flag. Patch by Donghee Na.
Windows
-------
macOS
-----
- gh-issue-97897: The macOS 13 SDK includes support for the ``mkfifoat`` and
``mknodat`` system calls. Using the ``dir_fd`` option with either
:func:`os.mkfifo` or :func:`os.mknod` could result in a segfault if
cpython is built with the macOS 13 SDK but run on an earlier version of
macOS. Prevent this by adding runtime support for detection of these
system calls ("weaklinking") as is done for other newer syscalls on macOS.
IDLE
----
- gh-issue-97527: Fix a bug in the previous bugfix that caused IDLE to not
start when run with 3.10.8, 3.12.0a1, and at least Microsoft Python
3.10.2288.0 installed without the Lib/test package. 3.11.0 was never
affected.
- gh-issue-95471: In the Edit menu, move ``Select All`` and add a new
separator.
Tools/Demos
-----------
C API
-----
- gh-issue-93937: The following frame functions and type are now directly
available with ``#include <Python.h>``, it's no longer needed to add
``#include <frameobject.h>``:
* :c:func:`PyFrame_Check`
* :c:func:`PyFrame_GetBack`
* :c:func:`PyFrame_GetBuiltins`
* :c:func:`PyFrame_GetGenerator`
* :c:func:`PyFrame_GetGlobals`
* :c:func:`PyFrame_GetLasti`
* :c:func:`PyFrame_GetLocals`
* :c:type:`PyFrame_Type`
- gh-issue-91321: Fix the compatibility of the Python C API with C++ older
than C++11. Patch by Victor Stinner.
- gh-issue-92781: Avoid mixing declarations and code in the C API to fix the
compiler warning: "ISO C90 forbids mixed declarations and code"
[-Werror=declaration-after-statement]. Patch by Victor Stinner.
- gh-issue-92651: Remove the ``token.h`` header file. There was never any
public tokenizer C API. The ``token.h`` header file was only designed to
be used by Python internals. Patch by Victor Stinner.
Warning: extensions using this API must preserve the behavior of the
unaltered function!
Security
--------
- gh-issue-91632: Fix a minor memory leak at exit: release the memory of the
:class:`generic_alias_iterator` type. Patch by Donghee Na.
- gh-issue-81548: Octal escapes with value larger than ``0o377`` now produce
a :exc:`DeprecationWarning`. In a future Python version they will be a
:exc:`SyntaxWarning` and eventually a :exc:`SyntaxError`.
- bpo-43950: Use a single compact table for line starts, ends and column
offsets. Reduces memory consumption for location info by half
- gh-issue-78607: The LLTRACE special build now looks for the name
``__lltrace__`` defined in module globals, rather than the name
``__ltrace__``, which had been introduced as a typo.
Library
-------
- gh-issue-90997: Show the actual named values stored in inline caches when
``show_caches=True`` is passed to :mod:`dis` utilities.
- gh-issue-91487: Optimize asyncio UDP speed, over 100 times faster when
transferring a large file.
- gh-issue-90622: In ``concurrent.futures.process.ProcessPoolExecutor``
disallow the "fork" multiprocessing start method when the new
``max_tasks_per_child`` feature is used as the mix of threads+fork can
hang the child processes. Default to using the safe "spawn" start method
in that circumstance if no ``mp_context`` was supplied.
Documentation
-------------
- bpo-47189: Add a What's New in Python 3.11 entry for the Faster CPython
project. Documentation by Ken Jin and Kumar Aditya.
- bpo-47115: The documentation now lists which members of C structs are part
of the :ref:`Limited API/Stable ABI <stable>`.
Tests
-----
- bpo-40280: Threading tests are now skipped on WASM targets without pthread
support.
- bpo-47109: Test for :mod:`ctypes.macholib.dyld`,
:mod:`ctypes.macholib.dylib`, and :mod:`ctypes.macholib.framework` are
brought from manual pre-:mod:`unittest` times to :mod:`ctypes.test`
location and structure. Patch by Oleg Iarygin.
Build
-----
Windows
-------
macOS
-----
Tools/Demos
-----------
- bpo-47176: Emscripten builds cannot handle signals in the usual way due to
platform limitations. Python can now handle signals. To use, set
Module.Py_EmscriptenSignalBuffer to be a single byte SharedArrayBuffer and
set Py_EMSCRIPTEN_SIGNAL_HANDLING to 1. Writing a number into the
SharedArrayBuffer will cause the corresponding signal to be raised into
the Python thread.
- bpo-46775: Some Windows system error codes(>= 10000) are now mapped into
the correct errno and may now raise a subclass of :exc:`OSError`. Patch by
Donghee Na.
Library
-------
- bpo-47208: Allow vendors to override :const:`CTYPES_MAX_ARGCOUNT`.
- bpo-47151: When subprocess tries to use vfork, it now falls back to fork
if vfork returns an error. This allows use in situations where vfork isn't
allowed by the OS kernel.
This also boosts performance on Windows as it now uses the zlib crc32
implementation for :func:`binascii.crc32` for a 2-3x speedup.
That the stdlib has a crc32 API in two modules is a known historical
oddity. This moves us closer to a single implementation behind them.
- bpo-47066: Global inline flags (e.g. ``(?i)``) can now only be used at the
start of the regular expressions. Using them not at the start of
expression was deprecated since Python 3.6.
- bpo-39394: A warning about inline flags not at the start of the regular
expression now contains the position of the flag.
- bpo-43253: Fix a crash when closing transports where the underlying socket
handle is already invalid on the Proactor event loop.
- bpo-46557: Warnings captured by the logging module are now logged without
a format string to prevent systems that group logs by the msg argument
from grouping captured warnings together.
- bpo-46170: Improve the error message when you try to subclass an instance
of :class:`typing.NewType`.
- bpo-35859: :mod:`re` module, fix a few bugs about capturing group. In rare
cases, capturing group gets an incorrect string. Patch by Ma Lin.
Documentation
-------------
Tests
-----
- bpo-40280: The test suite is now passing on the Emscripten platform. All
fork, socket, and subprocess-based tests are skipped.
Build
-----
- bpo-40280: Add configure option :option:`--enable-wasm-dynamic-linking` to
enable ``dlopen`` and MAIN_MODULE / SIDE_MODULE on ``wasm32-emscripten``.
- bpo-47024: Update OpenSSL to 1.1.1n for macOS installers and all Windows
builds.
- bpo-46917: Building Python now requires support of IEEE 754 floating point
numbers. Patch by Victor Stinner.
- bpo-45774: ``configure`` now verifies that all SQLite C APIs needed for
the :mod:`sqlite3` extension module are found.
Windows
-------
macOS
-----
- bpo-46890: Fix a regression in the setting of ``sys._base_executable`` in
framework builds, and thereby fix a regression in :mod:`venv` virtual
environments with such builds.
Tools/Demos
-----------
C API
-----
* ``_PyEval_GetAsyncGenFirstiter()``
* ``_PyEval_GetAsyncGenFinalizer()``
* ``_PyEval_SetAsyncGenFirstiter()``
* ``_PyEval_SetAsyncGenFinalizer()``
- bpo-46906: Add new functions to pack and unpack C double (serialize and
deserialize): :c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`,
:c:func:`PyFloat_Pack8`, :c:func:`PyFloat_Unpack2`,
:c:func:`PyFloat_Unpack4` and :c:func:`PyFloat_Unpack8`. Patch by Victor
Stinner.
What's New in Python 3.11.0 alpha 6?
====================================
- bpo-46927: Include the type's name in the error message for subscripting
non-generic types.
- bpo-46903: Make sure that str subclasses can be used as attribute names
for instances with virtual dictionaries. Fixes regression in 3.11alpha
- bpo-46845: Reduces dict size by removing hash value from hash table when
all inserted keys are Unicode. For example,
``sys.getsizeof(dict.fromkeys("abcdefg"))`` becomes 272 bytes from 352
bytes on 64bit platform.
- bpo-46808: Remove the ``NEXT_BLOCK`` macro from compile.c, and make the
compiler automatically generate implicit blocks when they are needed.
- bpo-46762: Fix an assert failure in debug builds when a '<', '>', or '='
is the last character in an f-string that's missing a closing right brace.
- bpo-46724: Make sure that all backwards jumps use the ``JUMP_ABSOLUTE``
instruction, rather than ``JUMP_FORWARD`` with an argument of
``(2**32)+offset``.
Library
-------
Now it does not modify external classes and functions. We also now
correctly mark classmethods as not to be type checked.
- bpo-46232: The :mod:`ssl` module now handles certificates with bit strings
in DN correctly.
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
- bpo-46744: The default all users install directory for ARM64 is now under
the native ``Program Files`` folder, rather than ``Program Files (Arm)``
which is intended for ARM (32-bit) files.
- bpo-46567: Adds Tcl and Tk support for Windows ARM64. This also adds IDLE
to the installation.
IDLE
----
- bpo-46630: Make query dialogs on Windows start with a cursor in the entry
box.
C API
-----
This partition into pre-call and call allows better specialization, and
thus better performance ultimately.
- bpo-46161: Fix the class building error when the arguments are constants
and CALL_FUNCTION_EX is used.
Library
-------
- bpo-46591: Make the IDLE doc URL on the About IDLE dialog clickable.
- bpo-43869: Python uses the same time Epoch on all platforms. Add an
explicit unit test to ensure that it's the case. Patch by Victor Stinner.
Documentation
-------------
Tests
-----
- bpo-43478: Mocks can no longer be provided as the specs for other Mocks.
As a result, an already-mocked object cannot be passed to `mock.Mock()`.
This can uncover bugs in tests since these Mock-derived Mocks will always
pass certain tests (e.g. isinstance) and builtin assert functions (e.g.
assert_called_once_with) will unconditionally pass.
Build
-----
- bpo-46600: Fix the test checking if the C compiler supports ``-Og`` option
in the ``./configure`` script to also use ``-Og`` on clang which supports
it. Patch by Victor Stinner.
- bpo-46429: Merge all deep-frozen files into one for space savings. Patch
by Kumar Aditya.
- bpo-45569: The build now defaults to using 30-bit digits for Python
integers. Previously either 15-bit or 30-bit digits would be selected,
depending on the platform. 15-bit digits may still be selected using the
``--enable-big-digits=15`` option to the ``configure`` script, or by
defining ``PYLONG_BITS_IN_DIGIT`` in ``pyconfig.h``.
Windows
-------
- bpo-44934: The installer now offers a command-line only option to add the
installation directory to the end of :envvar:`PATH` instead of at the
start.
macOS
-----
IDLE
----
- bpo-45296: Clarify close, quit, and exit in IDLE. In the File menu,
'Close' and 'Exit' are now 'Close Window' (the current one) and 'Exit' is
now 'Exit IDLE' (by closing all windows). In Shell, 'quit()' and 'exit()'
mean 'close Shell'. If there are no other windows, this also exits IDLE.
C API
-----
- bpo-46339: Fix a crash in the parser when retrieving the error text for
multi-line f-strings expressions that do not start in the first line of
the string. Patch by Pablo Galindo
- bpo-46237: Fix the line number of tokenizer errors inside f-strings. Patch
by Pablo Galindo.
- bpo-46240: Correct the error message for unclosed parentheses when the
tokenizer doesn't reach the end of the source when the error is reported.
Patch by Pablo Galindo
- bpo-46110: Add a maximum recursion check to the PEG parser to avoid stack
overflow. Patch by Pablo Galindo
- bpo-44525: Replace the four call bytecode instructions which one pre-call
instruction and two call instructions.
- bpo-37971: Fix a bug where the line numbers given in a traceback when a
decorator application raised an exception were wrong.
- bpo-42918: Fix bug where the built-in :func:`compile` function did not
always raise a :exc:`SyntaxError` when passed multiple statements in
'single' mode. Patch by Weipeng Hong.
Library
-------
Now all constants (`MONDAY` ... `SUNDAY`) are documented, tested, and
added to ``__all__``.
- bpo-37295: Add fast path for ``0 <= k <= n <= 67`` for :func:`math.comb`.
- bpo-46105: Honor spec when generating requirement specs with urls and
extras (importlib_metadata 4.8.3).
These features were never supported and do not always work correctly. The
functions exist on the API by accident through inheritance and will be
removed in the future.
- bpo-27718: Fix help for the :mod:`signal` module. Some functions (e.g.
``signal()`` and ``getsignal()``) were omitted.
Documentation
-------------
Tests
-----
- bpo-46296: Add a test case for :mod:`enum` with ``_use_args_ == True`` and
``_member_type_ == object``.
- bpo-46114: Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses
``0xMNN00PP0L``.
Build
-----
Windows
-------
macOS
-----
- bpo-40477: The Python Launcher app for macOS now properly launches scripts
and, if necessary, the Terminal app when running on recent macOS releases.
C API
-----
- bpo-46140: :c:func:`PyBuffer_GetPointer`,
:c:func:`PyBuffer_FromContiguous`, :c:func:`PyBuffer_ToContiguous` and
:c:func:`PyMemoryView_FromBuffer` now take buffer info by ``const
Py_buffer *`` instead of ``Py_buffer *``, as they do not need mutability.
:c:func:`PyBuffer_FromContiguous` also now takes the source buffer as
``const void *``, and similarly :c:func:`PyBuffer_GetPointer` takes the
strides as ``const Py_ssize_t *``.
- bpo-46009: Restore behavior from 3.9 and earlier when sending non-None to
newly started generator. In 3.9 this did not affect the state of the
generator. In 3.10.0 and 3.10.1 ``gen_func().send(0)`` is equivalent to
``gen_func().throw(TypeError(...)`` which exhausts the generator. In
3.10.2 onward, the behavior has been reverted to that of 3.9.
- bpo-45711: The three values of ``exc_info`` are now always consistent with
each other. In particular, the ``type`` and ``traceback`` fields are now
derived from the exception instance. This impacts the return values of
:func:`sys.exc_info` and :c:func:`PyErr_GetExcInfo()` if the exception
instance is modified while the exception is handled, as well as
:c:func:`PyErr_SetExcInfo()`, which now ignores the ``type`` and
``traceback`` arguments provided to it.
- bpo-45727: Refine the custom syntax error that suggests that a comma may
be missing to trigger only when the expressions are detected between
parentheses or brackets. Patch by Pablo Galindo
- bpo-45786: Allocate space for the interpreter frame in the frame object,
to avoid an additional allocation when the frame object outlives the frame
activation.
- bpo-45848: Allow the parser to obtain error lines directly from encoded
files. Patch by Pablo Galindo
- bpo-45822: Fixed a bug in the parser that was causing it to not respect
:pep:`263` coding cookies when no flags are provided. Patch by Pablo
Galindo
- bpo-45820: Fix a segfault when the parser fails without reading any input.
Patch by Pablo Galindo
- bpo-45764: The parser now gives a better error message when leaving out
the opening parenthesis ``(`` after a ``def``-statement::
>>> def f:
File "<stdin>", line 1
def f:
^
SyntaxError: expected '('
Library
-------
- bpo-43137: Launch GNOME web browsers via gio tool instead of obsolete
gvfs-open
- bpo-42158: Add MIME types for N-quads, N-triples, Notation3 and TriG to
``mimetypes``.
Documentation
-------------
Tests
-----
- bpo-45783: The test for the freeze tool now handles file moves and
deletions.
Build
-----
- bpo-44035: CI now verifies that autoconf files have been regenerated with
a current and unpatched autoconf package.
- bpo-45866: ``make regen-all`` now produces the same output when run from a
directory other than the source tree: when building Python out of the
source tree. pegen now strips directory of the "generated by pygen from
<FILENAME>" header Patch by Victor Stinner.
- bpo-45816: Python now supports building with Visual Studio 2022 (MSVC
v143, VS Version 17.0). Patch by Jeremiah Vivian.
- bpo-45696: Skip the marshal step for frozen modules by generating C code
that produces a set of ready-to-use code objects. This speeds up startup
time by another 10% or more.
Windows
-------
- bpo-45901: When installed through the Microsoft Store and set as the
default app for :file:`*.py` files, command line arguments will now be
passed to Python when invoking a script without explicitly launching
Python (that is, ``script.py args`` rather than ``python script.py
args``).
macOS
-----
C API
-----
The order of the result may differ from earlier releases if the tuple
elements don't define a total ordering (see
:ref:`expressions-value-comparisons` for information on total ordering).
It's generally true that the result of sorting simply isn't well-defined
in the absence of a total ordering on list elements.
- bpo-45526: In obmalloc, set ADDRESS_BITS to not ignore any bits (ignored
16 before). That is safer in the case that the kernel gives user-space
virtual addresses that span a range greater than 48 bits.
- bpo-45521: Fix a bug in the obmalloc radix tree code. On 64-bit machines,
the bug causes the tree to hold 46-bits of virtual addresses, rather than
the intended 48-bits.
- bpo-45408: Fix a crash in the parser when reporting tokenizer errors that
occur at the same time unclosed parentheses are detected. Patch by Pablo
Galindo.
- bpo-29410: Add SipHash13 for string hash algorithm and use it by default.
- bpo-21736: Frozen stdlib modules now have ``__file__`` to the .py file
they would otherwise be loaded from, if possible. For packages,
``__path__`` now has the correct entry instead of being an empty list,
which allows unfrozen submodules to be imported. These are set only if
the stdlib directory is known when the runtime is initialized. Note that
the file at ``__file__`` is not guaranteed to exist. None of this affects
non-stdlib frozen modules nor, for now, frozen modules imported using
``PyImport_ImportFrozenModule()``. Also, at the moment ``co_filename`` is
not updated for the module.
- bpo-45020: For frozen stdlib modules, record the original module name as
``module.__spec__.loader_state.origname``. If the value is different than
``module.__spec__.name`` then the module was defined as an alias in
Tools/scripts/freeze_modules.py. If it is ``None`` then the module comes
from a source file outside the stdlib.
- bpo-44050: Extensions that indicate they use global state (by setting
``m_size`` to -1) can again be used in multiple interpreters. This reverts
to behavior of Python 3.8.
- bpo-44511: Improve the generated bytecode for class and mapping patterns.
Library
-------
- bpo-45411: Add extensions for files containing subtitles - .srt & .vtt -
to the mimetypes.py module.
- bpo-10716: Migrated pydoc to HTML5 (without changing the look of it). Side
effect is to update xmlrpc's ``ServerHTMLDoc`` which now uses the CSS too.
cgitb now relies less on pydoc (as it can't use the CSS file).
- bpo-35970: Add help flag to the base64 module's command line interface.
Patch contributed by Robert Kuska.
Documentation
-------------
- bpo-20692: Add Programming FAQ entry explaining that int literal attribute
access requires either a space after or parentheses around the literal.
Tests
-----
- bpo-45668: PGO tests now pass when Python is built without test extension
modules.
- bpo-45400: Fix
test_name_error_suggestions_do_not_trigger_for_too_many_locals() of
test_exceptions if a directory name contains "a1" (like
"Python-3.11.0a1"): use a stricter regular expression. Patch by Victor
Stinner.
Build
-----
- bpo-43158: ``setup.py`` now uses values from configure script to build the
``_uuid`` extension module. Configure now detects util-linux's
``libuuid``, too.
- bpo-45536: The ``configure`` script now checks whether OpenSSL headers and
libraries provide required APIs. Most common APIs are verified. The check
detects outdated or missing OpenSSL. Failures do not stop configure.
Windows
-------
- bpo-45337: venv now warns when the created environment may need to be
accessed at a different path, due to redirections, links or junctions. It
also now correctly installs or upgrades components when the alternate path
is required.
macOS
-----
IDLE
----
C API
-----
- bpo-45522: The internal freelists for frame, float, list, dict, async
generators, and context objects can now be disabled.
* :c:func:`PyMarshal_WriteLongToFile`
* :c:func:`PyMarshal_WriteObjectToFile`
* :c:func:`PyMarshal_ReadObjectFromString`
* :c:func:`PyMarshal_WriteObjectToString`
* the ``Py_MARSHAL_VERSION`` macro
- bpo-45412: Remove the following math macros using the ``errno`` variable:
* ``Py_ADJUST_ERANGE1()``
* ``Py_ADJUST_ERANGE2()``
* ``Py_OVERFLOWED()``
* ``Py_SET_ERANGE_IF_OVERFLOW()``
* ``Py_SET_ERRNO_ON_MATH_ERROR()``
Security
--------
- bpo-44600: Fix incorrect line numbers while tracing some failed patterns
in :ref:`match <match>` statements. Patch by Charles Burkland.
- bpo-45123: Fix PyAiter_Check to only check for the __anext__ presence (not
for __aiter__). Rename PyAiter_Check to PyAIter_Check, PyObject_GetAiter
-> PyObject_GetAIter.
- bpo-34561: List sorting now uses the merge-ordering strategy from Munro
and Wild's ``powersort()``. Unlike the former strategy, this is provably
near-optimal in the entropy of the distribution of run lengths. Most uses
of ``list.sort()`` probably won't see a significant time difference, but
may see significant improvements in cases where the former strategy was
exceptionally poor. However, as these are all fast linear-time
approximations to a problem that's inherently at best quadratic-time to
solve truly optimally, it's also possible to contrive cases where the
former strategy did better.
This means that a version tag serves as a unique identifier for the state
of a class. We rely on this for effective specialization of the LOAD_ATTR
and other instructions.
* LOAD_FAST LOAD_FAST
* STORE_FAST LOAD_FAST
* LOAD_FAST LOAD_CONST
* LOAD_CONST LOAD_FAST
* STORE_FAST STORE_FAST
* ``LOAD_METHOD_CACHED``
* ``LOAD_METHOD_MODULE``
* ``LOAD_METHOD_CLASS``
- bpo-44885: Correct the ast locations of f-strings with format specs and
repeated expressions. Patch by Pablo Galindo
- bpo-44878: Remove the loop from the bytecode interpreter. All instructions
end with a DISPATCH macro, so the loop is now redundant.
* STORE_ATTR_SLOT
* STORE_ATTR_SPLIT_KEYS
* STORE_ATTR_WITH_HINT
- bpo-44838: Fixed a bug that was causing the parser to raise an incorrect
custom :exc:`SyntaxError` for invalid 'if' expressions. Patch by Pablo
Galindo.
- bpo-44633: Parameter substitution of the union type with wrong types now
raises ``TypeError`` instead of returning ``NotImplemented``.
- bpo-44646: Fix the hash of the union type: it no longer depends on the
order of arguments.
- bpo-44636: Collapse union of equal types. E.g. the result of ``int | int``
is now ``int``. Fix comparison of the union type with non-hashable
objects. E.g. ``int | str == {}`` no longer raises a TypeError.
* BINARY_SUBSCR_LIST_INT
* BINARY_SUBSCR_TUPLE_INT
* BINARY_SUBSCR_DICT
- bpo-43950: Code objects can now provide the column information for
instructions when available. This is levaraged during traceback printing
to show the expressions responsible for errors.
- bpo-44297: Make sure that the line number is set when entering a
comprehension scope. Ensures that backtraces inclusing generator
expressions show the correct line number.
- bpo-44456: Improve the syntax error when mixing positional and keyword
patterns. Patch by Pablo Galindo.
- bpo-44313: Directly imported objects and modules (through import and from
import statements) don't generate ``LOAD_METHOD``/``CALL_METHOD`` for
directly accessed objects on their namespace. They now use the regular
``LOAD_ATTR``/``CALL_FUNCTION``.
* LOAD_GLOBAL_MODULE
* LOAD_GLOBAL_BUILTIN
- bpo-44368: Improve syntax errors for invalid "as" targets. Patch by Pablo
Galindo
- bpo-44349: Fix an edge case when displaying text from files with encoding
in syntax errors. Patch by Pablo Galindo.
* LOAD_ATTR_SLOT
* LOAD_ATTR_SPLIT_KEYS
* LOAD_ATTR_WITH_HINT
* LOAD_ATTR_MODULE
- bpo-44304: Fix a crash in the :mod:`sqlite3` module that happened when the
garbage collector clears :class:`sqlite.Statement` objects. Patch by Pablo
Galindo
- bpo-43693: A new opcode MAKE_CELL has been added that effectively moves
some of the work done on function entry into the compiler and into the
eval loop. In addition to creating the required cell objects, the new
opcode converts relevant arguments (and other locals) to cell variables on
function entry.
- bpo-44180: The parser doesn't report generic syntax errors that happen in
a position further away that the one it reached in the first pass. Patch
by Pablo Galindo
- bpo-44032: Move 'fast' locals and other variables from the frame object to
a per-thread datastack.
- bpo-43822: The parser will prioritize tokenizer errors over custom syntax
errors when raising exceptions. Patch by Pablo Galindo.
Library
-------
* ``a2b_hqx()``, ``b2a_hqx()``;
* ``rlecode_hqx()``, ``rledecode_hqx()``.
- bpo-45001: Made email date parsing more robust against malformed input,
namely a whitespace-only ``Date:`` header. Patch by Wouter Bolsterlee.
- bpo-44524: Make exception message more useful when subclass from typing
special form alias. Patch provided by Yurii Karabas.
- bpo-42378: Fixes the issue with log file being overwritten when
:class:`logging.FileHandler` is used in :mod:`atexit` with *filemode* set
to ``'w'``. Note this will cause the message in *atexit* not being logged
if the log stream is already closed due to shutdown of logging.
- bpo-44638: Add a reference to the zipp project and hint as to how to use
it.
- bpo-44539: Added support for recognizing JPEG files without JFIF or Exif
markers.
- bpo-44356: [Enum] Allow multiple data-type mixins if they are all the
same.
- bpo-44357: Added a function that returns cube root of the given number
:func:`math.cbrt`
- bpo-44242: Remove missing flag check from Enum creation and move into a
``verify`` decorator.
- bpo-44254: On Mac, give turtledemo button text a color that works on both
light or dark background. Programmers cannot control the latter.
- bpo-44077: It's now possible to receive the type of service (ToS), a.k.a.
differentiated services (DS), a.k.a. differentiated services code point
(DSCP) and explicit congestion notification (ECN) IP header fields with
``socket.IP_RECVTOS``.
- bpo-43318: Fix a bug where :mod:`pdb` does not always echo cleared
breakpoints.
* :func:`~unittest.findTestCases`
* :func:`~unittest.makeSuite`
* :func:`~unittest.getTestCaseNames`
* :meth:`unittest.TestLoader.loadTestsFromModule`
* :meth:`unittest.TestLoader.loadTestsFromTestCase`
* :meth:`unittest.TestLoader.getTestCaseNames`
Patch by Erlend E. Aasland.
- bpo-34990: Fixed a Y2k38 bug in the compileall module where it would fail
to compile files with a modification time after the year 2038.
- bpo-39359: Add one missing check that the password is a bytes object for
an encrypted zipfile.
Documentation
-------------
- bpo-44903: Removed the othergui.rst file, any references to it, and the
list of GUI frameworks in the FAQ. In their place I've added links to the
Python Wiki `page on GUI frameworks
<https://wiki.python.org/moin/GuiProgramming>`.
- bpo-13814: In the Design FAQ, answer "Why don't generators support the
with statement?"
- bpo-44392: Added a new section in the C API documentation for types used
in type hinting. Documented ``Py_GenericAlias`` and
``Py_GenericAliasType``.
- bpo-44322: Document that SyntaxError args have a details tuple and that
details are adjusted for errors in f-string field replacement expressions.
- bpo-41706: Fix docs about how methods like ``__add__`` are invoked when
evaluating operator expressions.
Tests
-----
``_test_multiprocessing._TestSharedMemory.test_shared_memory_cleaned_after_process_
termination``
- bpo-45052: ``WithProcessesTestSharedMemory.test_shared_memory_basics``
test was ignored, because ``self.assertEqual(sms.size, sms2.size)`` line
was failing. It is now removed and test is unskipped.
The main motivation for this line to be removed from the test is that the
``size`` of ``SharedMemory`` is not ever guaranteed to be the same. It is
decided by the platform.
- bpo-44895: libregrtest now clears the type cache later to reduce the risk
of false alarm when checking for reference leaks. Previously, the type
cache was cleared too early and libregrtest raised a false alarm about
reference leaks under very specific conditions. Patch by Irit Katriel and
Victor Stinner.
- bpo-44708: Regression tests, when run with -w, are now re-running only the
affected test methods instead of re-running the entire test file.
- bpo-42095: Added interop tests for Apple plists: generate plist files with
Python plistlib and parse with Apple plutil; and the other way round.
- bpo-35753: Fix crash in doctest when doctest parses modules that include
unwrappable functions by skipping those functions.
Build
-----
- bpo-45020: Freeze stdlib modules that are imported during startup. This
provides significant performance improvements to startup. If necessary,
use the previously added "-X frozen_modules=off" commandline option to
force importing the source modules.
- bpo-45188: Windows builds now regenerate frozen modules as the first part
of the build. Previously the regeneration was later in the build, which
would require it to be restarted if any modules had changed.
(https://invisible-island.net/ncurses/NEWS.html#index-t20170401). The
- bpo-44340: Add support for building with clang thin lto via
--with-lto=thin/full. Patch by Donghee Na and Brett Holman.
Windows
-------
- bpo-45375: Fixes an assertion failure due to searching for the standard
library in unnormalised paths.
macOS
-----
IDLE
----
- bpo-33962: Move the indent space setting from the Font tab to the new
Windows tab. Patch by Mark Roseman and Terry Jan Reedy.
- bpo-40468: Split the settings dialog General tab into Windows and Shell/ED
tabs. Move help sources, which extend the Help menu, to the Extensions
tab. Make space for new options and shorten the dialog. The latter makes
the dialog better fit small screens.
Tools/Demos
-----------
- bpo-44967: pydoc now returns a non-zero status code when a module cannot
be found.
C API
-----
- bpo-41103: Reverts removal of the old buffer protocol because they are
part of stable ABI.
- bpo-39947: Remove 4 private trashcan C API functions which were only kept
for the backward compatibility of the stable ABI with Python 3.8 and
older, since the trashcan API was not usable with the limited C API on
Python 3.8 and older. The trashcan API was excluded from the limited C API
in Python 3.9.
Removed functions:
* _PyTrash_deposit_object()
* _PyTrash_destroy_chain()
* _PyTrash_thread_deposit_object()
* _PyTrash_thread_destroy_chain()
The trashcan C API was never usable with the limited C API, since old
trashcan macros accessed directly :c:type:`PyThreadState` members like
``_tstate->trash_delete_nesting``, whereas the :c:type:`PyThreadState`
structure is opaque in the limited C API.
* :c:func:`!PySys_AddWarnOptionUnicode`
* :c:func:`!PySys_AddWarnOption`
* :c:func:`!PySys_AddXOption`
* :c:func:`!PySys_HasWarnOptions`
* :c:func:`!Py_SetPath`
* :c:func:`!Py_SetProgramName`
* :c:func:`!Py_SetPythonHome`
* :c:func:`!Py_SetStandardStreamEncoding`
* :c:func:`!_Py_SetProgramFullPath`
Security
--------
- bpo-43998: The :mod:`ssl` module sets more secure cipher suites defaults.
Ciphers without forward secrecy and with SHA-1 MAC are disabled by
default. Security level 2 prohibits weak RSA, DH, and ECC keys with less
than 112 bits of security. :class:`~ssl.SSLContext` defaults to minimum
protocol version TLS 1.2. Settings are based on Hynek Schlawack's
research.
- bpo-43362: Fix invalid free in _sha3 module. The issue was introduced in
3.10.0a1. Python 3.9 and earlier are not affected.
- bpo-43933: If the current position in a frame has no line number then set
the f_lineno attribute to None, instead of -1, to conform to PEP 626. This
should not normally be possible, but might occur in some unusual
circumstances.
- bpo-43892: Match patterns now use new dedicated AST nodes (``MatchValue``,
``MatchSingleton``, ``MatchSequence``, ``MatchStar``, ``MatchMapping``,
``MatchClass``) rather than reusing expression AST nodes. ``MatchAs`` and
``MatchOr`` are now defined as pattern nodes rather than as expression
nodes. Patch by Nick Coghlan.
- bpo-43846: Data stack usage is much reduced for large literal and call
expressions.
- bpo-43822: Improve syntax errors in the parser for missing commas between
expressions. Patch by Pablo Galindo.
- bpo-43760: Move the flag for checking whether tracing is enabled to the C
stack, from the heap. Should speed up dispatch in the interpreter.
Library
-------
- bpo-40443: Remove unused imports: pyclbr no longer uses copy, and typing
no longer uses ast. Patch by Victor Stinner.
- bpo-43744: fix issue with enum member name matching the start of a private
variable name
- bpo-43478: Mocks can no longer be used as the specs for other Mocks. As a
result, an already-mocked object cannot have an attribute mocked using
``autospec=True`` or be the subject of a ``create_autospec(...)`` call.
This can uncover bugs in tests since these Mock-derived Mocks will always
pass certain tests (e.g. :func:`isinstance`) and builtin assert functions
(e.g. assert_called_once_with) will unconditionally pass.
- bpo-43788: The header files for :mod:`ssl` error codes are now OpenSSL
version-specific. Exceptions will now show correct reason and library
codes. The ``make_ssl_data.py`` script has been rewritten to use OpenSSL's
text file with error codes.
- bpo-41735: Fix thread locks in zlib module may go wrong in rare case.
Patch by Ma Lin.
Documentation
-------------
Tests
-----
- bpo-43791: OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and
1.1. Tests are failing with TLSV1_ALERT_INTERNAL_ERROR.
Build
-----
Windows
-------
macOS
-----
- bpo-42119: Fix check for macOS SDK paths when building Python. Narrow
search to match contents of SDKs, namely only files in
``/System/Library``, ``/System/IOSSupport``, and ``/usr`` other than
``/usr/local``. Previously, anything under ``/System`` was assumed to be
in an SDK which causes problems with the new file system layout in 10.15+
where user file systems may appear to be mounted under ``/System``. Paths
in ``/Library`` were also incorrectly treated as SDK locations.
IDLE
----
- bpo-37903: Add mouse actions to the shell sidebar. Left click and
optional drag selects one or more lines, as with the editor line number
sidebar. Right click after selecting raises a context menu with 'copy
with prompts'. This zips together prompts from the sidebar with lines
from the selected text.
C API
-----
- bpo-28254: Add new C-API functions to control the state of the garbage
collector: :c:func:`PyGC_Enable()`, :c:func:`PyGC_Disable()`,
:c:func:`PyGC_IsEnabled()`, corresponding to the functions in the
:mod:`gc` module.
- bpo-43795: Stable ABI and limited API definitions are generated from a
central manifest (:pep:`652`).
- bpo-41064: Improve the syntax error for invalid usage of double starred
elements ('**') in f-strings. Patch by Pablo Galindo.
- bpo-39316: Tracing now has correct line numbers for attribute accesses
when the attribute is on a different line from the object. Improves
debugging and profiling for multi-line method chains.
- bpo-43410: Fix a bug that was causing the parser to crash when emitting
syntax errors when reading input from stdin. Patch by Pablo Galindo
- bpo-37448: Add a radix tree based memory map to track in-use obmalloc
arenas. Use to replace the old implementation of address_in_range(). The
radix tree approach makes it easy to increase pool sizes beyond the OS
page size. Boosting the pool and arena size allows obmalloc to handle a
significantly higher percentage of requests from its ultra-fast paths.
Library
-------
- bpo-40066: Enum: adjust ``repr()`` to show only enum and member name (not
value, nor angle brackets) and ``str()`` to show only member name. Update
and improve documentation to match.
- bpo-42994: Add MIME types for opus, AAC, 3gpp and 3gpp2
- bpo-26053: Fixed bug where the :mod:`pdb` interactive run command echoed
the args from the shell command line, even if those have been overridden
at the pdb prompt.
- bpo-24160: Fixed bug where breakpoints did not persist across multiple
debugger sessions in :mod:`pdb`'s interactive mode.
Documentation
-------------
- bpo-43199: Answer "Why is there no goto?" in the Design and History FAQ.
Build
-----
Windows
-------
IDLE
----
- bpo-42225: Document that IDLE can fail on Unix either from misconfigured
IP masquerade rules or failure displaying complex colored (non-ascii)
characters.
C API
-----
* ``PyArena_New()``
* ``PyArena_Free()``
* ``PyArena_Malloc()``
* ``PyArena_AddPyObject()``
These functions were undocumented, excluded from the limited C API, and
were only used internally by the compiler. Patch by Victor Stinner.
- bpo-43244: Remove the compiler and parser functions using ``struct _mod``
type, because the public AST C API was removed:
* ``PyAST_Compile()``
* ``PyAST_CompileEx()``
* ``PyAST_CompileObject()``
* ``PyFuture_FromAST()``
* ``PyFuture_FromASTObject()``
* ``PyParser_ASTFromFile()``
* ``PyParser_ASTFromFileObject()``
* ``PyParser_ASTFromFilename()``
* ``PyParser_ASTFromString()``
* ``PyParser_ASTFromStringObject()``
These functions were undocumented and excluded from the limited C API.
Patch by Victor Stinner.
* ``PyST_GetScope()``
* ``PySymtable_Build()``
* ``PySymtable_BuildObject()``
* ``PySymtable_Free()``
* ``Py_SymtableString()``
* ``Py_SymtableStringObject()``
Security
--------
- bpo-43149: Improve the error message in the parser for exception groups
without parentheses. Patch by Pablo Galindo.
- bpo-42217: Make the compiler merges same co_code and co_linetable objects
in a module like already did for co_consts.
Library
-------
- bpo-43317: Set the chunk size for the ``gzip`` module main function to
io.DEFAULT_BUFFER_SIZE. This is slightly faster than the 1024 bytes
constant that was used previously.
- bpo-43260: Fix TextIOWrapper can not flush internal buffer forever after
very large text is written.
- bpo-43172: The readline module now passes its tests when built directly
against libedit. Existing irreconcilable API differences remain in
:func:`readline.get_begidx` and :func:`readline.get_endidx` behavior based
on libreadline vs libedit use.
- bpo-43163: Fix a bug in :mod:`codeop` that was causing it to not ask for
more input when multi-line snippets have unclosed parentheses. Patch by
Pablo Galindo
- bpo-43102: The namedtuple __new__ method had its __builtins__ set to None
instead of an actual dictionary. This created problems for introspection
tools.
- bpo-29753: In ctypes, now packed bitfields are calculated properly and the
first item of packed bitfields is now shrank correctly.
Documentation
-------------
- bpo-27646: Clarify that 'yield from <expr>' works with any iterable, not
just iterators.
Tests
-----
Build
-----
Windows
-------
macOS
-----
IDLE
----
C API
-----
- bpo-43278: Always put compiler and system information on the first line of
the REPL welcome message.
Security
--------
- bpo-42997: Improve error message for missing ":" before blocks. Patch by
Pablo Galindo.
- bpo-42986: Fix parser crash when reporting syntax errors in f-string with
newlines. Patch by Pablo Galindo.
- bpo-40176: Syntax errors for unterminated string literals now point to the
start of the string instead of reporting EOF/EOL.
- bpo-42927: The inline cache for ``LOAD_ATTR`` now also optimizes access to
attributes defined by ``__slots__``. This makes reading such attribute up
to 30% faster.
- bpo-42864: Improve error messages in the parser when parentheses are not
closed. Patch by Pablo Galindo.
Library
-------
- bpo-42383: Fix pdb: previously pdb would fail to restart the debugging
target if it was specified using a relative path and the current directory
changed.
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
macOS
-----
IDLE
----
C API
-----
- bpo-42246: Jumps to jumps are not eliminated when it would break PEP 626.
- bpo-42246: Make sure that the ``f_lasti`` and ``f_lineno`` attributes of a
frame are set correctly when an exception is raised or re-raised. Required
for PEP 626.
- bpo-32381: The coding cookie (ex: ``# coding: latin1``) is now ignored in
the command passed to the :option:`-c` command line option. Patch by
Victor Stinner.
Library
-------
- bpo-42681: Fixed range checks for color and pair numbers in :mod:`curses`.
- bpo-31904: Fix site and sysconfig modules for VxWorks RTOS which has no
home directories.
Documentation
-------------
Tests
-----
Build
-----
- bpo-42604: Now all platforms use a value for the "EXT_SUFFIX" build
variable derived from SOABI (for instance in freeBSD, "EXT_SUFFIX" is now
".cpython-310d.so" instead of ".so"). Previously only Linux, Mac and
VxWorks were using a value for "EXT_SUFFIX" that included "SOABI".
Tools/Demos
-----------
- bpo-42613: Fix ``freeze.py`` tool to use the prope config and library
directories. Patch by Victor Stinner.
C API
-----
Security
--------
- bpo-42536: Several built-in and standard library types now ensure that
their internal result tuples are always tracked by the :term:`garbage
collector <garbage collection>`:
- :meth:`collections.OrderedDict.items() <collections.OrderedDict>`
- :meth:`dict.items`
- :func:`enumerate`
- :func:`functools.reduce`
- :func:`itertools.combinations`
- :func:`itertools.combinations_with_replacement`
- :func:`itertools.permutations`
- :func:`itertools.product`
- :func:`itertools.zip_longest`
- :func:`zip`
- bpo-42266: Fixed a bug with the LOAD_ATTR opcode cache that was not
respecting monkey-patching a class-level attribute to make it a
descriptor. Patch by Pablo Galindo.
Library
-------
- bpo-42562: Fix issue when dis failed to parse function that has no line
numbers. Patch provided by Yurii Karabas.
- bpo-41818: Updated tests for the pty library. test_basic() has been
changed to test_openpty(); this additionally checks if slave termios and
slave winsize are being set properly by pty.openpty(). In order to add
support for FreeBSD, NetBSD, OpenBSD, and Darwin, this also adds
test_master_read(), which demonstrates that pty.spawn() should not depend
on an OSError to exit from its copy loop.
- bpo-1635741: Convert _sre module types to heap types (PEP 384). Patch by
Erlend E. Aasland.
- bpo-41877: Mock objects which are not unsafe will now raise an
AttributeError if an attribute with the prefix asert, aseert, or assrt is
accessed, in addition to this already happening for the prefixes assert or
assret.
- bpo-42183: Fix a stack overflow error for asyncio Task or Future repr().
Documentation
-------------
Tests
-----
Build
-----
- bpo-42398: Fix a race condition in "make regen-all" when make -jN option
is used to run jobs in parallel. The clinic.py script now only use atomic
write to write files. Moveover, generated files are now left unchanged if
the content does not change, to not change the file modification time.
- bpo-42087: Support was removed for AIX 5.3 and below. See :issue:`40680`.
Windows
-------
- bpo-38506: The Windows launcher now properly handles Python 3.10 when
listing installed Python versions.
macOS
-----
- bpo-42504: Fix build on macOS Big Sur when MACOSX_DEPLOYMENT_TARGET=11
IDLE
----
Tools/Demos
-----------
- bpo-42212: The smelly.py script now also checks the Python dynamic library
and extension modules, not only the Python static library. Make also the
script more verbose: explain what it does.
C API
-----
Security
--------
- bpo-42103: Prevented potential DoS attack via CPU and RAM exhaustion when
processing malformed Apple Property List files in binary format.
- bpo-42218: Fixed a bug in the PEG parser that was causing crashes in debug
mode. Now errors are checked in left-recursive rules to avoid cases where
such errors do not get handled in time and appear as long-distance crashes
in other places.
- bpo-42214: Fixed a possible crash in the PEG parser when checking for the
'!=' token in the ``barry_as_flufl`` rule. Patch by Pablo Galindo.
- bpo-42150: Fix possible buffer overflow in the new parser when checking
for continuation lines. Patch by Pablo Galindo.
- bpo-42123: Run the parser two times. On the first run, disable all the
rules that only generate better error messages to gain performance. If
there's a parse failure, run the parser a second time with those enabled.
- bpo-42093: The ``LOAD_ATTR`` instruction now uses new "per opcode cache"
mechanism and it is about 36% faster now. Patch by Pablo Galindo and Yury
Selivanov.
- bpo-41894: When loading a native module and a load failure occurs, prevent
a possible UnicodeDecodeError when not running in a UTF-8 locale by
decoding the load error message using the current locale's encoding.
Library
-------
Additionally, the HTTP Only attribute is persisted in the object, and will
be correctly written to file if the MozillaCookieJar object is
subsequently dumped.
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
- bpo-38439: Updates the icons for IDLE in the Windows Store package.
macOS
-----
IDLE
----
- bpo-33987: Mostly finish using ttk widgets, mainly for editor, settings,
and searches. Some patches by Mark Roseman.
- bpo-38439: Add a 256×256 pixel IDLE icon to the Windows .ico file. Created
by Andrew Clover. Remove the low-color gif variations from the .ico file.
C API
-----
Security
--------
- bpo-41162: Audit hooks are now cleared later during finalization to avoid
missing events.
- bpo-41681: Fixes the wrong error description in the error raised by using
2 `,` in format string in f-string and :meth:`str.format`.
- bpo-41670: Prevent line trace being skipped on platforms not compiled with
``USE_COMPUTED_GOTOS``. Fixes issue where some lines nested within a
try-except block were not being traced on Windows.
- bpo-41631: The ``_ast`` module uses again a global state. Using a module
state per module instance is causing subtle practical problems. For
example, the Mercurial project replaces the ``__import__()`` function to
implement lazy import, whereas Python expected that ``import _ast`` always
return a fully initialized ``_ast`` module.
- bpo-41531: Fix a bug that was dropping keys when compiling dict literals
with more than 0xFFFF elements. Patch by Pablo Galindo.
- bpo-41428: Implement PEP 604. This supports (int | str) etc. in place of
Union[str, int].
- bpo-41094: Fix decoding errors with audit when open files with non-ASCII
names on non-UTF-8 locale.
- bpo-41084: Prefix the error message with 'f-string: ', when parsing an
f-string expression which throws a :exc:`SyntaxError`.
- bpo-40939: Remove the remaining files from the old parser and the
:mod:`symbol` module.
- bpo-40958: Fix a possible buffer overflow in the PEG parser when gathering
information for emitting syntax errors. Patch by Pablo Galindo.
- bpo-40939: Remove the old parser, the :mod:`parser` module and all
associated support code, command-line options and environment variables.
Patch by Pablo Galindo.
- bpo-40847: Fix a bug where a line with only a line continuation character
is not considered a blank line at tokenizer level. In such cases, more
than a single `NEWLINE` token was emitted. The old parser was working
around the issue, but the new parser threw a :exc:`SyntaxError` for valid
input due to this. For example, an empty line following a line
continuation character was interpreted as a :exc:`SyntaxError`.
- bpo-40904: Fix possible segfault in the new PEG parser when parsing
f-string containing yield statements with no value (:code:`f"{yield}"`).
Patch by Pablo Galindo
- bpo-40903: Fixed a possible segfault in the new PEG parser when producing
error messages for invalid assignments of the form :code:`p=p=`. Patch by
Pablo Galindo
- bpo-40880: Fix invalid memory read in the new parser when checking
newlines in string literals. Patch by Pablo Galindo.
- bpo-40883: Fix memory leak in when parsing f-strings in the new parser.
Patch by Pablo Galindo
- bpo-40750: Support the "-d" debug flag in the new PEG parser. Patch by
Pablo Galindo
- bpo-40521: Each interpreter now its has own free lists, singletons and
caches:
- bpo-26680: The int type now supports the x.is_integer() method for
compatibility with float.
Library
-------
- bpo-41816: StrEnum added: it ensures that all members are already strings
or string candidates
- bpo-39587: use the correct mix-in data type when constructing Enums
Previously there was no way to check that without using private API. See
the `relevant issue in python/typing
<https://github.com/python/typing/issues/751>`
- bpo-39017: Avoid infinite loop when reading specially crafted TAR files
using the tarfile module (CVE-2019-20907).
- bpo-41068: Fixed reading files with non-ASCII names from ZIP archive
directly after writing them.
- bpo-41056: Invalid file descriptor values are now prevented from being
passed to os.fpathconf. (discovered by Coverity)
- bpo-41056: Fix a NULL pointer dereference within the ssl module during a
MemoryError in the keylog callback. (discovered by Coverity)
- bpo-40939: Use the new PEG parser when generating the stdlib
:mod:`keyword` module.
- bpo-32604: Fix reference leak in the :mod:`select` module when the module
is imported in a subinterpreter.
- bpo-25920: On macOS, when building Python for macOS 10.4 and older, which
wasn't the case for python.org macOS installer, :func:`socket.getaddrinfo`
no longer uses an internal lock to prevent race conditions when calling
``getaddrinfo()`` which is thread-safe since macOS 10.5. Python 3.9
requires macOS 10.6 or newer. The internal lock caused random hang on fork
when another thread was calling :func:`socket.getaddrinfo`. The lock was
also used on FreeBSD older than 5.3, OpenBSD older than 201311 and NetBSD
older than 4.
- bpo-39881: PEP 554 for use in the test suite. (Patch By Joannah Nanjekye)
Documentation
-------------
Tests
-----
Build
-----
- bpo-40684: ``make install`` now uses the ``PLATLIBDIR`` variable for the
destination ``lib-dynload/`` directory when ``./configure
--with-platlibdir`` is used.
- bpo-40683: Fixed an issue where the :mod:`zoneinfo` module and its tests
were not included when Python is installed with ``make``.
Windows
-------
- bpo-41744: Fixes automatic import of props file when using the Nuget
package.
- bpo-41627: The user site directory for 32-bit now includes a ``-32``
suffix to distinguish it from the 64-bit interpreter's directory.
- bpo-41412: The installer will now fail to install on Windows 7 and Windows
8. Further, the UCRT dependency is now always downloaded on demand.
- bpo-39631: Changes the registered MIME type for ``.py`` files on Windows
to ``text/x-python`` instead of ``text/plain``.
macOS
-----
- bpo-41100: Fix configure error when building on macOS 11. Note that the
current Python release was released shortly after the first developer
preview of macOS 11 (Big Sur); there are other known issues with building
and running on the developer preview. Big Sur is expected to be fully
supported in a future bugfix release of Python 3.8.x and with 3.9.0.
- bpo-41005: fixed an XDG settings issue not allowing macos to open browser
in webbrowser.py
IDLE
----
- bpo-41468: Improve IDLE run crash error message (which users should never
see).
- bpo-41373: Save files loaded with no line ending, as when blank, or
different line endings, by setting its line ending to the system default.
Fix regression in 3.8.4 and 3.9.0b4.
- bpo-39885: Make context menu Cut and Copy work again when right-clicking
within a selection.
C API
-----
- bpo-41324: Add a minimal decimal capsule API. The API supports fast
conversions between Decimals up to 38 digits and their triple
representation as a C struct.
Security
--------
Library
-------
- bpo-37630: The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF
from OpenSSL when available.
- bpo-40457: The ssl module now support OpenSSL builds without TLS 1.0 and
1.1 methods.
- bpo-39058: In the argparse module, the repr for Namespace() and other
argument holders now displayed in the order attributes were added.
Formerly, it displayed in alphabetical order even though argument order is
preserved the user visible parts of the module.
Documentation
-------------
Tests
-----
- bpo-40436: test_gdb and test.pythoninfo now check gdb command exit code.
Build
-----
Windows
-------
macOS
-----
Tools/Demos
-----------
- bpo-40163: Fix multissltest tool. OpenSSL has changed download URL for old
releases. The multissltest tool now tries to download from current and old
download URLs.
C API
-----
* ``PyAsyncGen_ClearFreeLists()``
* ``PyContext_ClearFreeList()``
* ``PyDict_ClearFreeList()``
* ``PyFloat_ClearFreeList()``
* ``PyFrame_ClearFreeList()``
* ``PyList_ClearFreeList()``
* ``PySet_ClearFreeList()``
* ``PyTuple_ClearFreeList()``
Security
--------
- bpo-40334: Switch to a new parser, based on PEG. For more details see PEP
617. To temporarily switch back to the old parser, use ``-X oldparser`` or
``PYTHONOLDPARSER=1``. In Python 3.10 we will remove the old parser
completely, including the ``parser`` module (already deprecated) and
anything that depends on it.
- bpo-40267: Fix the tokenizer to display the correct error message, when
there is a SyntaxError on the last input character and no newline follows.
It used to be `unexpected EOF while parsing`, while it should be `invalid
syntax`.
- bpo-40082: Fix the signal handler: it now always uses the main
interpreter, rather than trying to get the current Python thread state.
Library
-------
The workaround on FreeBSD to improve performance was to load and mount the
fdescfs kernel module, but this is not enabled by default.
- bpo-40257: Improved help for the :mod:`typing` module. Docstrings are now
shown for all special forms and special generic aliases (like ``Union``
and ``List``). Using ``help()`` with generic alias like ``List[int]`` will
show the help for the correspondent concrete type (``list`` in this case).
- bpo-40091: Fix a hang at fork in the logging module: the new private
_at_fork_reinit() method is now used to reinitialize locks at fork in the
child process.
- bpo-40108: Improve the error message when triying to import a module using
:mod:`runpy` and incorrently use the ".py" extension at the end of the
module name. Patch by Pablo Galindo.
- bpo-39503: :class:`~urllib.request.AbstractBasicAuthHandler` of
:mod:`urllib.request` now parses all WWW-Authenticate HTTP headers and
accepts multiple challenges per header: use the realm of the first Basic
challenge.
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
- bpo-8901: Ignore the Windows registry when the ``-E`` option is used.
macOS
-----
IDLE
----
Tools/Demos
-----------
C API
-----
Security
--------
- bpo-19466: Clear the frames of daemon threads earlier during the Python
shutdown to call objects destructors. So "unclosed file" resource warnings
are now emitted for daemon threads in a more reliable way.
- bpo-38894: Fix a bug that was causing incomplete results when calling
``pathlib.Path.glob`` in the presence of symlinks that point to files
where the user does not have read access. Patch by Pablo Galindo and Matt
Wozniski.
Library
-------
- bpo-38662: The ``ensurepip`` module now invokes ``pip`` via the ``runpy``
module. Hence it is no longer tightly coupled with the internal API of the
bundled ``pip`` version, allowing easier updates to a newer ``pip``
version both internally and for distributors.
- bpo-39638: Keep ASDL signatures in the docstrings for ``AST`` nodes. Patch
by Batuhan Taskaya
- bpo-39509: HTTP status codes ``103 EARLY_HINTS`` and ``425 TOO_EARLY`` are
added to :class:`http.HTTPStatus`. Patch by Donghee Na.
- bpo-37534: When using minidom module to generate XML documents the ability
to add Standalone Document Declaration is added. All the changes are made
to generate a document in compliance with Extensible Markup Language (XML)
1.0 (Fifth Edition) W3C Recommendation (available here:
https://www.w3.org/TR/xml/#sec-prolog-dtd).
Documentation
-------------
Tests
-----
- bpo-40019: test_gdb now skips tests if it detects that gdb failed to read
debug information because the Python binary is optimized.
- bpo-26067: Do not fail test_shutil test_chown test when uid or gid of user
cannot be resolved to a name.
Build
-----
Windows
-------
macOS
-----
IDLE
----
- bpo-27115: For 'Go to Line', use a Query box subclass with IDLE standard
behavior and improved error checking.
- bpo-39885: Since clicking to get an IDLE context menu moves the cursor,
any text selection should be and now is cleared.
Tools/Demos
-----------
C API
-----
Extension modules without module state (``m_size <= 0``) are not affected.
- bpo-38500: Add a private API to get and set the frame evaluation function:
add :c:func:`_PyInterpreterState_GetEvalFrameFunc` and
:c:func:`_PyInterpreterState_SetEvalFrameFunc` C functions. The
:c:type:`_PyFrameEvalFunction` function type now takes a *tstate*
parameter.
Security
--------
- bpo-39492: Fix a reference cycle in the C Pickler that was preventing the
garbage collection of deleted, pickled objects.
- bpo-39320: Replace two complex bytecodes for building dicts with two
simpler ones. The new bytecodes ``DICT_MERGE`` and ``DICT_UPDATE`` have
been added The old bytecodes ``BUILD_MAP_UNPACK`` and
``BUILD_MAP_UNPACK_WITH_CALL`` have been removed.
- bpo-39219: Syntax errors raised in the tokenizer now always set correct
"text" and "offset" attributes.
Library
-------
Documentation
-------------
- bpo-39392: Explain that when filling with turtle, overlap regions may be
left unfilled.
- bpo-39369: Update mmap readline method description. The fact that the
readline method does update the file position should not be ignored since
this might give the impression for the programmer that it doesn't update
it.
Tests
-----
Build
-----
Windows
-------
- bpo-39393: Improve the error message when attempting to load a DLL with
unresolved dependencies.
- bpo-38883: :meth:`~pathlib.Path.home()` and
:meth:`~pathlib.Path.expanduser()` on Windows now prefer
:envvar:`USERPROFILE` and no longer use :envvar:`HOME`, which is not
normally set for regular user accounts. This makes them again behave like
:func:`os.path.expanduser`, which was changed to ignore :envvar:`HOME` in
3.8, see :issue:`36264`.
IDLE
----
- bpo-30780: Add remaining configdialog tests for buttons and highlights and
keys tabs.
C API
-----
- bpo-38076: Fix to clear the interpreter state only after clearing module
globals to guarantee module state access from C Extensions during runtime
destruction
- bpo-39245: The Vectorcall API (PEP 590) was made public, adding the
functions ``PyObject_Vectorcall``, ``PyObject_VectorcallMethod``,
``PyVectorcall_Function``, ``PyObject_CallOneArg``,
``PyObject_CallMethodNoArgs``, ``PyObject_CallMethodOneArg``,
``PyObject_FastCallDict``, and the flag ``Py_TPFLAGS_HAVE_VECTORCALL``.
- bpo-39421: Fix possible crashes when operating with the functions in the
:mod:`heapq` module and custom comparison operators.
* BUILD_LIST_UNPACK
* BUILD_TUPLE_UNPACK
* BUILD_SET_UNPACK
* BUILD_TUPLE_UNPACK_WITH_CALL
* LIST_TO_TUPLE
* LIST_EXTEND
* SET_UPDATE
- bpo-39336: Import loaders which publish immutable module objects can now
publish immutable packages in addition to individual modules.
- bpo-39322: Added a new function :func:`gc.is_finalized` to check if an
object has been finalized by the garbage collector. Patch by Pablo
Galindo.
- bpo-39048: 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.
- bpo-39235: Fix AST end location for lone generator expression in function
call, e.g. f(i for i in a).
This improves the clarity of the interpreter and should provide a modest
speedup.
Library
-------
- bpo-39191: 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.
- bpo-38871: Correctly parenthesize filter-based statements that contain
lambda expressions in mod:`lib2to3`. Patch by Donghee Na.
- bpo-38473: Use signature from inner mock for autospecced methods attached
with :func:`unittest.mock.attach_mock`. Patch by Karthikeyan Singaravelan.
Documentation
-------------
Build
-----
- bpo-39144: The ctags and etags build targets both include Modules/_ctypes
and Python standard library source files.
IDLE
----
- bpo-34118: Tag memoryview, range, and tuple as classes, the same as list,
etcetera, in the library manual built-in functions list.
C API
-----
Security
--------
- 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-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-38852: Set the thread stack size to 8 Mb for debug builds on android
platforms.
- 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`` and ``NSMALLPOSINTS`` macros: macros should now be
modified manually in ``pycore_pystate.h`` header file.
- bpo-27145: int + int and int - int operators can now return small integer
singletons. Patch by hongweipeng.
- bpo-38021: Provide a platform tag for AIX that is sufficient for PEP425
binary distribution identification. Patch by Michael Felt.
Library
-------
- bpo-39033: Fix :exc:`NameError` in :mod:`zipimport`. Patch by Karthikeyan
Singaravelan.
- bpo-39006: Fix asyncio when the ssl module is missing: only check for
ssl.SSLSocket instance if the ssl module is available.
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-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.
Documentation
-------------
Tests
-----
- 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-38991: :mod:`test.support`:
:func:`~test.support.run_python_until_end`,
:func:`~test.support.assert_python_ok` and
:func:`~test.support.assert_python_failure` functions no longer strip
whitespaces from stderr. Remove ``test.support.strip_python_stderr()``
function.
- bpo-38875: test_capi: trashcan tests now require the test "cpu" resource.
Build
-----
Windows
-------
- bpo-33125: Add support for building and releasing Windows ARM64 packages.
macOS
-----
IDLE
----
- bpo-38944: Escape key now closes IDLE completion windows. Patch by Johnny
Najera.
- 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
-----
Security
--------
- bpo-37363: Adds audit events for the range of supported run commands (see
:ref:`using-on-general`).
- bpo-34155: Fix parsing of invalid email addresses with more than one ``@``
(e.g. a@b@c.com.) to not return the part before 2nd ``@`` as valid email
address. Patch by maxking & jpic.
- bpo-38640: Fixed a bug in the compiler that was causing to raise in the
presence of break statements and continue statements inside always false
while loops. Patch by Pablo Galindo.
- bpo-38613: Optimized some set operations (e.g. ``|``, ``^``, and ``-``) of
``dict_keys``. ``d.keys() | other`` was slower than ``set(d) | other`` but
they are almost same performance for now.
- bpo-38535: Fixed line numbers and column offsets for AST nodes for calls
without arguments in decorators.
- bpo-38469: Fixed a bug where the scope of named expressions was not being
resolved correctly in the presence of the *global* keyword. Patch by Pablo
Galindo.
- bpo-38006: Fix a bug due to the interaction of weakrefs and the cyclic
garbage collector. We must clear any weakrefs in garbage in order to
prevent their callbacks from executing and causing a crash.
- bpo-38116: The select module is now PEP-384 compliant and no longer has
static state
- bpo-8425: Optimize set difference_update for the case when the other set
is much larger than the base set. (Suggested by Evgeny Kapun with code
contributed by Michele Orrù).
- bpo-36311: Decoding bytes objects larger than 2GiB is faster and no longer
fails when a multibyte characters spans a chunk boundary.
- bpo-37348: Optimized decoding short ASCII string with UTF-8 and ascii
codecs. ``b"foo".decode()`` is about 15% faster. Patch by Inada Naoki.
- bpo-20443: Python now gets the absolute path of the script filename
specified on the command line (ex: "python3 script.py"): the __file__
attribute of the __main__ module and sys.path[0] become an absolute path,
rather than a relative path.
Library
-------
- bpo-38786: pydoc now recognizes and parses HTTPS URLs. Patch by python273.
- bpo-27805: Allow opening pipes and other non-seekable files in append mode
with :func:`open`.
- bpo-36321: Remove misspelled attribute. The 3.8 changelog noted that this
would be removed in 3.9.
- bpo-38417: Added support for setting the umask in the child process to the
subprocess module on POSIX systems.
- bpo-38163: Child mocks will now detect their type as either synchronous or
asynchronous, asynchronous child mocks will be AsyncMocks and synchronous
child mocks will be either MagicMock or Mock (depending on their parent
type).
- bpo-38216: Allow the rare code that wants to send invalid http requests
from the `http.client` library a way to do so. The fixes for bpo-30458
led to breakage for some projects that were relying on this ability to
test their own behavior in the face of bad requests.
- bpo-38237: The arguments for the builtin pow function are more
descriptive. They can now also be passed in as keywords.
- bpo-10978: Semaphores and BoundedSemaphores can now release more than one
waiting thread at a time.
call().foo().__getitem__('bar')
Patch by blhsing
- bpo-37810: Fix :mod:`difflib` ``?`` hint in diff output when dealing with
tabs. Patch by Anthony Sottile.
- bpo-37742: The logging.getLogger() API now returns the root logger when
passed the name 'root', whereas previously it returned a non-root logger
named 'root'. This could affect cases where user code explicitly wants a
non-root logger named 'root', or instantiates a logger using
logging.getLogger(__name__) in some top-level module called 'root.py'.
- bpo-37664: Update wheels bundled with ensurepip (pip 19.2.3 and setuptools
41.2.0)
- bpo-29446: Make `from tkinter import *` import only the expected objects.
- bpo-36993: Improve error reporting for corrupt zip files with bad zip64
extra data. Patch by Daniel Hillier.
- bpo-37394: Fix a bug that was causing the :mod:`queue` module to fail if
the accelerator module was not available. Patch by Pablo Galindo.
- bpo-37345: Add formal support for UDPLITE sockets. Support was present
before, but it is now easier to detect support with ``hasattr(socket,
'IPPROTO_UDPLITE')`` and there are constants defined for each of the
values needed: :py:obj:`socket.IPPROTO_UDPLITE`,
:py:obj:`UDPLITE_SEND_CSCOV`, and :py:obj:`UDPLITE_RECV_CSCOV`. Patch by
Gabe Appleton.
- bpo-37347: :meth:`sqlite3.Connection.create_aggregate`,
:meth:`sqlite3.Connection.create_function`,
:meth:`sqlite3.Connection.set_authorizer`,
:meth:`sqlite3.Connection.set_progress_handler`
:meth:`sqlite3.Connection.set_trace_callback` methods lead to segfaults if
some of these methods are called twice with an equal object but not the
same. Now callbacks are stored more carefully. Patch by Aleksandr Balezin.
- bpo-37280: Use threadpool for reading from file for sendfile fallback
mode.
- bpo-37279: Fix asyncio sendfile support when sendfile sends extra data in
fallback mode.
- bpo-37178: For math.perm(n, k), let k default to n, giving the same result
as factorial.
- bpo-36520: Lengthy email headers with UTF-8 characters are now properly
encoded when they are folded. Patch by Jeffrey Kintscher.
- bpo-30835: Fixed a bug in email parsing where a message with invalid bytes
in content-transfer-encoding of a multipart message can cause an
AttributeError. Patch by Andrew Donnellan.
- bpo-36564: Fix infinite loop in email header folding logic that would be
triggered when an email policy's max_line_length is not long enough to
include the required markup and any values in the message. Patch by Paul
Ganssle
- bpo-36302: distutils sorts source file lists so that Extension .so files
build more reproducibly by default
- bpo-8538: Add support for boolean actions like ``--foo`` and ``--no-foo``
to argparse. Patch contributed by Rémi Lapeyre.
- bpo-33348: lib2to3 now recognizes expressions after ``*`` and `**` like in
``f(*[] or [])``.
Documentation
-------------
- bpo-37149: Replace the dead link to the Tkinter 8.5 reference by John
Shipman, New Mexico Tech, with a link to the archive.org copy.
- bpo-36487: Make C-API docs clear about what the "main" interpreter is.
- bpo-23460: The documentation for decimal string formatting using the `:g`
specifier has been updated to reflect the correct exponential notation
cutoff point. Original patch contributed by Tuomas Suutari.
- bpo-33944: Added a note about the intended use of code in .pth files.
Tests
-----
- bpo-38271: The private keys for test_ssl were encrypted with 3DES in
traditional PKCS#5 format. 3DES and the digest algorithm of PKCS#5 are
blocked by some strict crypto policies. Use PKCS#8 format with AES256
encryption instead.
- bpo-38270: test.support now has a helper function to check for
availability of a hash digest function. Several tests are refactored avoid
MD5 and use SHA256 instead. Other tests are marked to use MD5 and skipped
when MD5 is disabled.
- bpo-34001: Make test_ssl pass with LibreSSL. LibreSSL handles minimum and
maximum TLS version differently than OpenSSL.
Build
-----
- bpo-38809: On Windows, build scripts will now recognize and use python.exe
from an active virtual env.
- bpo-37415: Fix stdatomic.h header check for ICC compiler: the ICC
implementation lacks atomic_uintptr_t type which is needed by Python.
- bpo-37725: Change "clean" makefile target to also clean the program guided
optimization (PGO) data. Previously you would have to use "make clean"
and "make profile-removal", or "make clobber".
- bpo-37707: Mark some individual tests to skip when --pgo is used. The
tests marked increase the PGO task time significantly and likely don't
help improve optimization of the final executable.
- bpo-36044: Reduce the number of unit tests run for the PGO generation
task. This speeds up the task by a factor of about 15x. Running the full
unit test suite is slow. This change may result in a slightly less
optimized build since not as many code branches will be executed. If you
are willing to wait for the much slower build, the old behavior can be
restored using './configure [..] PROFILE_TASK="-m test --pgo-extended"'.
We make no guarantees as to which PGO task set produces a faster build.
Users who care should run their own relevant benchmarks as results can
depend on the environment, workload, and compiler tool chain.
patch by M Felt
Windows
-------
- bpo-38519: Restores the internal C headers that were missing from the
nuget.org and Microsoft Store packages.
- bpo-32592: Set Windows 8 as the minimum required version for API support
- bpo-36634: venv activate.bat now works when the existing variables contain
double quote characters.
- bpo-38088: Fixes distutils not finding vcruntime140.dll with only the v142
toolset installed.
- bpo-36266: Add the module name in the formatted error message when DLL
load fail happens during module import in
``_PyImport_FindSharedFuncptrWindows()``. Patch by Srinivas Nyayapati.
- bpo-37778: Fixes the icons used for file associations to the Microsoft
Store package.
macOS
-----
- bpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests
optional
- bpo-18049: Increase the default stack size of threads from 5MB to 16MB on
macOS, to match the stack size of the main thread. This avoids crashes on
deep recursion in threads.
IDLE
----
- bpo-4630: Add an option to toggle IDLE's cursor blink for shell, editor,
and output windows. See Settings, General, Window Preferences, Cursor
Blink. Patch by Zackery Spytz.
- bpo-35379: When exiting IDLE, catch any AttributeError. One happens when
EditorWindow.close is called twice. Printing a traceback, when IDLE is
run from a terminal, is useless and annoying.
- bpo-38041: Shell restart lines now fill the window width, always start
with '=', and avoid wrapping unnecessarily. The line will still wrap if
the included file name is long relative to the width.
- bpo-37929: IDLE Settings dialog now closes properly when there is no shell
window.
- bpo-37902: Add mousewheel scrolling for IDLE module, path, and stack
browsers. Patch by George Zhang.
- bpo-37849: Fixed completions list appearing too high or low when shown
above the current line.
- bpo-37748: Reorder the Run menu. Put the most common choice, Run Module,
at the top.
- bpo-37627: Initialize the Customize Run dialog with the command line
arguments most recently entered before. The user can optionally edit
before submitting them.
- bpo-33610: Fix code context not showing the correct context when first
toggled on.
- bpo-37325: Fix tab focus traversal order for help source and custom run
dialogs.
- bpo-26806: To compensate for stack frames added by IDLE and avoid possible
problems with low recursion limits, add 30 to limits in the user code
execution process. Subtract 30 when reporting recursion limits to make
this addition mostly transparent.
- bpo-5680: Add 'Run... Customized' to the Run menu to run a module with
customized settings. Any 'command line arguments' entered are added to
sys.argv. One can suppress the normal Shell main module restart.
Tools/Demos
-----------
- bpo-38347: pathfix.py: Assume all files that end on '.py' are Python
scripts when working recursively.
- bpo-37675: 2to3 now works when run from a zipped standard library.
- bpo-37034: Argument Clinic now uses the argument name on errors with
keyword-only argument instead of their position. Patch contributed by Rémi
Lapeyre.
C API
-----
- bpo-38140: Make dict and weakref offsets opaque for C heap types by
passing the offsets through PyMemberDef
- bpo-37879: Fix subtype_dealloc to suppress the type decref when the base
type is a C heap type
- bpo-37540: The vectorcall protocol now requires that the caller passes
only strings as keyword names.
- bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API.
Security
--------
- bpo-35907: CVE-2019-9948: Avoid file reading by disallowing
``local-file://`` and ``local_file://`` URL schemes in
``URLopener().open()`` and ``URLopener().retrieve()`` of
:mod:`urllib.request`.
- bpo-37126: All structseq objects are now tracked by the garbage collector.
Patch by Pablo Galindo.
- bpo-37029: Freeing a great many small objects could take time quadratic in
the number of arenas, due to using linear search to keep ``obmalloc.c``'s
list of usable arenas sorted by order of number of free memory pools.
This is accomplished without search now, leaving the worst-case time
linear in the number of arenas. For programs where this quite visibly
matters (typically with more than 100 thousand small objects alive
simultaneously), this can greatly reduce the time needed to release their
memory.
- bpo-37050: Improve the AST for "debug" f-strings, which use '=' to print
out the source of the expression being evaluated. Delete expr_text from
the FormattedValue node, and instead use a Constant string node (possibly
merged with adjacent constant expressions inside the f-string).
- bpo-22385: The `bytes.hex`, `bytearray.hex`, and `memoryview.hex` methods
as well as the `binascii.hexlify` and `b2a_hex` functions now have the
ability to include an optional separator between hex bytes. This
functionality was inspired by MicroPython's hexlify implementation.
- bpo-36878: Only accept text after `# type: ignore` if the first character
is ASCII. This is to disallow things like `# type: ignoreé`.
- bpo-36817: Add a ``=`` feature f-strings for debugging. This can precede
``!s``, ``!r``, or ``!a``. It produces the text of the expression,
followed by an equal sign, followed by the repr of the value of the
expression. So ``f'{3*9+15=}'`` would be equal to the string
``'3*9+15=42'``. If ``=`` is specified, the default conversion is set to
``!r``, unless a format spec is given, in which case the formatting
behavior is unchanged, and __format__ will be used.
Library
-------
- bpo-26835: The fcntl module now contains file sealing constants for
sealing of memfds.
This will address the common mistake many asyncio users make: an "except
Exception" clause breaking Tasks cancellation.
- bpo-37008: Add support for calling :func:`next` with the mock resulting
from :func:`unittest.mock.mock_open`
- bpo-36969: PDB command `args` now display keyword only arguments. Patch
contributed by Rémi Lapeyre.
- bpo-36888: Python child processes can now access the status of their
parent process using multiprocessing.process.parent_process
- bpo-36802: Provide both sync and async calls for StreamWriter.write() and
StreamWriter.close()
- bpo-36801: Properly handle SSL connection closing in asyncio
StreamWriter.drain() call.
- bpo-35900: Allow reduction methods to return a 6-item tuple where the 6th
item specifies a custom state-setting method that's called instead of the
regular ``__setstate__`` method.
- bpo-26707: Enable plistlib to read and write binary plist files that were
created as a KeyedArchive file. Specifically, this allows the plistlib to
process 0x80 tokens as UID objects.
- bpo-34271: Add debugging helpers to ssl module. It's now possible to dump
key material and to trace TLS protocol. The default and stdlib contexts
also support SSLKEYLOGFILE env var.
- bpo-31922: :meth:`asyncio.AbstractEventLoop.create_datagram_endpoint`: Do
not connect UDP socket when broadcast is allowed. This allows to receive
replies after a UDP broadcast.
- bpo-22102: Added support for ZIP files with disks set to 0. Such files are
commonly created by builtin tools on Windows when use ZIP64 extension.
Patch by Francisco Facioni.
- bpo-32515: trace.py can now run modules via python3 -m trace -t --module
module_name
Documentation
-------------
Add a few tests to verify that the various values passed to the std*
arguments actually work.
Tests
-----
- bpo-36915: The main regrtest process now always removes all temporary
directories of worker processes even if they crash or if they are killed
on KeyboardInterrupt (CTRL+c).
- bpo-36719: "python3 -m test -jN ..." now continues the execution of next
tests when a worker process crash (CHILD_ERROR state). Previously, the
test suite stopped immediately. Use --failfast to stop at the first error.
- bpo-35925: Skip httplib and nntplib networking tests when they would
otherwise fail due to a modern OS or distro with a default OpenSSL policy
of rejecting connections to servers with weak certificates.
Windows
-------
- bpo-29883: Add Windows support for UDP transports for the Proactor Event
Loop. Patch by Adam Meily.
macOS
-----
IDLE
----
- bpo-36958: Print any argument other than None or int passed to SystemExit
or sys.exit().
- bpo-36807: When saving a file, call os.fsync() so bits are flushed to e.g.
USB drive.
- bpo-32411: In browser.py, remove extraneous sorting by line number since
dictionary was created in line number order.
Tools/Demos
-----------
C API
-----
- bpo-36379: Fix crashes when attempting to use the *modulo* parameter when
``__ipow__`` is implemented in C.
Security
--------
- bpo-36722: In debug build, import now also looks for C extensions compiled
in release mode and for C extensions compiled in the stable ABI.
- bpo-20844: Fix running script with encoding cookie and LF line ending may
fail on Windows.
Library
-------
- bpo-36598: Fix ``isinstance`` check for Mock objects with spec when the
code is executed under tracing. Patch by Karthikeyan Singaravelan.
- bpo-36559: The random module now prefers the lean internal _sha512 module
over hashlib for seed(version=2) to optimize import time.
- bpo-36232: Improve error message when trying to open existing DBM database
that actually doesn't exist. Patch by Marco Rougeth.
- bpo-36385: Stop rejecting IPv4 octets for being ambiguously octal. Leading
zeros are ignored, and no longer are assumed to specify octal octets.
Octets are always decimal numbers. Octets must still be no more than three
digits, including leading zeroes.
- bpo-31904: Add time module support and fix test_time faiures for VxWorks.
Documentation
-------------
Tests
-----
- bpo-36560: Fix reference leak hunting in regrtest: compute also deltas (of
reference count, allocated memory blocks, file descriptor count) during
warmup, to ensure that everything is initialized before starting to hunt
reference leaks.
- bpo-36341: Fix tests that may fail with PermissionError upon calling
bind() on AF_UNIX sockets.
Build
-----
- bpo-36465: Release builds and debug builds are now ABI compatible:
defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS``
macro, which introduces the only ABI incompatibility. The
``Py_TRACE_REFS`` macro, which adds the :func:`sys.getobjects` function
and the :envvar:`PYTHONDUMPREFS` environment variable, can be set using
the new ``./configure --with-trace-refs`` build option.
Windows
-------
- bpo-36649: Remove trailing spaces for registry keys when installed via the
Store.
- bpo-36509: Added preset-iot layout for Windows IoT ARM containers. This
layout doesn't contain UI components like tkinter or IDLE. It also doesn't
contain files to support on-target builds since Windows ARM32 builds must
be cross-compiled when using MSVC.
- bpo-36010: Add the venv standard library module to the nuget distribution
for Windows.
- bpo-34060: Report system load when running test suite on Windows. Patch by
Ammar Askar. Based on prior work by Jeremy Kloth.
- bpo-31512: With the Windows 10 Creators Update, non-elevated users can now
create symlinks as long as the computer has Developer Mode enabled.
macOS
-----
IDLE
----
Tools/Demos
-----------
C API
-----
Security
--------
- bpo-36256: Fix bug in parsermodule when parsing a state in a DFA that has
two or more arcs with labels of the same type. Patch by Pablo Galindo.
- bpo-36332: The builtin :func:`compile` can now handle AST objects that
contain assignment expressions. Patch by Pablo Galindo.
- bpo-30040: New empty dict uses fewer memory for now. It used more memory
than empty dict created by ``dict.clear()``. And empty dict creation and
deletion is about 2x faster. Patch by Inada Naoki.
- bpo-35808: Retire pgen and use a modified version of pgen2 to generate the
parser. Patch by Pablo Galindo.
Library
-------
- bpo-36268: Switch the default format used for writing tars with
mod:`tarfile` to the modern POSIX.1-2001 pax standard, from the
vendor-specific GNU. Contributed by C.A.M. Gerlach.
- bpo-36285: Fix integer overflows in the array module. Patch by Stephan
Hohe.
- bpo-36251: Fix format strings used for stderrprinter and re.Match reprs.
Patch by Stephan Hohe.
- bpo-35899: Enum has been fixed to correctly handle empty strings and
strings with non-Latin characters (ie. 'α', ' )'אwithout crashing.
Original patch contributed by Maxwell. Assisted by Stéphane Wirtel.
- bpo-21269: Add ``args`` and ``kwargs`` properties to mock call objects.
Contributed by Kumar Akshay.
- bpo-35121: Don't set cookie for a request when the request path is a
prefix match of the cookie's path attribute but doesn't end with "/".
Patch by Karthikeyan Singaravelan.
Documentation
-------------
- bpo-36329: Declare the path of the Python binary for the usage of
``Tools/scripts/serve.py`` when executing ``make -C Doc/ serve``.
Contributed by Stéphane Wirtel
- bpo-21314: A new entry was added to the Core Language Section of the
Programming FAQ, which explaines the usage of slash(/) in the signature of
a function. Patch by Lysandros Nikolaou
Tests
-----
Build
-----
- bpo-36356: Fix leaks that led to build failure when configured with
address sanitizer.
Windows
-------
- bpo-36312: Fixed decoders for the following code pages: 50220, 50221,
50222, 50225, 50227, 50229, 57002 through 57011, 65000 and 42.
IDLE
----
- bpo-36176: Fix IDLE autocomplete & calltip popup colors. Prevent conflicts
with Linux dark themes (and slightly darken calltip background).
- bpo-23205: For the grep module, add tests for findfiles, refactor
findfiles to be a module-level function, and refactor findfiles to use
os.walk.
- bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. Patch
by Kevin Walzer.
Tools/Demos
-----------
- bpo-35132: Fix py-list and py-bt commands of python-gdb.py on gdb7.
C API
-----
- bpo-35942: The error message emitted when returning invalid types from
``__fspath__`` in interfaces that allow passing :class:`~os.PathLike`
objects has been improved and now it does explain the origin of the error.
- bpo-15248: The compiler emits now syntax warnings in the case when a comma
is likely missed before tuple or list.
Library
-------
Documentation
-------------
Tests
-----
- bpo-36037: Fix test_ssl for strict OpenSSL configuration like RHEL8 strict
crypto policy. Use older TLS version for minimum TLS version of the server
SSL context if needed, to test TLS version older than default minimum TLS
version.
Windows
-------
- bpo-35872: Uses the base Python executable when invoking venv in a virtual
environment
IDLE
----
- bpo-35833: Revise IDLE doc for control codes sent to Shell. Add a code
example block.
Security
--------
- bpo-35746: [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-28414: The ssl module now allows users to perform their own IDN
en/decoding when using SNI.
- 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](https://github.com/python/typed_ast).
- bpo-33416: Add end line and end column position information to the Python
AST nodes. This is a C-level backwards incompatible change.
- bpo-35623: Fix a crash when sorting very long lists. Patch by Stephan
Hohe.
- 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-35372: Fixed the code page decoder for input longer than 2 GiB
containing undecodable bytes.
- 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-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-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-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: The UTF-8 Mode is now also enabled by the "POSIX" locale, not
only by the "C" locale.
- bpo-34523: The Python filesystem encoding is now read earlier during the
Python initialization.
- bpo-34113: Fixed crash on debug builds when opcode stack was adjusted with
negative numbers. Patch by Constantin Petrisor.
- bpo-34149: Fix min and max functions to get default behavior when key is
None.
- bpo-34141: Optimized pickling atomic types (None, bool, int, float, bytes,
str).
- bpo-24618: Fixed reading invalid memory when create the code object with
too small varnames tuple or too large argument counts.
- 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-33738: Seven macro incompatibilities with the Limited API were fixed,
and the macros :c:func:`PyIter_Check`, :c:func:`PyIndex_Check` and
:c:func:`PyExceptionClass_Name` were added as functions. A script for
automatic macro checks was added.
- bpo-33622: Fixed a leak when the garbage collector fails to add an object
with the ``__del__`` method or referenced by it into the
:data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
exception is set and preserves it.
- bpo-33462: Make dict and dict views reversible. Patch by Rémi Lapeyre.
- bpo-23722: A :exc:`RuntimeError` is now raised when the custom metaclass
doesn't provide the ``__classcell__`` entry in the namespace passed to
``type.__new__``. A :exc:`DeprecationWarning` was emitted in Python
3.6--3.7.
- bpo-33234: The list constructor will pre-size and not over-allocate when
the input length is known.
- bpo-33270: Intern the names for all anonymous code objects. Patch by
Zackery Spytz.
- bpo-30455: The C and Python code and the documentation related to tokens
are now generated from a single source file :file:`Grammar/Tokens`.
- bpo-33005: Fix a crash on fork when using a custom memory allocator (ex:
using PYTHONMALLOC env var). _PyGILState_Reinit() and
_PyInterpreterState_Enable() now use the default RAW memory allocator to
allocate a new interpreters mutex on fork.
- bpo-32946: Importing names from already imported module with "from ...
import ..." is now 30% faster if the module is not a package.
- bpo-32932: Make error message more revealing when there are non-str
objects in ``__all__``.
Library
-------
- bpo-35717: Fix KeyError exception raised when using enums and compile.
Patch contributed by Rémi Lapeyre.
- bpo-28503: The `crypt` module now internally uses the `crypt_r()` library
function instead of `crypt()` when available.
- bpo-35588: The floor division and modulo operations and the :func:`divmod`
function on :class:`fractions.Fraction` types are 2--4x faster. Patch by
Stefan Behnel.
- bpo-35513: :class:`~unittest.runner.TextTestRunner` of
:mod:`unittest.runner` now uses :func:`time.perf_counter` rather than
:func:`time.time` to measure the execution time of a test:
:func:`time.time` can go backwards, whereas :func:`time.perf_counter` is
monotonic.
- bpo-31446: Copy command line that was passed to CreateProcessW since this
function can change the content of the input buffer.
- bpo-35471: Python 2.4 dropped MacOS 9 support. The macpath module was
deprecated in Python 3.7. The module is now removed.
- bpo-35186: Removed the "built with" comment added when ``setup.py upload``
is used with either ``bdist_rpm`` or ``bdist_dumb``.
- bpo-34794: Fixed a leak in Tkinter when pass the Python wrapper around
Tcl_Obj back to Tcl/Tk.
- bpo-23420: Verify the value for the parameter '-s' of the cProfile CLI.
Patch by Robert Kuska
- bpo-34969: gzip: Add --fast, --best on the gzip CLI, these parameters will
be used for the fast compression method (quick) or the best method
compress (slower, but smaller file). Also, change the default compression
level to 6 (tradeoff).
- bpo-34769: Fix for async generators not finalizing when event loop is in
debug mode and garbage collector runs in another thread.
- bpo-34925: 25% speedup in argument parsing for the functions in the bisect
module.
- bpo-34738: ZIP files created by ``distutils`` will now include entries for
directories.
- bpo-32718: The Activate.ps1 script from venv works with PowerShell Core
6.1 and is now available under all operating systems.
- bpo-6721: Acquire the logging module's commonly used internal locks while
fork()ing to avoid deadlocks in the child process.
- bpo-34341: Appending to the ZIP archive with the ZIP64 extension no longer
grows the size of extra fields of existing entries.
- bpo-34318: :func:`~unittest.TestCase.assertRaises`,
:func:`~unittest.TestCase.assertRaisesRegex`,
:func:`~unittest.TestCase.assertWarns` and
:func:`~unittest.TestCase.assertWarnsRegex` no longer success if the
passed callable is None. They no longer ignore unknown keyword arguments
in the context manager mode. A DeprecationWarning was raised in these
cases since Python 3.5.
- bpo-34248: Report filename in the exception raised when the database file
cannot be opened by :func:`dbm.gnu.open` and :func:`dbm.ndbm.open` due to
OS-related error. Patch by Zsolt Cserna.
- bpo-34270: The default asyncio task class now always has a name which can
be get or set using two new methods (:meth:`~asyncio.Task.get_name()` and
:meth:`~asyncio.Task.set_name`) and is visible in the :func:`repr` output.
An initial name can also be set using the new ``name`` keyword argument to
:func:`asyncio.create_task` or the
:meth:`~asyncio.AbstractEventLoop.create_task` method of the event loop.
If no initial name is set, the default Task implementation generates a
name like ``Task-1`` using a monotonic counter.
- bpo-34263: asyncio's event loop will not pass timeouts longer than one day
to epoll/select etc.
- bpo-34052: :meth:`sqlite3.Connection.create_aggregate`,
:meth:`sqlite3.Connection.create_function`,
:meth:`sqlite3.Connection.set_authorizer`,
:meth:`sqlite3.Connection.set_progress_handler` methods raises TypeError
when unhashable objects are passed as callable. These methods now don't
pass such objects to SQLite API. Previous behavior could lead to
segfaults. Patch by Sergey Fedoseev.
- bpo-34097: ZipFile can zip files older than 1980-01-01 and newer than
2107-12-31 using a new ``strict_timestamps`` parameter at the cost of
setting the timestamp to the limit.
- bpo-34070: Make sure to only check if the handle is a tty, when opening a
file with ``buffering=-1``.
- bpo-11874: Use a better regex when breaking usage into wrappable parts.
Avoids bogus assertion errors from custom metavar strings.
- bpo-33604: Remove HMAC default to md5 marked for removal in 3.8 (removal
originally planned in 3.6, bump to 3.8 in PR 7062).
- bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with
OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers
enabled by default.
- bpo-33365: Print the header values besides the header keys instead just
the header keys if *debuglevel* is set to >0 in :mod:`http.client`. Patch
by Marco Strigl.
- bpo-33311: Text and html output generated by cgitb does not display
parentheses if the current call is done directly in the module. Patch by
Stéphane Blondon.
- bpo-33375: The warnings module now finds the Python file associated with a
warning from the code object, rather than the frame's global namespace.
This is consistent with how tracebacks and pdb find filenames, and should
work better for dynamically executed code.
- bpo-32968: Modulo and floor division involving Fraction and float should
return float.
- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch
by Nir Soffer.
- bpo-22674: Add the strsignal() function in the signal module that returns
the system description of the given signal, as returned by strsignal(3).
- bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls,
subclass)`` crashed when ``subclass`` is not a type object.
- bpo-32929: Remove the tri-state parameter "hash", and add the boolean
"unsafe_hash". If unsafe_hash 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-30622: The ssl module now detects missing NPN support in LibreSSL.
- 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".
Note that the new implementation hides internal registry and caches,
previously accessible via private attributes ``_abc_registry``,
``_abc_cache``, and ``_abc_negative_cache``. There are three debugging
helper methods that can be used instead ``_dump_registry``,
``_abc_registry_clear``, and ``_abc_caches_clear``.
- bpo-32622: Implement native fast sendfile for Windows proactor event loop.
- bpo-32727: Do not include name field in SMTP envelope from address. Patch
by Stéphane Wirtel
Documentation
-------------
- bpo-35042: Replace PEP XYZ by the pep role and allow to use the direct
links to the PEPs.
- bpo-35044: Fix the documentation with the role ``exc`` for the
appropriated exception. Patch by Stéphane Wirtel
- bpo-34913: Add documentation about the new command line interface of the
gzip module.
- bpo-28617: Fixed info in the stdtypes docs concerning the types that
support membership tests.
- bpo-17045: Improve the C-API doc for PyTypeObject. This includes adding
several quick-reference tables and a lot of missing slot/typedef entries.
The existing entries were also cleaned up with a slightly more consistent
format.
- bpo-32613: Update the faq/windows.html to use the py command from PEP 397
instead of python.
- bpo-20709: Remove the paragraph where we explain that os.utime() does not
support a directory as path under Windows. Patch by Jan-Philip Gehrcke
Tests
-----
- bpo-35772: Fix sparse file tests of test_tarfile on ppc64 with the tmpfs
filesystem. Fix the function testing if the filesystem supports sparse
files: create a file which contains data and "holes", instead of creating
a file which contains no data. tmpfs effective block size is a page size
(tmpfs lives in the page cache). RHEL uses 64 KiB pages on aarch64, ppc64,
ppc64le, only s390x and x86_64 use 4 KiB pages, whereas the test punch
holes of 4 KiB.
- bpo-35045: Make ssl tests less strict and also accept TLSv1 as system
default. The changes unbreaks test_min_max_version on Fedora 29.
- bpo-35352: Modify test_asyncio to use the certificate set from the test
directory.
- bpo-21263: After several reports that test_gdb does not work properly on
macOS and since gdb is not shipped by default anymore, test_gdb is now
skipped on macOS when LLVM Clang has been used to compile Python. Patch by
Lysandros Nikolaou
- bpo-23596: Use argparse for the command line of the gzip module. Patch by
Antony Lee
- bpo-34569: The experimental PEP 554 data channels now correctly pass
negative PyLong objects between subinterpreters on 32-bit systems. Patch
by Michael Felt.
- bpo-34542: Use 3072 RSA keys and SHA-256 signature for test certs and
keys.
- bpo-34391: Fix ftplib test for TLS 1.3 by reading from data socket.
- bpo-11192: Fix `test_socket` on AIX 6.1 and later IPv6 zone id supports
only supported by inet_pton6_zone() Switch to runtime-based
platform.system() to establish current platform rather than build-time
based sys.platform()
- bpo-34399: Update all RSA keys and DH params to use at least 2048 bits.
- bpo-33901: Fix test_dbm_gnu on macOS with gdbm 1.15: add a larger value to
make sure that the file size changes.
- bpo-33562: Check that a global asyncio event loop policy is not left
behind by any tests.
- bpo-27643: Test_C test case needs "signed short" bitfields, but the IBM
XLC compiler (on AIX) does not support this Skip the code and test when
AIX and XLC are used
Build
-----
- bpo-34691: The _contextvars module is now built into the core Python
library on Windows.
- bpo-35683: Improved Azure Pipelines build steps and now verifying layouts
correctly
- bpo-35550: Fix incorrect Solaris #ifdef checks to look for __sun && __SVR4
instead of sun when compiling.
- bpo-35257: Avoid leaking the linker flags from Link Time Optimizations
(LTO) into distutils when compiling C extensions.
- bpo-35351: When building Python with clang and LTO, LTO flags are no
longer passed into CFLAGS to build third-party C extensions through
distutils.
- bpo-34710: Fixed SSL module build with OpenSSL & pedantic CFLAGS.
- bpo-34582: Add JUnit XML output for regression tests and update Azure
DevOps builds.
- bpo-34555: Fix for case where it was not possible to have both
``HAVE_LINUX_VM_SOCKETS_H`` and ``HAVE_SOCKADDR_ALG`` be undefined.
- bpo-30345: Add -g to LDFLAGS when compiling with LTO to get debug symbols.
- bpo-33614: Ensures module definition files for the stable ABI on Windows
are correctly regenerated.
- bpo-33394: Enable the verbose build for extension modules, when GNU make
is passed macros on the command line.
- bpo-33377: Add new triplets for mips r6 and riscv variants (used in
extension suffixes).
- bpo-33182: The embedding tests can once again be built with clang 6.0
Windows
-------
- bpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport
restrictions.
- bpo-34062: Fixed the '--list' and '--list-paths' arguments for the py.exe
launcher
- bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash.
- bpo-34011: A suite of code has been changed which copied across DLLs and
init.tcl from the running Python location into a venv being created. These
copies are needed only when running from a Python source build, and the
copying code is now only run when that is the case, rather than whenever a
venv is created.
- bpo-34006: Revert line length limit for Windows help docs. The line-length
limit is not needed because the pages appear in a separate app rather than
on a browser tab. It can also interact badly with the DPI setting.
macOS
-----
- bpo-24658: On macOS, fix reading from and writing into a file with a size
larger than 2 GiB.
- 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-35598: Update config_key: use PEP 8 names and ttk widgets, make some
objects global, and add tests.
- bpo-35555: Gray out Code Context menu entry when it's not applicable.
- bpo-35521: Document the IDLE editor code context feature. Add some
internal references within the IDLE doc.
- bpo-22703: The Code Context menu label now toggles between Show/Hide Code
Context. The Zoom Height menu now toggles between Zoom/Restore Height.
Zoom Height has moved from the Window menu to the Options menu.
- bpo-34864: Document two IDLE on MacOS issues. The System Preferences Dock
"prefer tabs always" setting disables some IDLE features. Menus are a bit
different than as described for Windows and Linux.
- bpo-33000: Document that IDLE's shell has no line limit. A program that
runs indefinitely can overfill memory.
- bpo-35099: Improve the doc about IDLE running user code. The section is
renamed from "IDLE -- console differences" is renamed "Running user code".
It mostly covers the implications of using custom :samp:`sys.std{xxx}`
objects.
- bpo-35093: Document the IDLE document viewer in the IDLE doc. Add a
paragraph in "Help and preferences", "Help sources" subsection.
- bpo-35087: Update idlelib help files for the current doc build. The main
change is the elimination of chapter-section numbers.
- bpo-34548: Use configured color theme for read-only text views.
- bpo-33975: Avoid small type when running htests. Since part of the purpose
of human-viewed tests is to determine that widgets look right, it is
important that they look the same for testing as when running IDLE.
- bpo-33907: For consistency and clarity, rename an IDLE module and classes.
Module calltips and its class CallTips are now calltip and Calltip. In
module calltip_w, class CallTip is now CalltipWindow.
- bpo-33839: IDLE: refactor ToolTip and CallTip and add documentation and
tests
- bpo-33855: Minimally test all IDLE modules. Add missing files, import
module, instantiate classes, and check coverage. Check existing files.
- bpo-33656: On Windows, add API call saying that tk scales for DPI. On
Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
unchanged, and a monitor resolution greater than 96 DPI, this should make
text and lines sharper. It should otherwise have no effect.
- bpo-33768: Clicking on a context line moves that line to the top of the
editor window.
- bpo-33763: IDLE: Use read-only text widget for code context instead of
label widget.
- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
and scrollbar slider moved text by a fixed number of pixels, resulting in
partial lines at the top of the editor box. The change also applies to
the shell and grep output windows, but not to read-only text views.
Tools/Demos
-----------
- bpo-32222: Fix pygettext not extracting docstrings for functions with type
annotated arguments. Patch by Toby Harradine.
- bpo-31583: Fix 2to3 for using with --add-suffix option but without
--output-dir option for relative path to files in current directory.
C API
-----
C API
-----
Library
-------
- bpo-11874: Use a better regex when breaking usage into wrappable parts.
Avoids bogus assertion errors from custom metavar strings.
Documentation
-------------
Build
-----
Windows
-------
IDLE
----
- bpo-33656: On Windows, add API call saying that tk scales for DPI. On
Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
unchanged, and a monitor resolution greater than 96 DPI, this should make
text and lines sharper. It should otherwise have no effect.
- bpo-33768: Clicking on a context line moves that line to the top of the
editor window.
- bpo-33763: IDLE: Use read-only text widget for code context instead of
label widget.
- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
and scrollbar slider moved text by a fixed number of pixels, resulting in
partial lines at the top of the editor box. The change also applies to
the shell and grep output windows, but not to read-only text views.
- bpo-33622: Fixed a leak when the garbage collector fails to add an object
with the ``__del__`` method or referenced by it into the
:data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
exception is set and preserves it.
Library
-------
- bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with
OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers
enabled by default.
Documentation
-------------
Tests
-----
Build
-----
- bpo-33614: Ensures module definition files for the stable ABI on Windows
are correctly regenerated.
macOS
-----
IDLE
----
Library
-------
Documentation
-------------
Tests
-----
Build
-----
- bpo-33394: Enable the verbose build for extension modules, when GNU make
is passed macros on the command line.
- bpo-33377: Add new triplets for mips r6 and riscv variants (used in
extension suffixes).
- bpo-33182: The embedding tests can once again be built with clang 6.0
Windows
-------
macOS
-----
IDLE
----
Tools/Demos
-----------
- bpo-31583: Fix 2to3 for using with --add-suffix option but without
--output-dir option for relative path to files in current directory.
Security
--------
- bpo-33041: Fixed jumping when the function contains an ``async for`` loop.
- bpo-33005: Fix a crash on fork when using a custom memory allocator (ex:
using PYTHONMALLOC env var). _PyGILState_Reinit() and
_PyInterpreterState_Enable() now use the default RAW memory allocator to
allocate a new interpreters mutex on fork.
Library
-------
- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch
by Nir Soffer.
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
macOS
-----
- 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
----
Tools/Demos
-----------
C API
-----
Security
--------
- bpo-28414: The ssl module now allows users to perform their own IDN
en/decoding when using SNI.
Library
-------
- 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-32929: Remove the tri-state parameter "hash", and add the boolean
"unsafe_hash". If unsafe_hash 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-30622: The ssl module now detects missing NPN support in LibreSSL.
- 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-32622: Implement native fast sendfile for Windows proactor event loop.
- bpo-32727: Do not include name field in SMTP envelope from address. Patch
by Stéphane Wirtel
Documentation
-------------
Tests
-----
Build
-----
Windows
-------
macOS
-----
IDLE
----
Tools/Demos
-----------
- bpo-32222: Fix pygettext not extracting docstrings for functions with type
annotated arguments. Patch by Toby Harradine.
- bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step
over (next command) native coroutines. Patch by Pablo Galindo.
- bpo-32690: The locals() dictionary now displays in the lexical order that
variables were defined. Previously, the order was reversed.
- bpo-32670: Enforce :pep:`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.
- bpo-31368: Expose preadv and pwritev system calls in the os module. Patch
by Pablo Galindo
Library
-------
- bpo-31429: 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.
- bpo-27931: Fix email address header parsing error when the username is an
empty quoted string. Patch by Xiang Zhang.
- 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: The nis module is now compatible with new libnsl and headers
location.
- bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and
library in nis module.
- bpo-28134: Sockets now auto-detect family, type and protocol from file
descriptor by default.
Documentation
-------------
Tests
-----
- bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built.
- bpo-28414: 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.
- bpo-32602: Add test certs and test for ECDSA cert and EC/RSA dual mode.
- bpo-32549: On Travis CI, Python now Compiles and uses a local copy of
OpenSSL 1.1.0g for testing.
Build
-----
Windows
-------
- bpo-32507: Use app-local UCRT install rather than the proper update for
old versions of Windows.
macOS
-----
C API
-----
- bpo-32399: Add AIX uuid library support for RFC4122 using uuid_create() in
libc.a
- bpo-32390: Fix the compilation failure on AIX after the f_fsid field has
been added to the object returned by os.statvfs() (issue #32143). Original
patch by Michael Felt.
- bpo-32379: Make MRO computation faster when a class inherits from a single
base.
- 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-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-31901: The `atexit` module now has its callback stored per
interpreter.
Library
-------
- bpo-32468: Improve frame repr() to mention filename, code name and current
line number.
- bpo-32441: Return the new file descriptor (i.e., the second argument) from
``os.dup2``. Previously, ``None`` was always returned.
- 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-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-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-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link
list'.
- bpo-32143: os.statvfs() includes the f_fsid field from statvfs(2)
- 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.
Documentation
-------------
Tests
-----
- bpo-32002: Adjust C locale coercion testing for the empty locale and POSIX
locale cases to more readily adjust to platform dependent behaviour.
Windows
-------
Tools/Demos
-----------
- bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using
pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and
lib2to3 work when run from a zipfile.
C API
-----
- bpo-32030: Py_Initialize() doesn't reset the memory allocators to default
if the ``PYTHONMALLOC`` environment variable is not set.
- bpo-29084: Undocumented C API for OrderedDict has been excluded from the
limited C API. It was added by mistake and actually never worked in the
limited C API.
- bpo-32043: Add a new "developer mode": new "-X dev" command line option to
enable debug checks at runtime.
- bpo-31618: The per-frame tracing logic added in 3.7a1 has been altered so
that ``frame->f_lineno`` is updated before either ``"line"`` or
``"opcode"`` events are emitted. Previously, opcode events were emitted
first, and therefore would occasionally see stale line numbers on the
frame. The behavior of this feature has changed slightly as a result: when
both ``f_trace_lines`` and ``f_trace_opcodes`` are enabled, line events
now occur first.
Library
-------
- bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying
instances of generic classes, improve interaction of ``__init_subclass__``
with generics. Original PRs by Ivan Levkivskyi.
- bpo-27240: The header folding algorithm for the new email policies has
been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182. In
particular, RFC2231 folding is now done correctly.
- bpo-19610: ``setup()`` now warns about invalid types for some fields. The
``distutils.dist.Distribution`` class now warns when ``classifiers``,
``keywords`` and ``platforms`` fields are not specified as a list or a
string.
- bpo-27535: The warnings module doesn't leak memory anymore in the hidden
warnings registry for the "ignore" action of warnings filters.
warn_explicit() function doesn't add the warning key to the registry
anymore for the "ignore" action.
- bpo-31976: Fix race condition when flushing a file is slow, which can
cause a segfault if closing the file from another thread.
- bpo-9678: Fixed determining the MAC address in the uuid module: Using
ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and
OpenBSD. Based on patch by Takayuki Shimizukawa.
- bpo-31897: plistlib now catches more errors when read binary plists and
raises InvalidFileException instead of unexpected exceptions.
- bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch
by Masayuki Yamamoto.
- bpo-31834: Use optimized code for BLAKE2 only with SSSE3+. The pure SSE2
implementation is slower than the pure C reference implementation.
- bpo-31800: Extended support for parsing UTC offsets. strptime '%z' can now
parse the output generated by datetime.isoformat, including seconds and
microseconds.
- bpo-30541: Add new function to seal a mock and prevent the automatically
creation of child mocks. Patch by Mario Corchero.
- bpo-30143: 2to3 now generates a code that uses abstract collection classes
from collections.abc rather than collections.
- bpo-31664: Added support for the Blowfish hashing in the crypt module.
- bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and
earlier.
Documentation
-------------
Tests
-----
Build
-----
- bpo-28762: Revert the last commit, the F_LOCK macro is defined by Android
Unified Headers.
- bpo-29040: Support building Android with Unified Headers. The first NDK
release to support Unified Headers is android-ndk-r14.
- bpo-31957: Fixes Windows SDK version detection when building for Windows.
- bpo-31934: Abort the build when building out of a not clean source tree.
Windows
-------
macOS
-----
IDLE
----
- bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch
mostly by Cheryl Sabella.
Tools/Demos
-----------
- bpo-30722: Make redemo work with Python 3.6 and newer versions. Also,
remove the ``LOCALE`` option since it doesn't work with string patterns in
Python 3. Patch by Christoph Sarnowski.
C API
-----
- bpo-25612: Move the current exception state from the frame object to the
co-routine. This simplifies the interpreter and fixes a couple of obscure
bugs caused by having swap exception state when entering or exiting a
generator.
- bpo-31558: ``gc.freeze()`` is a new API that allows for moving all objects
currently tracked by the garbage collector to a permanent generation,
effectively removing them from future collection events. This can be used
to protect those objects from having their PyGC_Head mutated. In effect,
this enables great copy-on-write stability at fork().
- bpo-30404: The -u option now makes the stdout and stderr streams
unbuffered rather than line-buffered.
- bpo-31415: Add ``-X importtime`` option to show how long each import
takes. It can be used to optimize application's startup time. Support the
:envvar:`PYTHONPROFILEIMPORTTIME` as an equivalent way to enable this.
Library
-------
- bpo-30397: The types of compiled regular objects and match objects are now
exposed as `re.Pattern` and `re.Match`. This adds information in pydoc
output for the re module.
- bpo-20519: Avoid ctypes use (if possible) and improve import time for
uuid.
- bpo-31351: python -m ensurepip now exits with non-zero exit code if pip
bootstrapping has failed.
Documentation
-------------
Build
-----
IDLE
----
- bpo-1612262: IDLE module browser now shows nested classes and functions.
Original patches for code and tests by Guilherme Polo and Cheryl Sabella,
respectively.
C API
-----
Security
--------
- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
security vulnerabilities including: CVE-2017-9233 (External entity
infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
impact Python, since Python already gets entropy from the OS to set the
expat secret using ``XML_SetHashSalt()``.
- bpo-30721: ``print`` now shows correct usage hint for using Python 2
redirection syntax. Patch by Sanyam Khurana.
- bpo-30876: Relative import from unloaded package now reimports the package
instead of failing with SystemError. Relative import from non-package now
fails with ImportError rather than SystemError.
- bpo-30597: ``print`` now shows expected input in custom error message when
used as a Python 2 statement. Patch by Sanyam Khurana.
- bpo-30501: The compiler now produces more optimal code for complex
condition expressions in the "if", "while" and "assert" statement, the
"if" expression, and generator expressions and comprehensions.
- bpo-27945: Fixed various segfaults with dict when input collections are
mutated during searching, inserting or comparing. Based on patches by
Duane Griffin and Tim Mitchell.
- bpo-29935: Fixed error messages in the index() method of tuple, list and
deque when pass indices of wrong type.
- bpo-29859: Show correct error messages when any of the pthread_* calls in
thread_pthread.h fails.
- bpo-29568: Escaped percent "%%" in the format string for classic string
formatting no longer allows any characters between two percents.
- bpo-29714: Fix a regression that bytes format may fail when containing
zero bytes inside.
- bpo-29546: Set the 'path' and 'name' attribute on ImportError for ``from
... import ...``.
- bpo-25677: Correct the positioning of the syntax error caret for indented
blocks. Based on patch by Michael Layzell.
- bpo-29000: Fixed bytes formatting of octals with zero padding in alternate
form.
- bpo-18896: Python function can now have more than 255 parameters.
collections.namedtuple() now supports tuples with more than 255 elements.
- bpo-28918: Fix the cross compilation of xxlimited when Python has been
built with Py_DEBUG defined.
- bpo-28774: Fix error position of the unicode error in ASCII and Latin1
encoders when a string returned by the error handler contains multiple
non-encodable characters (non-ASCII for the ASCII codec, characters out of
the U+0000-U+00FF range for Latin1).
- bpo-26920: Fix not getting the locale's charset upon initializing the
interpreter, on platforms that do not have langinfo.
- bpo-28128: Deprecation warning for invalid str and byte escape sequences
now prints better information about where the error occurs. Patch by
Serhiy Storchaka and Eric Smith.
- bpo-26182: Raise DeprecationWarning when async and await keywords are used
as variable/attribute/class/function name.
Library
-------
- bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer
types.
- bpo-29741: Update some methods in the _pyio module to also accept integer
types. Patch by Oren Milman.
- bpo-31238: pydoc: the stop() method of the private ServerThread class now
waits until DocServer.serve_until_quit() completes and then explicitly
sets its docserver attribute to None to break a reference cycle.
- bpo-30987: Added support for CAN ISO-TP protocol in the socket module.
- bpo-26732: Fix too many fds in processes started with the "forkserver"
method. A child process would inherit as many fds as the number of
still-running children.
- bpo-30946: Remove obsolete code in readline module for platforms where GNU
readline is older than 2.1 or where select() is not available.
- bpo-30532: Fix email header value parser dropping folding white space in
certain cases.
- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
with bytes-like argument.
- bpo-30038: Fix race condition between signal delivery and wakeup file
descriptor. Patch by Nathaniel Smith.
- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
(code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
This error occurs sometimes on SSL connections.
- bpo-30228: The seek() and tell() methods of io.FileIO now set the internal
seekable attribute to avoid one syscall on open() (in buffered or text
mode).
- bpo-22352: Column widths in the output of dis.dis() are now adjusted for
large line numbers and instruction offsets.
- bpo-26187: Test that sqlite3 trace callback is not called multiple times
when schema is changing. Indirectly fixed by switching to use
sqlite3_prepare_v2() in bpo-9303. Patch by Aviv Palivoda.
- bpo-30017: Allowed calling the close() method of the zip entry writer
object multiple times. Writing to a closed writer now always produces a
ValueError.
- bpo-29998: Pickling and copying ImportError now preserves name and path
attributes.
- bpo-29953: Fixed memory leaks in the replace() method of datetime and time
objects when pass out of bound fold argument.
- bpo-29901: The zipapp module now supports general path-like objects, not
just pathlib.Path.
- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting
big intables (objects that have __int__) as elements.
- bpo-28231: The zipfile module now accepts path-like objects for external
paths.
- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts
PathLike objects. Patch by Sayan Chowdhury.
- bpo-28427: old keys should not remove new values from WeakValueDictionary
when collecting from another thread.
- bpo-26937: The chown() method of the tarfile.TarFile class does not fail
now when the grp module cannot be imported, as for example on Android
platforms.
- bpo-28563: Fixed possible DoS and arbitrary code execution when handle
plural form selections in the gettext module. The expression parser now
supports exact syntax supported by GNU gettext.
- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
file with compression before trying to open it without compression.
Otherwise it had 50% chance failed with ignore_zeros=True.
- bpo-23262: The webbrowser module now supports Firefox 36+ and derived
browsers. Based on patch by Oleg Broytman.
- bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix
for readability.
- bpo-28469: timeit now uses the sequence 1, 2, 5, 10, 20, 50,... instead of
1, 10, 100,... for autoranging.
- Distutils.sdist now looks for README and setup.py files with case
sensitivity. This behavior matches that found in Setuptools 6.0 and later.
See `setuptools 100 <https://github.com/pypa/setuptools/issues/100>`_ for
rationale.
- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
Kevin Conway.
Documentation
-------------
- bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL
documentation.
- bpo-19824: Improve the documentation for, and links to, template strings
by emphasizing their utility for internationalization, and by clarifying
some usage constraints. (See also: bpo-20314, bpo-12518)
- bpo-23722: The data model reference and the porting section in the 3.6
What's New guide now cover the additional ``__classcell__`` handling
needed for custom metaclasses to fully support :pep:`487` and
zero-argument ``super()``.
Tests
-----
- bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest
version behaves like OpenSSL 1.0.2 and no longer aborts handshake.
- bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the
test suite using --use=all / -u all, exclude tzdata since it makes
test_datetime too slow (15-20 min on some buildbots) which then times out
on some buildbots. Fix also regrtest command line parser to allow passing
-u extralargefile to run test_zipfile64.
- bpo-28683: Fix the tests that bind() a unix socket and raise
PermissionError on Android for a non-root user.
- bpo-23839: Various caches now are cleared before running every test file.
- bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or
missing the effective gid.
Build
-----
- bpo-31341: Per :pep:`11`, support for the IRIX operating system was
removed.
- bpo-28762: lockf() is available on Android API level 24, but the F_LOCK
macro is not defined in android-ndk-r13.
- bpo-20211: Do not add the directory for installing C header files and the
directory for installing object code libraries to the cross compilation
search paths. Original patch by Thomas Petazzoni.
Windows
-------
- bpo-31340: Change to building with MSVC v141 (included with Visual Studio
2017)
- bpo-30916: Pre-build OpenSSL, Tcl and Tk and include the binaries in the
build.
- bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun)
- bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk
Sun)
IDLE
----
- bpo-31493: IDLE code context -- fix code update and font update timers.
Canceling timers prevents a warning message when test_idle completes.
- bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk
update in the background in order to make live interaction and
experimentation with tkinter applications much easier.
- bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an
int entry is not the same as deleting and inserting because int('') will
fail.
- bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor.
Move some data and functions from the class to module level. Patch by
Cheryl Sabella.
- bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella.
- bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as
well as mouse. Initial patch by Louie Lu.
- bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more
tests. Patch by Cheryl Sabella.
- bpo-21519: IDLE's basic custom key entry dialog now detects duplicates
properly. Original patch by Saimadhav Heblikar.
- bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by
Cheryl Sabella and Terry Jan Reedy.
- bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to
100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy.
- bpo-30303: Add _utest option to textview; add new tests. Increase coverage
to 100%. Patches by Louie Lu and Terry Jan Reedy.
- bpo-15369: The pybench and pystone microbenchmark have been removed from
Tools. Please use the new Python benchmark suite
https://github.com/python/pyperformance which is more reliable and
includes a portable version of pybench working on Python 2 and Python 3.
- bpo-28102: The zipfile module CLI now prints usage to stderr. Patch by
Stephen J. Turnbull.
C API
-----
- bpo-31338: Added the ``Py_UNREACHABLE()`` macro for code paths which are
never expected to be reached. This and a few other useful macros are now
documented in the C API manual.
- bpo-29058: All stable API extensions added after Python 3.2 are now
available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of
the minimum Python version supporting this API.
- bpo-33622: Fixed a leak when the garbage collector fails to add an object
with the ``__del__`` method or referenced by it into the
:data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
exception is set and preserves it.
- bpo-33041: Fixed jumping when the function contains an ``async for`` loop.
Library
-------
- bpo-11874: Use a better regex when breaking usage into wrappable parts.
Avoids bogus assertion errors from custom metavar strings.
- bpo-30877: Fixed a bug in the Python implementation of the JSON decoder
that prevented the cache of parsed strings from clearing after finishing
the decoding. Based on patch by c-fos.
- bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch
by Nir Soffer.
- bpo-31238: pydoc: the stop() method of the private ServerThread class now
waits until DocServer.serve_until_quit() completes and then explicitly
sets its docserver attribute to None to break a reference cycle.
Documentation
-------------
Tests
-----
Build
-----
- bpo-33614: Ensures module definition files for the stable ABI on Windows
are correctly regenerated.
- bpo-33394: Enable the verbose build for extension modules, when GNU make
is passed macros on the command line.
Windows
-------
macOS
-----
IDLE
----
- bpo-33656: On Windows, add API call saying that tk scales for DPI. On
Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
unchanged, and a monitor resolution greater than 96 DPI, this should make
text and lines sharper. It should otherwise have no effect.
- bpo-33768: Clicking on a context line moves that line to the top of the
editor window.
- bpo-33763: IDLE: Use read-only text widget for code context instead of
label widget.
- bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
and scrollbar slider moved text by a fixed number of pixels, resulting in
partial lines at the top of the editor box. The change also applies to
the shell and grep output windows, but not to read-only text views.
- bpo-29706: IDLE now colors async and await as keywords in 3.6. They become
full keywords in 3.7.
Tools/Demos
-----------
- bpo-31583: Fix 2to3 for using with --add-suffix option but without
--output-dir option for relative path to files in current directory.
C API
-----
Tests
-----
Build
-----
Security
--------
- bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step
over (next command) native coroutines. Patch by Pablo Galindo.
- 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.
Library
-------
- bpo-30622: The ssl module now detects missing NPN support in LibreSSL.
- 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-32727: Do not include name field in SMTP envelope from address. Patch
by Stéphane Wirtel
- bpo-27931: Fix email address header parsing error when the username is an
empty quoted string. Patch by Xiang Zhang.
- bpo-32521: The nis module is now compatible with new libnsl and headers
location.
- bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and
library in nis module.
- 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-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link
list'.
Documentation
-------------
Tests
-----
- bpo-31518: Debian Unstable has disabled TLS 1.0 and 1.1 for
SSLv23_METHOD(). Change TLS/SSL protocol of some tests to PROTOCOL_TLS or
PROTOCOL_TLSv1_2 to make them pass on Debian.
Build
-----
Windows
-------
- bpo-32370: Use the correct encoding for ipconfig output in the uuid
module. Patch by Segev Finer.
macOS
-----
IDLE
----
Tools/Demos
-----------
- bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using
pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and
lib2to3 work when run from a zipfile.
- bpo-32222: Fix pygettext not extracting docstrings for functions with type
annotated arguments. Patch by Toby Harradine.
C API
-----
- bpo-29084: Undocumented C API for OrderedDict has been excluded from the
limited C API. It was added by mistake and actually never worked in the
limited C API.
Library
-------
- bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying
instances of generic classes, improve interaction of ``__init_subclass__``
with generics. Original PRs by Ivan Levkivskyi.
- bpo-27240: The header folding algorithm for the new email policies has
been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182. In
particular, RFC2231 folding is now done correctly.
- bpo-9678: Fixed determining the MAC address in the uuid module: Using
ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and
OpenBSD. Based on patch by Takayuki Shimizukawa.
- bpo-31897: plistlib now catches more errors when read binary plists and
raises InvalidFileException instead of unexpected exceptions.
- bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch
by Masayuki Yamamoto.
- bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and
earlier.
- bpo-31351: python -m ensurepip now exits with non-zero exit code if pip
bootstrapping has failed.
Documentation
-------------
Tests
-----
Build
-----
- bpo-31957: Fixes Windows SDK version detection when building for Windows.
- bpo-31934: Abort the build when building out of a not clean source tree.
- bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when
there was more than one function and/or method in a .c file with the same
name.
Windows
-------
macOS
-----
IDLE
----
- bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch
mostly by Cheryl Sabella.
- bpo-1612262: IDLE module browser now shows nested classes and functions.
Original patches for code and tests by Guilherme Polo and Cheryl Sabella,
respectively.
Tools/Demos
-----------
- bpo-30722: Make redemo work with Python 3.6 and newer versions. Also,
remove the ``LOCALE`` option since it doesn't work with string patterns in
Python 3. Patch by Christoph Sarnowski.
C API
-----
Build
-----
Security
--------
- bpo-30721: ``print`` now shows correct usage hint for using Python 2
redirection syntax. Patch by Sanyam Khurana.
- bpo-30876: Relative import from unloaded package now reimports the package
instead of failing with SystemError. Relative import from non-package now
fails with ImportError rather than SystemError.
- bpo-30597: ``print`` now shows expected input in custom error message when
used as a Python 2 statement. Patch by Sanyam Khurana.
Library
-------
- bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer
types.
- bpo-30532: Fix email header value parser dropping folding white space in
certain cases.
- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
with bytes-like argument.
Documentation
-------------
- bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL
documentation.
Tests
-----
- bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest
version behaves like OpenSSL 1.0.2 and no longer aborts handshake.
- bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the
test suite using --use=all / -u all, exclude tzdata since it makes
test_datetime too slow (15-20 min on some buildbots) which then times out
on some buildbots. Fix also regrtest command line parser to allow passing
-u extralargefile to run test_zipfile64.
Build
-----
Windows
-------
- bpo-31340: Change to building with MSVC v141 (included with Visual Studio
2017)
IDLE
----
- bpo-31493: IDLE code context -- fix code update and font update timers.
Canceling timers prevents a warning message when test_idle completes.
- bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk
update in the background in order to make live interaction and
experimentation with tkinter applications much easier.
- bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor.
Move some data and functions from the class to module level. Patch by
Cheryl Sabella.
- bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella.
- bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more
tests. Patch by Cheryl Sabella.
- bpo-21519: IDLE's basic custom key entry dialog now detects duplicates
properly. Original patch by Saimadhav Heblikar.
Tools/Demos
-----------
Security
--------
- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
security vulnerabilities including: CVE-2017-9233 (External entity
infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
impact Python, since Python already gets entropy from the OS to set the
expat secret using ``XML_SetHashSalt()``.
Security
--------
- bpo-27945: Fixed various segfaults with dict when input collections are
mutated during searching, inserting or comparing. Based on patches by
Duane Griffin and Tim Mitchell.
- bpo-25794: Fixed type.__setattr__() and type.__delattr__() for
non-interned attribute names. Based on patch by Eryk Sun.
- bpo-29935: Fixed error messages in the index() method of tuple, list and
deque when pass indices of wrong type.
- bpo-29859: Show correct error messages when any of the pthread_* calls in
thread_pthread.h fails.
- bpo-29714: Fix a regression that bytes format may fail when containing
zero bytes inside.
Library
-------
- bpo-30038: Fix race condition between signal delivery and wakeup file
descriptor. Patch by Nathaniel Smith.
- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
(code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
This error occurs sometimes on SSL connections.
- bpo-30017: Allowed calling the close() method of the zip entry writer
object multiple times. Writing to a closed writer now always produces a
ValueError.
- bpo-29998: Pickling and copying ImportError now preserves name and path
attributes.
- bpo-29953: Fixed memory leaks in the replace() method of datetime and time
objects when pass out of bound fold argument.
- bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting
big intables (objects that have __int__) as elements. Patch by Oren
Milman.
- bpo-28231: The zipfile module now accepts path-like objects for external
paths.
IDLE
----
- bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by
Cheryl Sabella and Terry Jan Reedy.
- bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to
100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy.
- bpo-30303: Add _utest option to textview; add new tests. Increase coverage
to 100%. Patches by Louie Lu and Terry Jan Reedy.
C API
-----
Build
-----
Documentation
-------------
Tools/Demos
-----------
- bpo-29367: python-gdb.py now supports also ``method-wrapper``
(``wrapperobject``) objects.
Tests
-----
Windows
-------
Build
-----
- bpo-25677: Correct the positioning of the syntax error caret for indented
blocks. Based on patch by Michael Layzell.
- bpo-28918: Fix the cross compilation of xxlimited when Python has been
built with Py_DEBUG defined.
Library
-------
- bpo-28624: Add a test that checks that cwd parameter of Popen() accepts
PathLike objects. Patch by Sayan Chowdhury.
- bpo-29094: Offsets in a ZIP file created with extern file object and modes
"w" and "x" now are relative to the start of the file.
- bpo-28427: old keys should not remove new values from WeakValueDictionary
when collecting from another thread.
- bpo-26937: The chown() method of the tarfile.TarFile class does not fail
now when the grp module cannot be imported, as for example on Android
platforms.
IDLE
----
Windows
-------
- bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun)
C API
-----
- bpo-29058: All stable API extensions added after Python 3.2 are now
available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of
the minimum Python version supporting this API.
Documentation
-------------
Tests
-----
- bpo-28683: Fix the tests that bind() a unix socket and raise
PermissionError on Android for a non-root user.
Build
-----
- bpo-20211: Do not add the directory for installing C header files and the
directory for installing object code libraries to the cross compilation
search paths. Original patch by Thomas Petazzoni.
Tools/Demos
-----------
Windows
-------
Build
-----
Library
-------
C API
-----
Documentation
-------------
- bpo-23722: The data model reference and the porting section in the What's
New guide now cover the additional ``__classcell__`` handling needed for
custom metaclasses to fully support :pep:`487` and zero-argument
``super()``.
Tools/Demos
-----------
- bpo-26920: Fix not getting the locale's charset upon initializing the
interpreter, on platforms that do not have langinfo.
Library
-------
- bpo-28563: Fixed possible DoS and arbitrary code execution when handle
plural form selections in the gettext module. The expression parser now
supports exact syntax supported by GNU gettext.
- bpo-28652: Make loop methods reject socket kinds they do not support.
Documentation
-------------
Tests
-----
- bpo-23839: Various caches now are cleared before running every test file.
Build
-----
- bpo-28128: Deprecation warning for invalid str and byte escape sequences
now prints better information about where the error occurs. Patch by
Serhiy Storchaka and Eric Smith.
- bpo-28471: Fix "Python memory allocator called without holding the GIL"
crash in socket.setblocking.
Library
-------
- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
file with compression before trying to open it without compression.
Otherwise it had 50% chance failed with ignore_zeros=True.
- bpo-23262: The webbrowser module now supports Firefox 36+ and derived
browsers. Based on patch by Oleg Broytman.
- bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix
for readability.
Windows
-------
Build
-----
Tests
-----
- bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or
missing the effective gid.
- bpo-26182: Raise DeprecationWarning when async and await keywords are used
as variable/attribute/class/function name.
Library
-------
- bpo-26293: Fixed writing ZIP files that starts not from the start of the
file. Offsets in ZIP file now are relative to the start of the archive in
conforming to the specification.
- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
Kevin Conway.
Windows
-------
- bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk
Sun)
C API
-----
Build
-----
Tests
-----
- bpo-27999: Make "global after use" a SyntaxError, and ditto for nonlocal.
Patch by Ivan Levkivskyi.
- bpo-26058: Add a new private version to the builtin dict type, incremented
at each dictionary creation and at each dictionary change. Implementation
of the PEP 509.
- bpo-27355: Removed support for Windows CE. It was never finished, and
Windows CE is no longer a relevant platform for Python.
- Implement :pep:`523`.
- bpo-27811: Fix a crash when a coroutine that has not been awaited is
finalized with warnings-as-errors enabled.
- bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after
use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes.
- bpo-25604: Fix a minor bug in integer true division; this bug could
potentially have caused off-by-one-ulp results on platforms with
unreliable ldexp implementations.
- bpo-27936: The round() function accepted a second None argument for some
types but not for others. Fixed the inconsistency by accepting None for
all numeric types.
- bpo-27157: Make only type() itself accept the one-argument form. Patch by
Eryk Sun and Emanuel Barry.
Library
-------
- bpo-28732: Fix crash in os.spawnv() with no elements in args
- bpo-24454: Regular expression match object groups are now accessible using
__getitem__. "mo[x]" is equivalent to "mo.group(x)".
- bpo-22493: Inline flags now should be used only at the start of the
regular expression. Deprecation warning is emitted if uses them in the
middle of the regular expression.
- Fix possible integer overflows and crashes in the mmap module with unusual
usage patterns.
- bpo-14977: mailcap now respects the order of the lines in the mailcap
files ("first match"), as required by RFC 1542. Patch by Michael Lazar.
- bpo-28047: Fixed calculation of line length used for the base64 CTE in the
new email policies.
- bpo-24277: The new email API is no longer provisional, and the docs have
been reorganized and rewritten to emphasize the new API.
- bpo-22450: urllib now includes an ``Accept: */*`` header among the default
headers. This makes the results of REST API requests more consistent and
predictable especially when proxy servers are involved.
- bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers
in the "ctypes" and "array" modules.
- bpo-22233: Break email header lines *only* on the RFC specified CR and LF
characters, not on arbitrary unicode line breaks. This also fixes a bug
in HTTP header parsing.
- bpo-27331: The email.mime classes now all accept an optional policy
keyword.
- bpo-25596: Optimized glob() and iglob() functions in the glob module; they
are now about 3--6 times faster.
- bpo-27850: Remove 3DES from ssl module's default cipher list to counter
measure sweet32 attack (CVE-2016-2183).
- bpo-11734: Add support for IEEE 754 half-precision floats to the struct
module. Based on a patch by Eli Stevens.
IDLE
----
- bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
- bpo-27821: Fix 3.6.0a3 regression that prevented custom key sets from
being selected when no custom theme was defined.
C API
-----
- bpo-26900: Excluded underscored names and other private API from limited
API.
Tests
-----
- bpo-27427: Additional tests for the math module. Patch by Francisco Couzo.
- bpo-27953: Skip math and cmath tests that fail on OS X 10.4 due to a poor
libm implementation of tan.
Build
-----
- bpo-26307: The profile-opt build now applies PGO to the built-in modules.
- bpo-26359: Add the --with-optimizations flag to turn on LTO and PGO build
support when available.
Tools/Demos
-----------
Windows
-------
- bpo-27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec
lookup.
- bpo-27982: The functions of the winsound module now accept keyword
arguments.
- bpo-27756: Adds new icons for Python files and processes on Windows.
Designs by Cherry Wang.
Library
-------
- bpo-12345: Add mathematical constant tau to math and cmath. See also
:pep:`628`.
- bpo-27758: Fix possible integer overflow in the _csv module for large
record lengths.
- bpo-7063: Remove dead code from the "array" module's slice handling. Patch
by Chuck.
IDLE
----
- bpo-27609: Explicitly return None when there are also non-None returns. In
a few cases, reverse a condition and eliminate a return.
- bpo-25507: IDLE no longer runs buggy code because of its tkinter imports.
Users must include the same imports required to run directly in Python.
- bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the
default key set depend on the platform. Add tests for the changes to the
config module.
- bpo-27452: add line counter and crc to IDLE configHandler test dump.
Tests
-----
Windows
-------
- bpo-27469: Adds a shell extension to the launcher so that drag and drop
works correctly.
Build
-----
- bpo-27641: The configure script now inserts comments into the makefile to
prevent the pgen and _freeze_importlib executables from being
cross-compiled.
Security
--------
Library
-------
- bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an
error about unclean EOF.
- bpo-27294: Numerical state in the repr for Tkinter event objects is now
represented as a combination of known flags.
- bpo-27238: Got rid of bare excepts in the turtle module. Original patch
by Jelle Zijlstra.
- bpo-8637: Honor a pager set by the env var MANPAGER (in preference to one
set by the env var PAGER).
IDLE
----
- bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the
default key set depend on the platform. Add tests for the changes to the
config module.
- bpo-27452: add line counter and crc to IDLE configHandler test dump.
- bpo-27380: IDLE: add query.py with base Query dialog and ttk widgets.
Module had subclasses SectionName, ModuleName, and HelpSource, which are
used to get information from users by configdialog and file =>Load Module.
Each subclass has itw own validity checks. Using ModuleName allows users
to edit bad module names instead of starting over. Add tests and delete
the two files combined into the new one.
- bpo-24137: Run IDLE, test_idle, and htest with tkinter default root
disabled. Fix code and tests that fail with this restriction. Fix htests
to not create a second and redundant root and mainloop.
C API
-----
- bpo-28066: Fix the logic that searches build directories for generated
include files when building outside the source tree.
- bpo-27442: Expose the Android API level that python was built against, in
sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'.
- bpo-27434: The interpreter that runs the cross-build, found in PATH, must
now be of the same feature version (e.g. 3.6) as the source being built.
Tools/Demos
-----------
Documentation
-------------
- bpo-19489: Moved the search box from the sidebar to the header and footer
of each page. Patch by Ammar Askar.
Tests
-----
Security
--------
Library
-------
- bpo-27025: Generated names for Tkinter widgets are now more meaningful and
recognizable.
- bpo-23883: Added missing APIs to __all__ to match the documented APIs for
the following modules: cgi, mailbox, mimetypes, plistlib and smtpd.
Patches by Jacek Kołodziej.
- signal, socket, and ssl module IntEnum constant name lookups now return a
consistent name for values having multiple names. Ex: signal.Signals(6)
now refers to itself as signal.SIGALRM rather than flipping between that
and signal.SIGIOT based on the interpreter's hash randomization seed.
- bpo-26526: Replace custom parse tree validation in the parser module with
a simple DFA validator.
IDLE
----
- bpo-5124: Paste with text selected now replaces the selection on X11. This
matches how paste works on Windows, Mac, most modern Linux apps, and ttk
widgets. Original patch by Serhiy Storchaka.
- bpo-24759: IDLE requires tk 8.5 and availability ttk widgets. Delete now
unneeded tk version tests and code for older versions. Add test for IDLE
syntax colorizer.
- bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move
code for configuring text widget colors to a new function.
- bpo-26673: When tk reports font size as 0, change to size 10. Such fonts
on Linux prevented the configuration dialog from opening.
- bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav
Heblikar.
- bpo-18410: Add test for IDLE's search dialog. Original patch by Westley
Martínez.
Documentation
-------------
- bpo-16484: Change the default PYTHONDOCS URL to "https:", and fix the
resulting links to use lowercase. Patch by Sean Rodman, test by Kaushik
Nadikuditi.
Tests
-----
- bpo-25285: regrtest now uses subprocesses when the -j1 command line option
is used: each test file runs in a fresh child process. Before, the -j1
option was ignored.
Windows
-------
Build
-----
- bpo-27229: Fix the cross-compiling pgen rule for in-tree builds. Patch by
Xavier de Gaye.
C API
-----
Tools/Demos
-----------
Security
--------
- bpo-26563: Debug hooks on Python memory allocators now raise a fatal error
if functions of the :c:func:`PyMem_Malloc` family are called without
holding the GIL.
- bpo-26564: On error, the debug hooks on Python memory allocators now use
the :mod:`tracemalloc` module to get the traceback where a memory block
was allocated.
- bpo-26516: In debug mode, debug hooks are now also installed on Python
memory allocators when Python is configured without pymalloc.
- bpo-26204: The compiler now ignores all constant statements: bytes, str,
int, float, complex, name constants (None, False, True), Ellipsis and
ast.Constant; not only str and int. For example, ``1.0`` is now ignored in
``def f(): 1.0``.
- bpo-4806: Avoid masking the original TypeError exception when using star
(``*``) unpacking in function calls. Based on patch by Hagen Fürstenau
and Daniel Urban.
- bpo-25843: When compiling code, don't merge constants if they are equal
but have a different types. For example, ``f1, f2 = lambda: 1, lambda:
1.0`` is now correctly compiled to two different functions: ``f1()``
returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``float``), even if
``1`` and ``1.0`` are equal.
- bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
- bpo-25462: The hash of the key now is calculated only once in most
operations in C implementation of OrderedDict.
- bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node
when compiling AST from Python objects.
- bpo-25449: Iterating OrderedDict with keys with unstable hash now raises
KeyError in C implementations as well as in Python implementation.
- bpo-25349: Optimize bytes % args using the new private _PyBytesWriter API.
Formatting is now up to 2 times faster.
- bpo-24806: Prevent builtin types that are not allowed to be subclassed
from being subclassed through multiple inheritance.
- bpo-26478: Fix semantic bugs when using binary operators with dictionary
views and tuples.
Library
-------
- bpo-14132: Fix urllib.request redirect handling when the target only has a
query string. Original fix by Ján Janech.
- bpo-26915: The __contains__ methods in the collections ABCs now check for
identity before checking equality. This better matches the behavior of
the concrete classes, allows sensible handling of NaNs, and makes it
easier to reason about container invariants.
- bpo-24838: tarfile's ustar and gnu formats now correctly calculate name
and link field limits for multibyte character encodings like utf-8.
- bpo-26587: the site module now allows .pth files to specify files to be
added to sys.path (e.g. zip files).
- bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes
instead of up to 1024.
- bpo-24266: Ctrl+C during Readline history search now cancels the search
mode when compiled with Readline 7.
- bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets.
- bpo-25718: Fixed pickling and copying the accumulate() iterator with total
is None.
- bpo-26475: Fixed debugging output for regular expressions with the (?x)
flag.
- bpo-26335: Make mmap.write() return the number of bytes written like other
write methods. Patch by Jakub Stasiak.
- bpo-26457: Fixed the subnets() methods in IP network classes for the case
when resulting prefix length is equal to maximal prefix length. Based on
patch by Xiang Zhang.
- bpo-26402: Fix XML-RPC client to retry when the server shuts down a
persistent connection. This was a regression related to the new
http.client.RemoteDisconnected exception in 3.5.0a4.
- bpo-25994: Added the close() method and the support of the context manager
protocol for the os.scandir() iterator.
- bpo-23992: multiprocessing: make MapResult not fail-fast upon exception.
- bpo-26117: The os.scandir() iterator now closes file descriptor not only
when the iteration is finished, but when it was failed with error.
- bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8
encoding.
- bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer
attribute (restores backward compatibility).
- bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message
". . . is a package and cannot be directly executed" if the package could
not even be initialized (e.g. due to a bad ``*.pyc`` file).
- bpo-25177: Fixed problem with the mean of very small and very large
numbers. As a side effect, statistics.mean and statistics.variance should
be significantly faster.
- bpo-25718: Fixed copying object with state with boolean value is false.
- bpo-23883: Added missing APIs to __all__ to match the documented APIs for
the following modules: calendar, csv, enum, fileinput, ftplib, logging,
optparse, tarfile, threading and wave. Also added a
test.support.check__all__() helper. Patches by Jacek Kołodziej, Mauro S.
M. Rodrigues and Joel Taddei.
- bpo-18010: Fix the pydoc web server's module search function to handle
exceptions from importing packages.
- bpo-25447: The lru_cache() wrapper objects now can be copied and pickled
(by returning the original object unchanged).
- bpo-25232: Fix CGIRequestHandler to split the query from the URL at the
first question mark (?) rather than the last. Patch from Xiang Zhang.
- bpo-24879: help() and pydoc can now list named tuple fields in the order
they were defined rather than alphabetically. The ordering is determined
by the _fields attribute if present.
- bpo-2091: open() accepted a 'U' mode string containing '+', but 'U' can
only be used with 'r'. Patch from Jeff Balogh and John O'Connor.
IDLE
----
- bpo-24455: Prevent IDLE from hanging when a) closing the shell while the
debugger is active (15347); b) closing the debugger with the [X] button
(15348); and c) activating the debugger when already active (24455). The
patch by Mark Roseman does this by making two changes. 1. Suspend and
resume the gui.interaction method with the tcl vwait mechanism intended
for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow
any existing interaction to terminate first.
- bpo-24750: Improve the appearance of the IDLE editor window status bar.
Patch by Mark Roseman.
- bpo-25313: Change the handling of new built-in text color themes to better
address the compatibility problem introduced by the addition of IDLE Dark.
Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
- bpo-22726: Re-activate the config dialog help button with some content
about the other buttons and the new IDLE Dark theme.
- bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is
more or less IDLE Classic inverted, with a cobalt blue background.
Strings, comments, keywords, ... are still green, red, orange, ... . To
use it with IDLEs released before November 2015, hit the 'Save as New
Custom Theme' button and enter a new name, such as 'Custom Dark'. The
custom theme will work with any IDLE release, and can be modified.
- bpo-24820: Users can now set breakpoint colors in Settings -> Custom
Highlighting. Original patch by Mark Roseman.
- bpo-24570: Idle: make calltip and completion boxes appear on Macs affected
by a tk regression. Initial patch by Mark Roseman.
- bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by
Mark Roseman.
- bpo-25198: Enhance the initial html viewer now used for Idle Help.
Properly indent fixed-pitch text (patch by Mark Roseman). Give code
snippet a very Sphinx-like light blueish-gray background. Re-use initial
width and height set by users for shell and editor. When the Table of
Contents (TOC) menu is used, put the section header at the top of the
screen.
- bpo-22820: Explain need for *print* when running file from Idle editor.
- bpo-25219: Update doc for Idle command line options. Some were missing and
notes were not correct.
- bpo-16893: Replace help.txt with help.html for Idle doc display. The new
idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks
better than help.txt and will better document Idle as released. The
tkinter html viewer that works for this file was written by Rose Roseman.
The now unused EditorWindow.HelpDialog class and helt.txt file are
deprecated.
Documentation
-------------
Tests
-----
- bpo-21916: Added tests for the turtle module. Patch by ingrid, Gregory
Loyse and Jelle Zijlstra.
- bpo-25940: Changed test_ssl to use its internal local server more. This
avoids relying on svn.python.org, which recently changed root certificate.
- bpo-18174: ``python -m test --huntrleaks ...`` now also checks for leak of
file descriptors. Patch written by Richard Oudkerk.
Build
-----
- bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier
de Gaye.
- bpo-22359: Disable the rules for running _freeze_importlib and pgen when
cross-compiling. The output of these programs is normally saved with the
source code anyway, and is still regenerated when doing a native build.
Patch by Xavier de Gaye.
- bpo-25702: A --with-lto configure option has been added that will enable
link time optimizations at build time during a make profile-opt. Some
compilers and toolchains are known to not produce stable code when using
LTO, be sure to test things thoroughly before relying on it. It can
provide a few % speed up over profile-opt alone.
- bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old
versions.
- bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern
Thiel.
- bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries.
- bpo-24324: Do not enable unreachable code warnings when using gcc as the
option does not work correctly in older versions of gcc and has been
silently removed as of gcc-4.5.
Windows
-------
Tools/Demos
-----------
- bpo-26799: Fix python-gdb.py: don't get C types once when the Python code
is loaded, but get C types on demand. The C types can change if
python-gdb.py is loaded before the Python executable. Patch written by
Thomas Ilsche.
- bpo-26271: Fix the Freeze tool to properly use flags passed through
configure. Patch by Daniel Shaulov.
C API
-----
Security
--------
Library
-------
Library
-------
Security
--------
- bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
security vulnerabilities including: CVE-2017-9233 (External entity
infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
impact Python, since Python already gets entropy from the OS to set the
expat secret using ``XML_SetHashSalt()``.
- bpo-30876: Relative import from unloaded package now reimports the package
instead of failing with SystemError. Relative import from non-package now
fails with ImportError rather than SystemError.
- bpo-27945: Fixed various segfaults with dict when input collections are
mutated during searching, inserting or comparing. Based on patches by
Duane Griffin and Tim Mitchell.
- bpo-29935: Fixed error messages in the index() method of tuple, list and
deque when pass indices of wrong type.
Library
-------
- bpo-30532: Fix email header value parser dropping folding white space in
certain cases.
- bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
with bytes-like argument.
- bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
(code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
This error occurs sometimes on SSL connections.
- bpo-29998: Pickling and copying ImportError now preserves name and path
attributes.
Documentation
-------------
Tests
-----
Windows
-------
C API
-----
Security
--------
- bpo-25677: Correct the positioning of the syntax error caret for indented
blocks. Based on patch by Michael Layzell.
- bpo-27811: Fix a crash when a coroutine that has not been awaited is
finalized with warnings-as-errors enabled.
- bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after
use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes.
- bpo-27936: The round() function accepted a second None argument for some
types but not for others. Fixed the inconsistency by accepting None for
all numeric types.
Library
-------
- bpo-29094: Offsets in a ZIP file created with extern file object and modes
"w" and "x" now are relative to the start of the file.
- bpo-28427: old keys should not remove new values from WeakValueDictionary
when collecting from another thread.
- bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
file with compression before trying to open it without compression.
Otherwise it had 50% chance failed with ignore_zeros=True.
- bpo-23262: The webbrowser module now supports Firefox 36+ and derived
browsers. Based on patch by Oleg Broytman.
- bpo-26293: Fixed writing ZIP files that starts not from the start of the
file. Offsets in ZIP file now are relative to the start of the archive in
conforming to the specification.
- Fix possible integer overflows and crashes in the mmap module with unusual
usage patterns.
- bpo-14977: mailcap now respects the order of the lines in the mailcap
files ("first match"), as required by RFC 1542. Patch by Michael Lazar.
- bpo-28047: Fixed calculation of line length used for the base64 CTE in the
new email policies.
- bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by
Claude Paroz.
- bpo-22450: urllib now includes an ``Accept: */*`` header among the default
headers. This makes the results of REST API requests more consistent and
predictable especially when proxy servers are involved.
- bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers
in the "ctypes" and "array" modules.
- bpo-22233: Break email header lines *only* on the RFC specified CR and LF
characters, not on arbitrary unicode line breaks. This also fixes a bug
in HTTP header parsing.
- bpo-27850: Remove 3DES from ssl module's default cipher list to counter
measure sweet32 attack (CVE-2016-2183).
- bpo-27758: Fix possible integer overflow in the _csv module for large
record lengths.
- bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an
error about unclean EOF.
- bpo-27238: Got rid of bare excepts in the turtle module. Original patch
by Jelle Zijlstra.
- bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
Kevin Conway.
- bpo-28652: Make loop methods reject socket kinds they do not support.
IDLE
----
- bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
- bpo-27452: add line counter and crc to IDLE configHandler test dump.
C API
-----
Documentation
-------------
Tests
-----
- bpo-23839: Various caches now are cleared before running every test file.
Tools/Demos
-----------
Windows
-------
- bpo-28251: Improvements to help manuals on Windows.
- bpo-27469: Adds a shell extension to the launcher so that drag and drop
works correctly.
Build
-----
- bpo-28066: Fix the logic that searches build directories for generated
include files when building outside the source tree.
- bpo-26307: The profile-opt build now applies PGO to the built-in modules.
- bpo-27641: The configure script now inserts comments into the makefile to
prevent the pgen and _freeze_importlib executables from being
cross-compiled.
Tests
-----
IDLE
----
Security
--------
- bpo-4806: Avoid masking the original TypeError exception when using star
(``*``) unpacking in function calls. Based on patch by Hagen Fürstenau
and Daniel Urban.
- bpo-26194: Deque.insert() gave odd results for bounded deques that had
reached their maximum size. Now an IndexError will be raised when
attempting to insert into a full deque.
- bpo-25843: When compiling code, don't merge constants if they are equal
but have a different types. For example, ``f1, f2 = lambda: 1, lambda:
1.0`` is now correctly compiled to two different functions: ``f1()``
returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``int``), even if
``1`` and ``1.0`` are equal.
- bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
- bpo-26478: Fix semantic bugs when using binary operators with dictionary
views and tuples.
Library
-------
- bpo-14132: Fix urllib.request redirect handling when the target only has a
query string. Original fix by Ján Janech.
- bpo-24838: tarfile's ustar and gnu formats now correctly calculate name
and link field limits for multibyte character encodings like utf-8.
- bpo-24266: Ctrl+C during Readline history search now cancels the search
mode when compiled with Readline 7.
- bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets.
- bpo-25718: Fixed pickling and copying the accumulate() iterator with total
is None.
- bpo-26475: Fixed debugging output for regular expressions with the (?x)
flag.
- bpo-26457: Fixed the subnets() methods in IP network classes for the case
when resulting prefix length is equal to maximal prefix length. Based on
patch by Xiang Zhang.
- bpo-26402: Fix XML-RPC client to retry when the server shuts down a
persistent connection. This was a regression related to the new
http.client.RemoteDisconnected exception in 3.5.0a4.
- bpo-26117: The os.scandir() iterator now closes file descriptor not only
when the iteration is finished, but when it was failed with error.
- bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8
encoding.
- bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer
attribute (restores backward compatibility).
- bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message
". . . is a package and cannot be directly executed" if the package could
not even be initialized (e.g. due to a bad ``*.pyc`` file).
- bpo-25177: Fixed problem with the mean of very small and very large
numbers. As a side effect, statistics.mean and statistics.variance should
be significantly faster.
- bpo-25718: Fixed copying object with state with boolean value is false.
IDLE
----
- bpo-5124: Paste with text selected now replaces the selection on X11. This
matches how paste works on Windows, Mac, most modern Linux apps, and ttk
widgets. Original patch by Serhiy Storchaka.
- bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move
code for configuring text widget colors to a new function.
- bpo-26673: When tk reports font size as 0, change to size 10. Such fonts
on Linux prevented the configuration dialog from opening.
- bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav
Heblikar.
- bpo-18410: Add test for IDLE's search dialog. Original patch by Westley
Martínez.
- bpo-21703: Add test for IDLE's undo delegator. Original patch by Saimadhav
Heblikar .
Documentation
-------------
- bpo-19489: Moved the search box from the sidebar to the header and footer
of each page. Patch by Ammar Askar.
Tests
-----
- bpo-21916: Added tests for the turtle module. Patch by ingrid, Gregory
Loyse and Jelle Zijlstra.
Build
-----
- bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier
de Gaye.
- bpo-22359: Disable the rules for running _freeze_importlib and pgen when
cross-compiling. The output of these programs is normally saved with the
source code anyway, and is still regenerated when doing a native build.
Patch by Xavier de Gaye.
- bpo-27229: Fix the cross-compiling pgen rule for in-tree builds. Patch by
Xavier de Gaye.
- bpo-25702: A --with-lto configure option has been added that will enable
link time optimizations at build time during a make profile-opt. Some
compilers and toolchains are known to not produce stable code when using
LTO, be sure to test things thoroughly before relying on it. It can
provide a few % speed up over profile-opt alone.
- bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern
Thiel.
- bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries.
- bpo-24324: Do not enable unreachable code warnings when using gcc as the
option does not work correctly in older versions of gcc and has been
silently removed as of gcc-4.5.
Windows
-------
Tools/Demos
-----------
- bpo-26799: Fix python-gdb.py: don't get C types once when the Python code
is loaded, but get C types on demand. The C types can change if
python-gdb.py is loaded before the Python executable. Patch written by
Thomas Ilsche.
- bpo-26271: Fix the Freeze tool to properly use flags passed through
configure. Patch by Daniel Shaulov.
Windows
-------
- bpo-25715: Python 3.5.1 installer shows wrong upgrade path and incorrect
logic for launcher detection.
- bpo-25462: The hash of the key now is calculated only once in most
operations in C implementation of OrderedDict.
- bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node
when compiling AST from Python objects.
- bpo-25449: Iterating OrderedDict with keys with unstable hash now raises
KeyError in C implementations as well as in Python implementation.
- bpo-25395: Fixed crash when highly nested OrderedDict structures were
garbage collected.
- bpo-25131: Make the line number and column offset of set/dict literals and
comprehensions correspond to the opening brace.
Library
-------
- bpo-18010: Fix the pydoc web server's module search function to handle
exceptions from importing packages.
- bpo-25447: The lru_cache() wrapper objects now can be copied and pickled
(by returning the original object unchanged).
- bpo-25232: Fix CGIRequestHandler to split the query from the URL at the
first question mark (?) rather than the last. Patch from Xiang Zhang.
- bpo-23144: Make sure that HTMLParser.feed() returns all the data, even
when convert_charrefs is True.
- bpo-16180: Exit pdb if file has syntax error, instead of trapping user in
an infinite loop. Patch by Xavier de Gaye.
IDLE
----
- bpo-24455: Prevent IDLE from hanging when a) closing the shell while the
debugger is active (15347); b) closing the debugger with the [X] button
(15348); and c) activating the debugger when already active (24455). The
patch by Mark Roseman does this by making two changes. 1. Suspend and
resume the gui.interaction method with the tcl vwait mechanism intended
for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow
any existing interaction to terminate first.
- bpo-24750: Improve the appearance of the IDLE editor window status bar.
Patch by Mark Roseman.
- bpo-25313: Change the handling of new built-in text color themes to better
address the compatibility problem introduced by the addition of IDLE Dark.
Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
- bpo-22726: Re-activate the config dialog help button with some content
about the other buttons and the new IDLE Dark theme.
- bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is
more or less IDLE Classic inverted, with a cobalt blue background.
Strings, comments, keywords, ... are still green, red, orange, ... . To
use it with IDLEs released before November 2015, hit the 'Save as New
Custom Theme' button and enter a new name, such as 'Custom Dark'. The
custom theme will work with any IDLE release, and can be modified.
- bpo-24820: Users can now set breakpoint colors in Settings -> Custom
Highlighting. Original patch by Mark Roseman.
- bpo-24570: Idle: make calltip and completion boxes appear on Macs affected
by a tk regression. Initial patch by Mark Roseman.
- bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by
Mark Roseman.
- bpo-25198: Enhance the initial html viewer now used for Idle Help.
Properly indent fixed-pitch text (patch by Mark Roseman). Give code
snippet a very Sphinx-like light blueish-gray background. Re-use initial
width and height set by users for shell and editor. When the Table of
Contents (TOC) menu is used, put the section header at the top of the
screen.
- bpo-22820: Explain need for *print* when running file from Idle editor.
- bpo-25219: Update doc for Idle command line options. Some were missing and
notes were not correct.
- bpo-16893: Replace help.txt with help.html for Idle doc display. The new
idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks
better than help.txt and will better document Idle as released. The
tkinter html viewer that works for this file was written by Mark Roseman.
The now unused EditorWindow.HelpDialog class and helt.txt file are
deprecated.
Documentation
-------------
Tests
-----
Build
-----
- bpo-24915: Add LLVM support for PGO builds and use the test suite to
generate the profile data. Initial patch by Alecsandru Patrascu of Intel.
Windows
-------
Tools/Demos
-----------
Build
-----
Build
-----
- bpo-24305: Prevent import subsystem stack frames from being counted by the
warnings.warn(stacklevel=) parameter.
Library
-------
Library
-------
- bpo-24667: Resize odict in all cases that the underlying dict resizes.
Library
-------
- bpo-23004: mock_open() now reads binary data correctly when the type of
read_data is bytes. Initial patch by Aaron Hill.
- bpo-23652: Make it possible to compile the select module against the libc
headers from the Linux Standard Base, which do not include some EPOLL
macros. Patch by Matt Frank.
IDLE
----
- bpo-23672: Allow Idle to edit and run files with astral chars in name.
Patch by Mohd Sanad Zaki Rizvi.
- bpo-21192: Idle editor. When a file is run, put its name in the restart
bar. Do not print false prompts. Original patch by Adnan Umer.
Documentation
-------------
- bpo-23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
Tests
-----
- bpo-24751: When running regrtest with the ``-w`` command line option, a
test run is no longer marked as a failure if all tests succeed when
re-run.
Library
-------
- bpo-22153: Improve unittest docs. Patch from Martin Panter and evilzero.
Build
-----
Library
-------
- bpo-24552: Fix use after free in an error case of the _pickle module.
- bpo-24514: tarfile now tolerates number fields consisting of only
whitespace.
Tests
-----
Documentation
-------------
Build
-----
- bpo-24284: The startswith and endswith methods of the str class no longer
return True when finding the empty string and the indexes are completely
out of range.
Library
-------
- bpo-5633: Fixed timeit when the statement is a string and the setup is
not.
- bpo-23985: Fix a possible buffer overrun when deleting a slice from the
front of a bytearray and then appending some other bytes data.
Library
-------
- bpo-24230: The tempfile module now accepts bytes for prefix, suffix and
dir parameters and returns bytes in such situations (matching the os
module APIs).
- bpo-20098: New mangle_from policy option for email, default True for
compat32, but False for all other policies.
- bpo-24211: The email library now supports RFC 6532: it can generate
headers using utf-8 instead of encoded words.
- bpo-21795: smtpd now supports the 8BITMIME extension whenever the new
*decode_data* constructor argument is set to False.
- bpo-9246: On POSIX, os.getcwd() now supports paths longer than 1025 bytes.
Patch written by William Orr.
- Fix asyncio issue 235: LifoQueue and PriorityQueue's put didn't increment
unfinished tasks (this bug was introduced when JoinableQueue was merged
with Queue).
IDLE
----
Tests
-----
- bpo-21520: test_zipfile no longer fails if the word 'bad' appears anywhere
in the name of the current directory.
Documentation
-------------
- bpo-24077: Fix typo in man page for -I command option: -s, not -S
Tools/Demos
-----------
- bpo-23726: Don't enable GC for user subclasses of non-GC types that don't
add any new fields. Patch by Eugene Toder.
Library
-------
- bpo-23529: Limit the size of decompressed data when reading from GzipFile,
BZ2File or LZMAFile. This defeats denial of service attacks using
compressed bombs (i.e. compressed payloads which decompress to a huge
size). Patch by Martin Panter and Nikolaus Rath.
- bpo-23865: close() methods in multiple modules now are idempotent and more
robust at shutdown. If they need to release multiple resources, all are
released even if errors occur.
- bpo-16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and
arbitrary precision integers added in Tcl 8.5.
- bpo-23838: linecache now clears the cache and returns an empty result on
MemoryError.
- bpo-23745: The new email header parser now handles duplicate MIME
parameter names without error, similar to how get_param behaves.
Build
-----
Tests
-----
Tools/Demos
-----------
- bpo-23944: Argument Clinic now wraps long impl prototypes at column 78.
C API
-----
Library
-------
- bpo-22687: Fixed some corner cases in breaking words in tetxtwrap. Got rid
of quadratic complexity in breaking long words.
- bpo-4727: The copy module now uses pickle protocol 4 (PEP 3154) and
supports copying of instances of classes whose __new__ method takes
keyword-only arguments.
- bpo-23657: Avoid explicit checks for str in zipapp, adding support for
pathlib.Path objects as arguments.
- bpo-23615: Modules bz2, tarfile and tokenize now can be reloaded with
imp.reload(). Patch by Thomas Kluyver.
Build
-----
Tests
-----
Tools/Demos
-----------
Library
-------
- bpo-23576: Avoid stalling in SSL reads when EOF has been reached in the
SSL layer but the underlying connection hasn't been closed.
- bpo-21619: Popen objects no longer leave a zombie after exit in the with
statement if the pipe was broken. Patch by Martin Panter.
- bpo-23215: Multibyte codecs with custom error handlers that ignores errors
consumed too much memory and raised SystemError or MemoryError. Original
patch by Aleksi Torhamo.
- bpo-5700: io.FileIO() called flush() after closing the file. flush() was
not called in close() if closefd=False.
- bpo-23374: Fixed pydoc failure with non-ASCII files when stdout encoding
differs from file system encoding (e.g. on Mac OS).
- bpo-23481: Remove RC4 from the SSL module's default cipher list.
- bpo-19105: pprint now more efficiently uses free space at the right.
- bpo-23801: Fix issue where cgi.FieldStorage did not always ignore the
entire preamble to a multipart body.
Build
-----
- bpo-23445: pydebug builds now use "gcc -Og" where possible, to make the
resulting executable faster.
C API
-----
- bpo-20204: Deprecation warning is now raised for builtin types without the
__module__ attribute.
Windows
-------
- bpo-22735: Fix many edge cases (including crashes) involving custom mro()
implementations.
- bpo-21295: Revert some changes (issue #16795) to AST line numbers and
column offsets that constituted a regression.
- bpo-22869: Move the interpreter startup & shutdown code to a new dedicated
pylifecycle.c module
- bpo-22077: Improve index error messages for bytearrays, bytes, lists, and
tuples by adding 'or slices'. Added ', not <typename>' for bytearrays.
Original patch by Claudiu Popa.
- bpo-21897: Fix a crash with the f_locals attribute with closure variables
when frame.clear() has been called.
- bpo-21418: Fix a crash in the builtin function super() when called without
argument and without current frame (ex: embedded Python).
- bpo-20355: -W command line options now have higher priority than the
PYTHONWARNINGS environment variable. Patch by Arfrever.
- bpo-21209: Fix sending tuples to custom generator objects with the yield
from syntax.
- bpo-21176: PEP 465: Add the '@' operator for matrix multiplication.
- bpo-20731: Properly position in source code files even if they are opened
in text mode. Patch by Serhiy Storchaka.
- bpo-8297: Attributes missing from modules now include the module name in
the error text. Original patch by ysj.ray.
- bpo-19995: %c, %o, %x, and %X now raise TypeError on non-integer input.
- bpo-19655: The ASDL parser - used by the build process to generate code
for managing the Python AST in C - was rewritten. The new parser is self
contained and does not require to carry long the spark.py parser-generator
library; spark.py was removed from the source base.
- bpo-8931: Make alternate formatting ('#') for type 'c' raise an exception.
In versions prior to 3.5, '#' with 'c' had no effect. Now specifying it is
an error. Patch by Torsten Landschoff.
Library
-------
- bpo-13128: Print response headers for CONNECT requests when debuglevel >
0. Patch by Demian Brecht.
- bpo-23248: Update ssl error codes from latest OpenSSL git master.
- bpo-23063: In the distutils' check command, fix parsing of reST with code
or code-block directives.
- bpo-17911: Provide a new object API for traceback, including the ability
to not lookup lines at all until the traceback is actually rendered,
without any trace of the original objects being kept alive.
- bpo-22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX
opcode if possible.
- bpo-22966: Fix __pycache__ pyc file name clobber when pyc_compile is asked
to compile a source file containing multiple dots in the source file name.
- bpo-21971: Update turtledemo doc and add module to the index.
- bpo-22902: The "ip" command is now used on Linux to determine MAC address
in uuid.getnode(). Pach by Bruno Cauet.
- bpo-22915: SAX parser now supports files opened with file descriptor or
bytes path.
- bpo-22824: Updated reprlib output format for sets to use set literals.
Patch contributed by Berker Peksag.
- bpo-8876: distutils now falls back to copying files when hard linking
doesn't work. This allows use with special filesystems such as VirtualBox
shared folders.
- bpo-18216: gettext now raises an error when a .mo file has an unsupported
major version number. Patch by Aaron Hill.
- bpo-21965: Add support for in-memory SSL to the ssl module. Patch by
Geert Jansen.
- bpo-22219: The zipfile module CLI now adds entries for directories
(including empty directories) in ZIP file.
- bpo-22508: The email.__version__ variable has been removed; the email code
is no longer shipped separately from the stdlib, and __version__ hasn't
been updated in several releases.
- bpo-23392: Added tests for marshal C API that works with FILE*.
- bpo-10510: distutils register and upload methods now use HTML standards
compliant CRLF line endings.
- bpo-4180: The warnings registries are now reset when the filters are
modified.
- bpo-21951: Fixed a crash in Tkinter on AIX when called Tcl command with
empty string or tuple argument.
- bpo-22226: First letter no longer is stripped from the "status" key in the
result of Treeview.heading().
- bpo-21933: Turtledemo users can change the code font size with a menu
selection or control(command) '-' or '+' or control-mousewheel. Original
patch by Lita Cho.
- bpo-21597: The separator between the turtledemo text pane and the drawing
canvas can now be grabbed and dragged with a mouse. The code text pane
can be widened to easily view or copy the full width of the text. The
canvas can be widened on small screens. Original patches by Jan Kanis and
Lita Cho.
- bpo-22216: smtplib now resets its state more completely after a quit. The
most obvious consequence of the previous behavior was a STARTTLS failure
during a connect/starttls/quit/connect/starttls sequence.
- bpo-22184: The functools LRU Cache decorator factory now gives an earlier
and clearer error message when the user forgets the required parameters.
- bpo-17923: glob() patterns ending with a slash no longer match non-dirs on
AIX. Based on patch by Delhallt.
- bpo-22176: Update the ctypes module's libffi to v3.1. This release adds
support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
architectures.
- bpo-5411: Added support for the "xztar" format in the shutil module.
- bpo-22127: Bypass IDNA for pure-ASCII host names in the socket module (in
particular for numeric IPs).
- bpo-21704: Fix build error for _multiprocessing when semaphores are not
available. Patch by Arfrever Frehtes Taifersar Arahesis.
- bpo-21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
- bpo-22031: Reprs now always use hexadecimal format with the "0x" prefix
when contain an id in form " at 0x...".
- bpo-21722: The distutils "upload" command now exits with a non-zero return
code when uploading fails. Patch by Martin Dengler.
- bpo-21723: asyncio.Queue: support any type of number (ex: float) for the
maximum size. Patch written by Vajrasky Kok.
- bpo-21711: support for "site-python" directories has now been removed from
the site module (it was deprecated in 3.4).
- bpo-18039: dbm.dump.open() now always creates a new database when the flag
has the value 'n'. Patch by Claudiu Popa.
- bpo-11709: Fix the pydoc.help function to not fail when sys.stdin is not a
valid file.
- bpo-21618: The subprocess module could fail to close open fds that were
inherited by the calling process and already higher than POSIX resource
limits would otherwise allow. On systems with a functioning /proc/self/fd
or /dev/fd interface the max is now ignored and all fds are closed.
- bpo-14315: The zipfile module now ignores extra fields in the central
directory that are too short to be parsed instead of letting a
struct.unpack error bubble up as this "bad data" appears in many real
world zip files in the wild and is ignored by other zip tools.
- bpo-21402: tkinter.ttk now works when default root window is not set.
- bpo-3015: _tkinter.create() now creates tkapp object with wantobject=1 by
default.
- bpo-18807: If copying (no symlinks) specified for a venv, then the python
interpreter aliases (python, python3) are now created by copying rather
than symlinking.
- bpo-20197: Added support for the WebP image type in the imghdr module.
Patch by Fabrice Aneche and Claudiu Popa.
- bpo-21538: The plistlib module now supports loading of binary plist files
when reference or offset size is not a power of two.
- bpo-21525: Most Tkinter methods which accepted tuples now accept lists
too.
- bpo-22236: Tkinter tests now don't reuse default root window. New root
window is created for every test class.
- bpo-21398: Fix a unicode error in the pydoc pager when the documentation
contains characters not encodable to the stdout encoding.
- bpo-19414: Have the OrderedDict mark deleted links as unusable. This gives
an early failure if the link is deleted during iteration.
- bpo-21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX.
- bpo-21169: getpass now handles non-ascii characters that the input stream
encoding cannot encode by re-encoding using the replace error handler.
- bpo-19505: The items, keys, and values views of OrderedDict now support
reverse iteration using reversed().
- bpo-20995: Enhance default ciphers used by the ssl module to enable better
security and prioritize perfect forward secrecy.
- bpo-19977: When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale),
:py:data:`sys.stdin` and :py:data:`sys.stdout` are now using the
``surrogateescape`` error handler, instead of the ``strict`` error
handler.
- bpo-19157: Include the broadcast address in the usuable hosts for IPv6 in
ipaddress.
- bpo-20791: copy.copy() now doesn't make a copy when the input is a bytes
object. Initial patch by Peter Otten.
- bpo-11571: Ensure that the turtle window becomes the topmost window when
launched on OS X.
IDLE
----
- bpo-16893: Update Idle doc chapter to match current Idle and add new
information.
- bpo-4832: Save As to type Python files automatically adds .py to the name
you enter (even if your system does not display it). Some systems
automatically add .txt when type is Text files.
- bpo-21986: Code objects are not normally pickled by the pickle module. To
match this, they are no longer pickled when running under Idle.
- bpo-17172: Turtledemo can now be run from Idle. Currently, the entry is on
the Help menu, but it may move to Run. Patch by Ramchandra Apt and Lita
Cho.
Build
-----
- bpo-21958: Define HAVE_ROUND when building with Visual Studio 2013 and
above. Patch by Zachary Turner.
- bpo-18093: the programs that embed the CPython runtime are now in a
separate "Programs" directory, rather than being kept in the Modules
directory.
- bpo-15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
now display special message when and only when there are failures.
- bpo-19962: The Windows build process now creates "python.bat" in the root
of the source tree, which passes all arguments through to the most
recently built interpreter.
- bpo-15234: For BerkeleyDB and Sqlite, only add the found library and
include directories if they aren't already being searched. This avoids an
explicit runtime library dependency.
- bpo-15968: Incorporated Tcl, Tk, and Tix builds into the Windows build
solution.
C API
-----
Documentation
-------------
- bpo-21514: The documentation of the json module now refers to new JSON RFC
7159 instead of obsoleted RFC 4627.
- bpo-21777: The binary sequence methods on bytes and bytearray are now
documented explicitly, rather than assuming users will be able to derive
the expected behaviour from the behaviour of the corresponding str
methods.
Tests
-----
- bpo-22838: All test_re tests now work with unittest test discovery.
- bpo-18492: All resources are now allowed when tests are not run by
regrtest.py.
- bpo-19925: Added tests for the spwd module. Original patch by Vajrasky
Kok.
- bpo-17756: Fix test_code test when run from the installed location.
- bpo-17752: Fix distutils tests when run from the installed location.
- bpo-23345: Prevent test_ssl failures with large OpenSSL patch level values
(like 0.9.8zc).
Tools/Demos
-----------
- bpo-22314: pydoc now works when the LINES environment variable is set.
- bpo-22615: Argument Clinic now supports the "type" argument for the int
converter. This permits using the int converter with enums and typedefs.
- bpo-20079: The makelocalealias.py script now can parse the SUPPORTED file
from glibc sources and supports command line options for source paths.
Windows
-------
- The bundled version of Tcl/Tk has been updated to 8.6.3. The most visible
result of this change is the addition of new native file dialogs when
running on Windows Vista or newer. See Tcl/Tk's TIP 432 for more
information. Also, this version of Tcl/Tk includes support for Windows
10.
- bpo-17896: The Windows build scripts now expect external library sources
to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``.
- bpo-17717: The Windows build scripts now use a copy of NASM pulled from
svn.python.org to build OpenSSL.
- bpo-10747: Use versioned labels in the Windows start menu. Patch by Olive
Kilburn.
- bpo-22980: .pyd files with a version and platform tag (for example,
".cp35-win32.pyd") will now be loaded in preference to those without tags.
**(For information about older versions, consult the HISTORY file.)**