.. bpo: 41180
.. date: 2021-06-29-23-40-22
.. nonce: uTWHv_
.. release date: 2021-07-10
.. section: Security

Add auditing events to the :mod:`marshal` module, and stop raising
``code.__init__`` events for every unmarshalled code object. Directly
instantiated code objects will continue to raise an event, and audit event
handlers should inspect or collect the raw marshal data. This reduces a
significant performance overhead when loading from ``.pyc`` files.

..

.. bpo: 44562
.. date: 2021-07-04-23-38-51
.. nonce: QdeRQo
.. section: Core and Builtins

Remove uses of :c:func:`PyObject_GC_Del` in error path when initializing
:class:`types.GenericAlias`.

..

.. bpo: 41486
.. date: 2021-07-04-17-41-47
.. nonce: DiM24a
.. section: Core and Builtins

Fix a memory consumption and copying performance regression in earlier 3.10
beta releases if someone used an output buffer larger than 4GiB with
zlib.decompress on input data that expands that large.

..

.. bpo: 44553
.. date: 2021-07-02-22-54-41
.. nonce: l9YqGg
.. section: Core and Builtins

Implement GC methods for ``types.Union`` to break reference cycles and
prevent memory leaks.

..

.. bpo: 44523
.. date: 2021-06-29-11-49-29
.. nonce: 67-ZIP
.. section: Core and Builtins

Remove the pass-through for :func:`hash` of :class:`weakref.proxy` objects
to prevent unintended consequences when the original referred object dies
while the proxy is part of a hashable object. Patch by Pablo Galindo.

..

.. bpo: 44483
.. date: 2021-06-22-19-08-19
.. nonce: eq2f7T
.. section: Core and Builtins

Fix a crash in ``types.Union`` objects when creating a union of an object
with bad ``__module__`` field.

..

.. bpo: 44297
.. date: 2021-06-19-12-41-13
.. nonce: F53vHj
.. section: Core and Builtins

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
.. date: 2021-06-18-22-08-25
.. nonce: L0Rhko
.. section: Core and Builtins

Improve the syntax error when mixing positional and keyword patterns. Patch
by Pablo Galindo.

..

.. bpo: 44368
.. date: 2021-06-09-22-56-59
.. nonce: vgT0Cx
.. section: Core and Builtins

Improve syntax errors for invalid "as" targets. Patch by Pablo Galindo

..

.. bpo: 44317
.. date: 2021-06-06-00-29-14
.. nonce: xPPhcZ
.. section: Core and Builtins

Improve tokenizer error with improved locations. Patch by Pablo Galindo.

..

.. bpo: 43667
.. date: 2021-05-27-17-34-29
.. nonce: ND9jP3
.. section: Core and Builtins

Improve Unicode support in non-UTF locales on Oracle Solaris. This issue
does not affect other Solaris systems.

..

.. bpo: 44558
.. date: 2021-07-04-21-16-53
.. nonce: cm7Slv
.. section: Library

Make the implementation consistency of :func:`~operator.indexOf` between C
and Python versions. Patch by Dong-hee Na.

..

.. bpo: 34798
.. date: 2021-06-30-13-29-49
.. nonce: t7FCa0
.. section: Library

Break up paragraph about :class:`pprint.PrettyPrinter` construction
parameters to make it easier to read.

..

.. bpo: 44516
.. date: 2021-06-26-12-27-14
.. nonce: BVyX_y
.. section: Library

Update vendored pip to 21.1.3

..

.. bpo: 44468
.. date: 2021-06-23-19-02-00
.. nonce: -klV5-
.. section: Library

:func:`typing.get_type_hints` now finds annotations in classes and base
classes with unexpected ``__module__``. Previously, it skipped those MRO
elements.

..

.. bpo: 43977
.. date: 2021-06-22-16-45-48
.. nonce: bamAGF
.. section: Library

Set the proper :const:`Py_TPFLAGS_MAPPING` and :const:`Py_TPFLAGS_SEQUENCE`
flags for subclasses created before a parent has been registered as a
:class:`collections.abc.Mapping` or :class:`collections.abc.Sequence`.

..

.. bpo: 44482
.. date: 2021-06-22-08-43-04
.. nonce: U9GznK
.. section: Library

Fix very unlikely resource leak in :mod:`glob` in alternate Python
implementations.

..

.. bpo: 44466
.. date: 2021-06-21-12-43-04
.. nonce: NSm6mv
.. section: Library

The :mod:`faulthandler` module now detects if a fatal error occurs during a
garbage collector collection. Patch by Victor Stinner.

..

.. bpo: 44404
.. date: 2021-06-20-19-01-11
.. nonce: McfrYB
.. section: Library

:mod:`tkinter`'s ``after()`` method now supports callables without the
``__name__`` attribute.

..

.. bpo: 44458
.. date: 2021-06-20-07-14-46
.. nonce: myqCQ0
.. section: Library

``BUFFER_BLOCK_SIZE`` is now declared static, to avoid linking collisions
when bz2, lmza or zlib are statically linked.

..

.. bpo: 44464
.. date: 2021-06-19-21-52-27
.. nonce: U2oa-a
.. section: Library

Remove exception for flake8 in deprecated importlib.metadata interfaces.
Sync with importlib_metadata 4.6.

..

.. bpo: 44446
.. date: 2021-06-17-22-39-34
.. nonce: qwdRic
.. section: Library

Take into account that ``lineno`` might be ``None`` in
:class:`traceback.FrameSummary`.

..

.. bpo: 44439
.. date: 2021-06-17-15-01-51
.. nonce: 1S7QhT
.. section: Library

Fix in :meth:`bz2.BZ2File.write` / :meth:`lzma.LZMAFile.write` methods, when
the input data is an object that supports the buffer protocol, the file
length may be wrong.

..

.. bpo: 44434
.. date: 2021-06-16-16-52-14
.. nonce: SQS4Pg
.. section: Library

_thread.start_new_thread() no longer calls PyThread_exit_thread() explicitly
at the thread exit, the call was redundant. On Linux with the glibc,
pthread_exit() aborts the whole process if dlopen() fails to open
libgcc_s.so file (ex: EMFILE error). Patch by Victor Stinner.

..

.. bpo: 44395
.. date: 2021-06-12-10-08-14
.. nonce: PcW6Sx
.. section: Library

Fix :meth:`~email.message.MIMEPart.as_string` to pass unixfrom properly.
Patch by Dong-hee Na.

..

.. bpo: 34266
.. date: 2021-06-10-21-53-46
.. nonce: k3fxnm
.. section: Library

Handle exceptions from parsing the arg of :mod:`pdb`'s run/restart command.

..

.. bpo: 44077
.. date: 2021-05-13-19-44-38
.. nonce: 04b2a4
.. section: Library

It's now possible to receive the type of service (ToS), a.k.a.
differentiated services (DS), a.k.a. differenciated services code point
(DSCP) and excplicit congestion notification (ECN) IP header fields with
``socket.IP_RECVTOS``.

..

.. bpo: 43024
.. date: 2021-01-25-21-24-55
.. nonce: vAUrIi
.. section: Library

Improve the help signature of :func:`traceback.print_exception`,
:func:`traceback.format_exception` and
:func:`traceback.format_exception_only`.

..

.. bpo: 30256
.. date: 2019-09-25-13-54-41
.. nonce: wBkzox
.. section: Library

Pass multiprocessing BaseProxy argument ``manager_owned`` through AutoProxy.

..

.. bpo: 44558
.. date: 2021-07-03-18-25-17
.. nonce: 0pTknl
.. section: Documentation

Match the docstring and python implementation of :func:`~operator.countOf`
to the behavior of its c implementation.

..

.. bpo: 38062
.. date: 2021-06-28-12-13-48
.. nonce: 9Ehp9O
.. section: Documentation

Clarify that atexit uses equality comparisons internally.

..

.. bpo: 40620
.. date: 2021-06-26-17-41-06
.. nonce: PAYDrB
.. section: Documentation

Convert examples in tutorial controlflow.rst section 4.3 to be
interpreter-demo style.

..

.. bpo: 13814
.. date: 2021-06-21-15-46-32
.. nonce: LDcslu
.. section: Documentation

In the Design FAQ, answer "Why don't generators support the with statement?"

..

.. bpo: 41621
.. date: 2020-08-24-13-35-04
.. nonce: nqaw9G
.. section: Documentation

Document that :class:`collections.defaultdict` parameter ``default_factory``
defaults to None and is positional-only.

..

.. bpo: 44287
.. date: 2021-06-21-17-53-41
.. nonce: YON57s
.. section: Tests

Fix asyncio test_popen() of test_windows_utils by using a longer timeout.
Use military grade battle-tested :data:`test.support.SHORT_TIMEOUT` timeout
rather than a hardcoded timeout of 10 seconds: it's 30 seconds by default,
but it is made longer on slow buildbots. Patch by Victor Stinner.

..

.. bpo: 44451
.. date: 2021-06-18-15-19-35
.. nonce: aj5pqE
.. section: Tests

Reset ``DeprecationWarning`` filters in
``test.test_importlib.test_metadata_api.APITests.test_entry_points_by_index``
to avoid ``StopIteration`` error if ``DeprecationWarnings`` are ignored.

..

.. bpo: 30256
.. date: 2019-09-25-18-10-10
.. nonce: A5i76Q
.. section: Tests

Add test for nested queues when using ``multiprocessing`` shared objects
``AutoProxy[Queue]`` inside ``ListProxy`` and ``DictProxy``

..

.. bpo: 44535
.. date: 2021-06-30-02-32-46
.. nonce: M9iN4-
.. section: Build

Enable building using a Visual Studio 2022 install on Windows.

..

.. bpo: 43298
.. date: 2021-06-19-11-50-03
.. nonce: 9ircMb
.. section: Build

Improved error message when building without a Windows SDK installed.

..

.. bpo: 44582
.. date: 2021-07-07-21-07-18
.. nonce: 4Mm6Hh
.. section: Windows

Accelerate speed of :mod:`mimetypes` initialization using a native
implementation of the registry scan.

..

.. bpo: 41299
.. date: 2021-06-06-16-36-13
.. nonce: Rg-vb_
.. section: Windows

Fix 16ms jitter when using timeouts in :mod:`threading`, such as with
:meth:`threading.Lock.acquire` or :meth:`threading.Condition.wait`.

..

.. bpo: 44441
.. date: 2021-06-23-12-12-04
.. nonce: 3p14JB
.. section: C API

:c:func:`Py_RunMain` now resets :c:data:`PyImport_Inittab` to its initial
value at exit. It must be possible to call :c:func:`PyImport_AppendInittab`
or :c:func:`PyImport_ExtendInittab` at each Python initialization. Patch by
Victor Stinner.

..

.. bpo: 40939
.. date: 2021-06-22-17-00-06
.. nonce: CGB0I5
.. section: C API

Removed documentation for the removed ``PyParser_*`` C API.
