.. date: 2022-12-05-01-39-10
.. gh-issue: 100001
.. nonce: uD05Fc
.. release date: 2022-12-06
.. section: Security

``python -m http.server`` no longer allows terminal control characters sent
within a garbage request to be printed to the stderr server log.

This is done by changing the :mod:`http.server`
:class:`BaseHTTPRequestHandler` ``.log_message`` method to replace control
characters with a ``\xHH`` hex escape before printing.

..

.. date: 2022-11-11-12-50-28
.. gh-issue: 87604
.. nonce: OtwH5L
.. section: Security

Avoid publishing list of active per-interpreter audit hooks via the
:mod:`gc` module

..

.. date: 2022-11-04-09-29-36
.. gh-issue: 98433
.. nonce: l76c5G
.. section: Security

The IDNA codec decoder used on DNS hostnames by :mod:`socket` or
:mod:`asyncio` related name resolution functions no longer involves a
quadratic algorithm. This prevents a potential CPU denial of service if an
out-of-spec excessive length hostname involving bidirectional characters
were decoded. Some protocols such as :mod:`urllib` http ``3xx`` redirects
potentially allow for an attacker to supply such a name.

..

.. date: 2022-10-26-21-04-23
.. gh-issue: 98739
.. nonce: keBWcY
.. section: Security

Update bundled libexpat to 2.5.0

..

.. date: 2022-09-28-12-10-57
.. gh-issue: 97612
.. nonce: y6NvOQ
.. section: Security

Fix a shell code injection vulnerability in the
``get-remote-certificate.py`` example script. The script no longer uses a
shell to run ``openssl`` commands. Issue reported and initial fix by Caleb
Shortt. Patch by Victor Stinner.

..

.. date: 2022-11-30-15-29-08
.. gh-issue: 99886
.. nonce: feJkSv
.. section: Core and Builtins

Fix a crash when an object which does not have a dictionary frees its
instance values.

..

.. date: 2022-11-30-11-09-40
.. gh-issue: 99891
.. nonce: 9VomwB
.. section: Core and Builtins

Fix a bug in the tokenizer that could cause infinite recursion when showing
syntax warnings that happen in the first line of the source. Patch by Pablo
Galindo

..

.. date: 2022-11-26-05-34-00
.. gh-issue: 99729
.. nonce: A3ovwQ
.. section: Core and Builtins

Fix an issue that could cause frames to be visible to Python code as they
are being torn down, possibly leading to memory corruption or hard crashes
of the interpreter.

..

.. date: 2022-11-21-11-27-14
.. gh-issue: 99578
.. nonce: DcKoBJ
.. section: Core and Builtins

Fix a reference bug in :func:`_imp.create_builtin()` after the creation of
the first sub-interpreter for modules ``builtins`` and ``sys``. Patch by
Victor Stinner.

..

.. date: 2022-11-19-22-27-52
.. gh-issue: 99581
.. nonce: yKYPbf
.. section: Core and Builtins

Fixed a bug that was causing a buffer overflow if the tokenizer copies a
line missing the newline caracter from a file that is as long as the
available tokenizer buffer. Patch by Pablo galindo

..

.. date: 2022-11-18-11-24-25
.. gh-issue: 99553
.. nonce: F64h-n
.. section: Core and Builtins

Fix bug where an :exc:`ExceptionGroup` subclass can wrap a
:exc:`BaseException`.

..

.. date: 2022-11-12-01-39-57
.. gh-issue: 99370
.. nonce: _cu32j
.. section: Core and Builtins

Fix zip path for venv created from a non-installed python on POSIX
platforms.

..

.. date: 2022-11-10-02-11-23
.. gh-issue: 99298
.. nonce: NeArAJ
.. section: Core and Builtins

Fix an issue that could potentially cause incorrect error handling for some
bytecode instructions.

..

.. date: 2022-11-08-16-35-25
.. gh-issue: 99205
.. nonce: 2YOoFT
.. section: Core and Builtins

Fix an issue that prevented :c:type:`PyThreadState` and
:c:type:`PyInterpreterState` memory from being freed properly.

..

.. date: 2022-11-07-10-29-41
.. gh-issue: 99181
.. nonce: bfG4bI
.. section: Core and Builtins

Fix failure in :keyword:`except* <except_star>` with unhashable exceptions.

..

.. date: 2022-11-07-08-17-12
.. gh-issue: 99204
.. nonce: Mf4hMD
.. section: Core and Builtins

Fix calculation of :data:`sys._base_executable` when inside a POSIX virtual
environment using copies of the python binary when the base installation
does not provide the executable name used by the venv. Calculation will fall
back to alternative names ("python<MAJOR>", "python<MAJOR>.<MINOR>").

..

.. date: 2022-11-06-22-59-02
.. gh-issue: 96055
.. nonce: TmQuJn
.. section: Core and Builtins

Update :mod:`faulthandler` to emit an error message with the proper
unexpected signal number. Patch by Dong-hee Na.

..

.. date: 2022-11-06-13-25-01
.. gh-issue: 99153
.. nonce: uE3CVL
.. section: Core and Builtins

Fix location of :exc:`SyntaxError` for a :keyword:`try` block with both
:keyword:`except` and :keyword:`except* <except_star>`.

..

.. date: 2022-11-06-00-17-58
.. gh-issue: 99103
.. nonce: bFA9BX
.. section: Core and Builtins

Fix the error reporting positions of specialized traceback anchors when the
source line contains Unicode characters.

..

.. date: 2022-10-31-21-01-35
.. gh-issue: 98852
.. nonce: MYaRN6
.. section: Core and Builtins

Fix subscription of type aliases containing bare generic types or types like
:class:`~typing.TypeVar`: for example ``tuple[A, T][int]`` and
``tuple[TypeVar, T][int]``, where ``A`` is a generic type, and ``T`` is a
type variable.

..

.. date: 2022-10-31-18-03-10
.. gh-issue: 98925
.. nonce: zpdjVd
.. section: Core and Builtins

Lower the recursion depth for marshal on WASI to support wasmtime 2.0/main.

..

.. date: 2022-10-28-14-52-55
.. gh-issue: 98783
.. nonce: iG0kMs
.. section: Core and Builtins

Fix multiple crashes in debug mode when ``str`` subclasses are used instead
of ``str`` itself.

..

.. date: 2022-10-21-11-28-53
.. gh-issue: 99257
.. nonce: nmcuf-
.. section: Core and Builtins

Fix an issue where member descriptors (such as those for
:attr:`~object.__slots__`) could behave incorrectly or crash instead of
raising a :exc:`TypeError` when accessed via an instance of an invalid type.

..

.. date: 2022-10-19-23-48-46
.. gh-issue: 98374
.. nonce: eOBh8M
.. section: Core and Builtins

Suppress ImportError for invalid query for help() command. Patch by Dong-hee
Na.

..

.. date: 2022-10-19-01-01-08
.. gh-issue: 98415
.. nonce: ZS2eWh
.. section: Core and Builtins

Fix detection of MAC addresses for :mod:`uuid` on certain OSs. Patch by
Chaim Sanders

..

.. date: 2022-10-15-23-15-14
.. gh-issue: 92119
.. nonce: PMSwwG
.. section: Core and Builtins

Print exception class name instead of its string representation when raising
errors from :mod:`ctypes` calls.

..

.. date: 2022-10-06-15-45-57
.. gh-issue: 96078
.. nonce: fS-6mU
.. section: Core and Builtins

:func:`os.sched_yield` now release the GIL while calling sched_yield(2).
Patch by Dong-hee Na.

..

.. date: 2022-10-06-05-41-01
.. gh-issue: 93354
.. nonce: 6BpHl2
.. section: Core and Builtins

Fix an issue that could delay the specialization of :opcode:`PRECALL`
instructions.

..

.. date: 2022-10-05-17-02-22
.. gh-issue: 97943
.. nonce: LYAWlE
.. section: Core and Builtins

Bugfix: :func:`PyFunction_GetAnnotations` should return a borrowed
reference. It was returning a new reference.

..

.. date: 2022-10-04-02-00-10
.. gh-issue: 97779
.. nonce: f3N1hI
.. section: Core and Builtins

Ensure that all Python frame objects are backed by "complete" frames.

..

.. date: 2022-10-01-08-55-09
.. gh-issue: 97591
.. nonce: pw6kkH
.. section: Core and Builtins

Fixed a missing incref/decref pair in ``Exception.__setstate__()``. Patch by
Ofey Chan.

..

.. date: 2022-09-29-15-19-29
.. gh-issue: 94526
.. nonce: wq5m6T
.. section: Core and Builtins

Fix the Python path configuration used to initialized :data:`sys.path` at
Python startup. Paths are no longer encoded to UTF-8/strict to avoid
encoding errors if it contains surrogate characters (bytes paths are decoded
with the surrogateescape error handler). Patch by Victor Stinner.

..

.. date: 2022-09-20-11-06-45
.. gh-issue: 95921
.. nonce: dkcRQn
.. section: Core and Builtins

Fix overly-broad source position information for chained comparisons used as
branching conditions.

..

.. date: 2022-09-16-16-54-35
.. gh-issue: 96387
.. nonce: GRzewg
.. section: Core and Builtins

At Python exit, sometimes a thread holding the GIL can wait forever for a
thread (usually a daemon thread) which requested to drop the GIL, whereas
the thread already exited. To fix the race condition, the thread which
requested the GIL drop now resets its request before exiting. Issue
discovered and analyzed by Mingliang ZHAO. Patch by Victor Stinner.

..

.. date: 2022-09-16-12-36-13
.. gh-issue: 96864
.. nonce: PLU3i8
.. section: Core and Builtins

Fix a possible assertion failure, fatal error, or :exc:`SystemError` if a
line tracing event raises an exception while opcode tracing is enabled.

..

.. date: 2022-09-13-12-06-46
.. gh-issue: 96678
.. nonce: NqGFyb
.. section: Core and Builtins

Fix undefined behaviour in C code of null pointer arithmetic.

..

.. date: 2022-09-12-16-58-22
.. gh-issue: 96754
.. nonce: 0GRme5
.. section: Core and Builtins

Make sure that all frame objects created are created from valid interpreter
frames. Prevents the possibility of invalid frames in backtraces and signal
handlers.

..

.. date: 2022-08-29-13-06-58
.. gh-issue: 95196
.. nonce: eGRR4b
.. section: Core and Builtins

Disable incorrect pickling of the C implemented classmethod descriptors.

..

.. date: 2022-08-15-21-08-11
.. gh-issue: 96005
.. nonce: 6eoc8k
.. section: Core and Builtins

On WASI :data:`~errno.ENOTCAPABLE` is now mapped to :exc:`PermissionError`.
The :mod:`errno` modules exposes the new error number. ``getpath.py`` now
ignores :exc:`PermissionError` when it cannot open landmark files
``pybuilddir.txt`` and ``pyenv.cfg``.

..

.. date: 2022-06-10-16-37-44
.. gh-issue: 93696
.. nonce: 65BI2R
.. section: Core and Builtins

Allow :mod:`pdb` to locate source for frozen modules in the standard
library.

..

.. bpo: 31718
.. date: 2020-02-23-23-48-15
.. nonce: sXko5e
.. section: Core and Builtins

Raise :exc:`ValueError` instead of :exc:`SystemError` when methods of
uninitialized :class:`io.IncrementalNewlineDecoder` objects are called.
Patch by Oren Milman.

..

.. bpo: 38031
.. date: 2019-09-04-19-09-49
.. nonce: Yq4L72
.. section: Core and Builtins

Fix a possible assertion failure in :class:`io.FileIO` when the opener
returns an invalid file descriptor.

..

.. date: 2022-12-05-13-40-15
.. gh-issue: 100001
.. nonce: 78ReYp
.. section: Library

Also \ escape \s in the http.server BaseHTTPRequestHandler.log_message so
that it is technically possible to parse the line and reconstruct what the
original data was.  Without this a \xHH is ambiguious as to if it is a hex
replacement we put in or the characters r"\x" came through in the original
request line.

..

.. date: 2022-12-02-13-05-00
.. gh-issue: 93453
.. nonce: EFj1NN
.. section: Library

:func:`asyncio.get_event_loop` now only emits a deprecation warning when a
new event loop was created implicitly. It no longer emits a deprecation
warning if the current event loop was set.

..

.. date: 2022-11-21-17-56-18
.. gh-issue: 51524
.. nonce: nTykx8
.. section: Library

Fix bug when calling trace.CoverageResults with valid infile.

..

.. date: 2022-11-21-13-49-03
.. gh-issue: 99645
.. nonce: 9w1QKq
.. section: Library

Fix a bug in handling class cleanups in :class:`unittest.TestCase`.  Now
``addClassCleanup()`` uses separate lists for different ``TestCase``
subclasses, and ``doClassCleanups()`` only cleans up the particular class.

..

.. date: 2022-11-15-10-55-24
.. gh-issue: 97001
.. nonce: KeQuVF
.. section: Library

Release the GIL when calling termios APIs to avoid blocking threads.

..

.. date: 2022-11-13-02-06-56
.. gh-issue: 99341
.. nonce: 8-OlwB
.. section: Library

Fix :func:`ast.increment_lineno` to also cover :class:`ast.TypeIgnore` when
changing line numbers.

..

.. date: 2022-11-12-15-45-51
.. gh-issue: 99418
.. nonce: FxfAXS
.. section: Library

Fix bug in :func:`urllib.parse.urlparse` that causes URL schemes that begin
with a digit, a plus sign, or a minus sign to be parsed incorrectly.

..

.. date: 2022-11-12-12-15-30
.. gh-issue: 99382
.. nonce: dKg_rW
.. section: Library

Check the number of arguments in substitution in user generics containing a
:class:`~typing.TypeVarTuple` and one or more :class:`~typing.TypeVar`.

..

.. date: 2022-11-12-12-10-23
.. gh-issue: 99379
.. nonce: bcGhxF
.. section: Library

Fix substitution of :class:`~typing.ParamSpec` followed by
:class:`~typing.TypeVarTuple` in generic aliases.

..

.. date: 2022-11-12-12-08-34
.. gh-issue: 99344
.. nonce: 7M_u8G
.. section: Library

Fix substitution of :class:`~typing.TypeVarTuple` and
:class:`~typing.ParamSpec` together in user generics.

..

.. date: 2022-11-09-20-48-42
.. gh-issue: 74044
.. nonce: zBj26K
.. section: Library

Fixed bug where :func:`inspect.signature` reported incorrect arguments for
decorated methods.

..

.. date: 2022-11-09-12-16-35
.. gh-issue: 99275
.. nonce: klOqoL
.. section: Library

Fix ``SystemError`` in :mod:`ctypes` when exception was not set during
``__initsubclass__``.

..

.. date: 2022-11-09-08-40-52
.. gh-issue: 99277
.. nonce: J1P44O
.. section: Library

Remove older version of ``_SSLProtocolTransport.get_write_buffer_limits`` in
:mod:`!asyncio.sslproto`

..

.. date: 2022-11-08-11-15-37
.. gh-issue: 99248
.. nonce: 1vt8xI
.. section: Library

fix negative numbers failing in verify()

..

.. date: 2022-11-06-12-44-51
.. gh-issue: 99155
.. nonce: vLZOzi
.. section: Library

Fix :class:`statistics.NormalDist` pickle with ``0`` and ``1`` protocols.

..

.. date: 2022-11-05-23-16-15
.. gh-issue: 93464
.. nonce: ucd4vP
.. section: Library

``enum.auto()`` is now correctly activated when combined with other
assignment values.  E.g. ``ONE = auto(), 'some text'`` will now evaluate as
``(1, 'some text')``.

..

.. date: 2022-11-05-17-16-40
.. gh-issue: 99134
.. nonce: Msgspf
.. section: Library

Update the bundled copy of pip to version 22.3.1.

..

.. date: 2022-11-02-05-54-02
.. gh-issue: 83004
.. nonce: 0v8iyw
.. section: Library

Clean up refleak on failed module initialisation in :mod:`_zoneinfo`

..

.. date: 2022-11-02-05-53-25
.. gh-issue: 83004
.. nonce: qc_KHr
.. section: Library

Clean up refleaks on failed module initialisation in in :mod:`_pickle`

..

.. date: 2022-11-02-05-52-36
.. gh-issue: 83004
.. nonce: LBl79O
.. section: Library

Clean up refleak on failed module initialisation in :mod:`_io`.

..

.. date: 2022-10-31-12-34-03
.. gh-issue: 98897
.. nonce: rgNn4x
.. section: Library

Fix memory leak in :func:`math.dist` when both points don't have the same
dimension. Patch by Kumar Aditya.

..

.. date: 2022-10-30-12-22-24
.. gh-issue: 98706
.. nonce: v1Kuy5
.. section: Library

[3.11] Applied changes from importlib_metadata `4.11.4 through 4.13
<https://importlib-metadata.readthedocs.io/en/latest/history.html#v4-13-0>`_,
including compatibility and robustness fixes for ``Distribution`` objects
without ``_normalized_name``, disallowing invalid inputs to
``Distribution.from_name``, and refined behaviors in
``PathDistribution._name_from_stem`` and
``PathDistribution._normalized_name``.

..

.. date: 2022-10-29-03-40-18
.. gh-issue: 98793
.. nonce: WSPB4A
.. section: Library

Fix argument typechecks in :func:`!_overlapped.WSAConnect` and
:func:`!_overlapped.Overlapped.WSASendTo` functions.

..

.. date: 2022-10-28-23-44-17
.. gh-issue: 98744
.. nonce: sGHDWm
.. section: Library

Prevent crashing in :mod:`traceback` when retrieving the byte-offset for
some source files that contain certain unicode characters.

..

.. date: 2022-10-27-12-56-38
.. gh-issue: 98740
.. nonce: ZoqqGM
.. section: Library

Fix internal error in the :mod:`re` module which in very rare circumstances
prevented compilation of a regular expression containing a :ref:`conditional
expression <re-conditional-expression>` without the "else" branch.

..

.. date: 2022-10-26-07-51-55
.. gh-issue: 98703
.. nonce: 0hW773
.. section: Library

Fix :meth:`asyncio.StreamWriter.drain` to call ``protocol.connection_lost``
callback only once on Windows.

..

.. date: 2022-10-25-20-17-34
.. gh-issue: 98624
.. nonce: YQUPFy
.. section: Library

Add a mutex to unittest.mock.NonCallableMock to protect concurrent access to
mock attributes.

..

.. date: 2022-10-23-18-30-39
.. gh-issue: 89237
.. nonce: kBui30
.. section: Library

Fix hang on Windows in ``subprocess.wait_closed()`` in :mod:`asyncio` with
:class:`~asyncio.ProactorEventLoop`. Patch by Kumar Aditya.

..

.. date: 2022-10-19-18-31-53
.. gh-issue: 98458
.. nonce: vwyq7O
.. section: Library

Fix infinite loop in unittest when a self-referencing chained exception is
raised

..

.. date: 2022-10-19-09-29-12
.. gh-issue: 97928
.. nonce: xj3im7
.. section: Library

:meth:`tkinter.Text.count` raises now an exception for options starting with
"-" instead of silently ignoring them.

..

.. date: 2022-10-16-18-52-00
.. gh-issue: 97966
.. nonce: humlhz
.. section: Library

On ``uname_result``, restored expectation that ``_fields`` and ``_asdict``
would include all six properties including ``processor``.

..

.. date: 2022-10-16-06-18-59
.. gh-issue: 98307
.. nonce: b2_CDu
.. section: Library

A :meth:`~logging.handlers.SysLogHandler.createSocket` method was added to
:class:`~logging.handlers.SysLogHandler`.

..

.. date: 2022-10-14-19-57-37
.. gh-issue: 96035
.. nonce: 0xcX-p
.. section: Library

Fix bug in :func:`urllib.parse.urlparse` that causes certain port numbers
containing whitespace, underscores, plus and minus signs, or non-ASCII
digits to be incorrectly accepted.

..

.. date: 2022-10-14-11-46-31
.. gh-issue: 98251
.. nonce: Uxc9al
.. section: Library

Allow :mod:`venv` to pass along :envvar:`PYTHON*` variables to ``ensurepip``
and ``pip`` when they do not impact path resolution

..

.. date: 2022-10-12-10-00-40
.. gh-issue: 98178
.. nonce: hspH51
.. section: Library

On macOS, fix a crash in :func:`syslog.syslog` in multi-threaded
applications. On macOS, the libc ``syslog()`` function is not thread-safe,
so :func:`syslog.syslog` no longer releases the GIL to call it. Patch by
Victor Stinner.

..

.. date: 2022-10-10-07-07-31
.. gh-issue: 96151
.. nonce: K9fwoq
.. section: Library

Allow ``BUILTINS`` to be a valid field name for frozen dataclasses.

..

.. date: 2022-10-09-12-12-38
.. gh-issue: 87730
.. nonce: ClgP3f
.. section: Library

Wrap network errors consistently in urllib FTP support, so the test suite
doesn't fail when a network is available but the public internet is not
reachable.

..

.. date: 2022-10-08-19-39-27
.. gh-issue: 98086
.. nonce: y---WC
.. section: Library

Make sure ``patch.dict()`` can be applied on async functions.

..

.. date: 2022-10-06-23-42-00
.. gh-issue: 90985
.. nonce: s280JY
.. section: Library

Earlier in 3.11 we deprecated ``asyncio.Task.cancel("message")``. We
realized we were too harsh, and have undeprecated it.

..

.. date: 2022-10-04-21-21-41
.. gh-issue: 97837
.. nonce: 19q-eg
.. section: Library

Change deprecate warning message in :mod:`unittest` from

``It is deprecated to return a value!=None``

to

``It is deprecated to return a value that is not None from a test case``

..

.. date: 2022-10-04-07-55-19
.. gh-issue: 97825
.. nonce: mNdv1l
.. section: Library

Fixes :exc:`AttributeError` when :meth:`subprocess.check_output` is used
with argument ``input=None`` and either of the arguments *encoding* or
*errors* are used.

..

.. date: 2022-10-02-12-38-22
.. gh-issue: 82836
.. nonce: OvYLmC
.. section: Library

Fix :attr:`~ipaddress.IPv4Address.is_private` properties in the
:mod:`ipaddress` module. Previously non-private networks (0.0.0.0/0) would
return True from this method; now they correctly return False.

..

.. date: 2022-09-30-15-56-20
.. gh-issue: 96827
.. nonce: lzy1iw
.. section: Library

Avoid spurious tracebacks from :mod:`asyncio` when default executor cleanup
is delayed until after the event loop is closed (e.g. as the result of a
keyboard interrupt).

..

.. date: 2022-09-29-23-22-24
.. gh-issue: 97592
.. nonce: tpJg_J
.. section: Library

Avoid a crash in the C version of
:meth:`asyncio.Future.remove_done_callback` when an evil argument is passed.

..

.. date: 2022-09-29-08-15-55
.. gh-issue: 97639
.. nonce: JSjWYW
.. section: Library

Remove ``tokenize.NL`` check from :mod:`tabnanny`.

..

.. date: 2022-09-25-20-42-33
.. gh-issue: 73588
.. nonce: uVtjEA
.. section: Library

Fix generation of the default name of :class:`tkinter.Checkbutton`.
Previously, checkbuttons in different parent widgets could have the same
short name and share the same state if arguments "name" and "variable" are
not specified. Now they are globally unique.

..

.. date: 2022-09-22-14-35-02
.. gh-issue: 97005
.. nonce: yf21Q7
.. section: Library

Update bundled libexpat to 2.4.9

..

.. date: 2022-09-22-11-50-29
.. gh-issue: 85760
.. nonce: DETTPd
.. section: Library

Fix race condition in :mod:`asyncio` where
:meth:`~asyncio.SubprocessProtocol.process_exited` called before the
:meth:`~asyncio.SubprocessProtocol.pipe_data_received` leading to
inconsistent output. Patch by Kumar Aditya.

..

.. date: 2022-09-17-13-15-10
.. gh-issue: 96819
.. nonce: 6RfqM7
.. section: Library

Fixed check in :mod:`multiprocessing.resource_tracker` that guarantees that
the length of a write to a pipe is not greater than ``PIPE_BUF``.

..

.. date: 2022-09-15-00-37-33
.. gh-issue: 96741
.. nonce: 4b6czN
.. section: Library

Corrected type annotation for dataclass attribute
``pstats.FunctionProfile.ncalls`` to be ``str``.

..

.. date: 2022-08-30-11-46-36
.. gh-issue: 95987
.. nonce: CV7_u4
.. section: Library

Fix ``repr`` of ``Any`` subclasses.

..

.. date: 2022-08-29-16-54-36
.. gh-issue: 96388
.. nonce: dCpJcu
.. section: Library

Work around missing socket functions in :class:`~socket.socket`'s
``__repr__``.

..

.. date: 2022-08-29-12-35-28
.. gh-issue: 96073
.. nonce: WaGstf
.. section: Library

In :mod:`inspect`, fix overeager replacement of "``typing.``" in formatting
annotations.

..

.. date: 2022-08-23-03-13-18
.. gh-issue: 96192
.. nonce: TJywOF
.. section: Library

Fix handling of ``bytes`` :term:`path-like objects <path-like object>` in
:func:`os.ismount()`.

..

.. date: 2022-08-20-10-31-01
.. gh-issue: 96052
.. nonce: a6FhaD
.. section: Library

Fix handling compiler warnings (SyntaxWarning and DeprecationWarning) in
:func:`codeop.compile_command` when checking for incomplete input.
Previously it emitted warnings and raised a SyntaxError. Now it always
returns ``None`` for incomplete input without emitting any warnings.

..

.. date: 2022-08-06-12-18-07
.. gh-issue: 88863
.. nonce: NnqsuJ
.. section: Library

To avoid apparent memory leaks when :func:`asyncio.open_connection` raises,
break reference cycles generated by local exception and future instances
(which has exception instance as its member var). Patch by Dong Uk, Kang.

..

.. date: 2022-07-22-09-09-08
.. gh-issue: 91212
.. nonce: 53O8Ab
.. section: Library

Fixed flickering of the turtle window when the tracer is turned off. Patch
by Shin-myoung-serp.

..

.. date: 2022-07-08-08-39-35
.. gh-issue: 88050
.. nonce: 0aOC_m
.. section: Library

Fix :mod:`asyncio` subprocess transport to kill process cleanly when process
is blocked and avoid ``RuntimeError`` when loop is closed. Patch by Kumar
Aditya.

..

.. date: 2022-06-17-12-02-30
.. gh-issue: 93858
.. nonce: R49ARc
.. section: Library

Prevent error when activating venv in nested fish instances.

..

.. date: 2022-04-23-03-46-37
.. gh-issue: 91078
.. nonce: 87-hkp
.. section: Library

:meth:`TarFile.next` now returns ``None`` when called on an empty tarfile.

..

.. bpo: 47220
.. date: 2022-04-04-22-54-11
.. nonce: L9jYu4
.. section: Library

Document the optional *callback* parameter of :class:`WeakMethod`. Patch by
Géry Ogam.

..

.. bpo: 46364
.. date: 2022-01-14-10-49-20
.. nonce: SzhlU9
.. section: Library

Restrict use of sockets instead of pipes for stdin of subprocesses created
by :mod:`asyncio` to AIX platform only.

..

.. bpo: 38523
.. date: 2020-10-23-22-20-52
.. nonce: CrkxLh
.. section: Library

:func:`shutil.copytree` now applies the *ignore_dangling_symlinks* argument
recursively.

..

.. bpo: 36267
.. date: 2019-09-03-15-45-19
.. nonce: z42Ex7
.. section: Library

Fix IndexError in :class:`argparse.ArgumentParser` when a ``store_true``
action is given an explicit argument.

..

.. date: 2022-11-16-12-52-23
.. gh-issue: 92892
.. nonce: TS-P0j
.. section: Documentation

Document that calling variadic functions with ctypes requires special care
on macOS/arm64 (and possibly other platforms).

..

.. date: 2022-10-16-17-34-45
.. gh-issue: 85525
.. nonce: DvkD0v
.. section: Documentation

Remove extra row

..

.. date: 2022-08-12-01-12-52
.. gh-issue: 95588
.. nonce: PA0FI7
.. section: Documentation

Clarified the conflicting advice given in the :mod:`ast` documentation about
:func:`ast.literal_eval` being "safe" for use on untrusted input while at
the same time warning that it can crash the process. The latter statement is
true and is deemed unfixable without a large amount of work unsuitable for a
bugfix. So we keep the warning and no longer claim that ``literal_eval`` is
safe.

..

.. bpo: 41825
.. date: 2020-09-22-12-32-16
.. nonce: npcaCb
.. section: Documentation

Restructured the documentation for the :func:`os.wait* <os.wait>` family of
functions, and improved the docs for :func:`os.waitid` with more explanation
of the possible argument constants.

..

.. date: 2022-12-05-16-12-56
.. gh-issue: 99892
.. nonce: sz_eW8
.. section: Tests

Skip test_normalization() of test_unicodedata if it fails to download
NormalizationTest.txt file from pythontest.net. Patch by Victor Stinner.

..

.. date: 2022-12-01-18-55-18
.. gh-issue: 99934
.. nonce: Ox3Fqf
.. section: Tests

Correct test_marsh on (32 bit) x86: test_deterministic sets was failing.

..

.. date: 2022-11-21-19-21-30
.. gh-issue: 99659
.. nonce: 4gP0nm
.. section: Tests

Optional big memory tests in ``test_sqlite3`` now catch the correct
:exc:`sqlite.DataError` exception type in case of too large strings and/or
blobs passed.

..

.. date: 2022-10-26-15-19-20
.. gh-issue: 98713
.. nonce: Lnu32R
.. section: Tests

Fix a bug in the :mod:`typing` tests where a test relying on
CPython-specific implementation details was not decorated with
``@cpython_only`` and was not skipped on other implementations.

..

.. date: 2022-10-15-07-46-48
.. gh-issue: 87390
.. nonce: asR-Zo
.. section: Tests

Add tests for star-unpacking with PEP 646, and some other miscellaneous PEP
646 tests.

..

.. date: 2022-10-12-14-57-06
.. gh-issue: 96853
.. nonce: ANe-bw
.. section: Tests

Added explicit coverage of ``Py_Initialize`` (and hence ``Py_InitializeEx``)
back to the embedding tests (all other embedding tests migrated to
``Py_InitializeFromConfig`` in Python 3.11)

..

.. bpo: 34272
.. date: 2018-07-29-15-59-51
.. nonce: lVX2uR
.. section: Tests

Some C API tests were moved into the new Lib/test/test_capi/ directory.

..

.. date: 2022-11-24-02-58-10
.. gh-issue: 99086
.. nonce: DV_4Br
.. section: Build

Fix ``-Wimplicit-int``, ``-Wstrict-prototypes``, and
``-Wimplicit-function-declaration`` compiler warnings in
:program:`configure` checks.

..

.. date: 2022-11-15-08-40-22
.. gh-issue: 99337
.. nonce: 5LoQDE
.. section: Build

Fix a compilation issue with GCC 12 on macOS.

..

.. date: 2022-11-04-02-58-10
.. gh-issue: 99086
.. nonce: DV_4Br
.. section: Build

Fix ``-Wimplicit-int`` compiler warning in :program:`configure` check for
``PTHREAD_SCOPE_SYSTEM``.

..

.. date: 2022-11-03-08-10-49
.. gh-issue: 98872
.. nonce: gdsR8X
.. section: Build

Fix a possible fd leak in ``Programs/_freeze_module.c`` introduced in Python
3.11.

..

.. date: 2022-11-02-19-25-07
.. gh-issue: 99016
.. nonce: R05NkD
.. section: Build

Fix build with ``PYTHON_FOR_REGEN=python3.8``.

..

.. date: 2022-11-02-18-45-35
.. gh-issue: 97731
.. nonce: zKpTlj
.. section: Build

Specify the full path to the source location for ``make docclean`` (needed
for cross-builds).

..

.. date: 2022-10-26-12-37-52
.. gh-issue: 98707
.. nonce: eVXGEx
.. section: Build

Don't use vendored ``libmpdec`` headers if :option:`--with-system-libmpdec`
is passed to :program:`configure`. Don't use vendored ``libexpat`` headers
if :option:`--with-system-expat` is passed to :program:`!configure`.

..

.. date: 2022-09-20-12-43-44
.. gh-issue: 96761
.. nonce: IF29kR
.. section: Build

Fix the build process of clang compiler for :program:`_bootstrap_python` if
LTO optimization is applied. Patch by Matthias Görgens and Dong-hee Na.

..

.. date: 2022-09-17-11-19-24
.. gh-issue: 96883
.. nonce: p_gr62
.. section: Build

``wasm32-emscripten`` builds for browsers now include
:mod:`concurrent.futures` for :mod:`asyncio` and :mod:`unittest.mock`.

..

.. date: 2022-08-26-11-09-11
.. gh-issue: 84461
.. nonce: Nsdn_R
.. section: Build

``wasm32-emscripten`` platform no longer builds :mod:`resource` module,
:func:`~os.getresuid`, :func:`~os.getresgid`, and their setters. The APIs
are stubs and not functional.

..

.. date: 2022-06-25-23-25-47
.. gh-issue: 94280
.. nonce: YhEyW_
.. section: Build

Updated pegen regeneration script on Windows to find and use Python 3.9 or
higher.  Prior to this, pegen regeneration already required 3.9 or higher,
but the script may have used lower versions of Python.

..

.. date: 2022-11-23-17-17-16
.. gh-issue: 99345
.. nonce: jOa3-f
.. section: Windows

Use faster initialization functions to detect install location for Windows
Store package

..

.. date: 2022-11-21-19-50-18
.. gh-issue: 98629
.. nonce: tMmB_B
.. section: Windows

Fix initialization of :data:`sys.version` and ``sys._git`` on Windows

..

.. date: 2022-11-16-19-03-21
.. gh-issue: 99442
.. nonce: 6Dgk3Q
.. section: Windows

Fix handling in :ref:`launcher` when ``argv[0]`` does not include a file
extension.

..

.. date: 2022-11-01-11-07-33
.. gh-issue: 98689
.. nonce: 0f6e_N
.. section: Windows

Update Windows builds to zlib v1.2.13.  v1.2.12 has CVE-2022-37434, but the
vulnerable ``inflateGetHeader`` API is not used by Python.

..

.. date: 2022-11-01-00-37-13
.. gh-issue: 98790
.. nonce: fpaPAx
.. section: Windows

Assumes that a missing ``DLLs`` directory means that standard extension
modules are in the executable's directory.

..

.. date: 2022-10-27-20-30-16
.. gh-issue: 98745
.. nonce: v06p4r
.. section: Windows

Update :file:`py.exe` launcher to install 3.11 by default and 3.12 on
request.

..

.. date: 2022-10-26-17-43-09
.. gh-issue: 98692
.. nonce: bOopfZ
.. section: Windows

Fix the :ref:`launcher` ignoring unrecognized shebang lines instead of
treating them as local paths

..

.. date: 2022-10-25-10-34-17
.. gh-issue: 94328
.. nonce: 19NhdU
.. section: Windows

Update Windows installer to use SQLite 3.39.4.

..

.. date: 2022-10-02-11-59-23
.. gh-issue: 97728
.. nonce: dIdlPE
.. section: Windows

Fix possible crashes caused by the use of uninitialized variables when pass
invalid arguments in :func:`os.system` on Windows and in Windows-specific
modules (like ``winreg``).

..

.. date: 2022-09-23-15-40-04
.. gh-issue: 96965
.. nonce: CsnEGs
.. section: Windows

Update libffi to 3.4.3

..

.. date: 2022-08-30-12-01-51
.. gh-issue: 94781
.. nonce: OxO-Gr
.. section: Windows

Fix :file:`pcbuild.proj` to clean previous instances of ouput files in
``Python\deepfreeze`` and ``Python\frozen_modules`` directories on Windows.
Patch by Charlie Zhao.

..

.. bpo: 40882
.. date: 2020-06-06-15-10-37
.. nonce: UvNbdj
.. section: Windows

Fix a memory leak in :class:`multiprocessing.shared_memory.SharedMemory` on
Windows.

..

.. date: 2022-11-25-09-23-20
.. gh-issue: 87235
.. nonce: SifjCD
.. section: macOS

On macOS ``python3 /dev/fd/9 9</path/to/script.py`` failed for any script
longer than a couple of bytes.

..

.. date: 2022-11-01-10-32-23
.. gh-issue: 98940
.. nonce: W3YzC_
.. section: macOS

Fix ``Mac/Extras.install.py`` file filter bug.

..

.. date: 2022-10-25-10-32-23
.. gh-issue: 94328
.. nonce: W3YNC_
.. section: macOS

Update macOS installer to SQLite 3.39.4.

..

.. date: 2022-10-15-21-20-40
.. gh-issue: 97527
.. nonce: otAHJM
.. section: IDLE

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.

..

.. date: 2022-08-29-17-25-13
.. gh-issue: 95853
.. nonce: Ce17cT
.. section: Tools/Demos

The ``wasm_build.py`` script now pre-builds Emscripten ports, checks for
broken EMSDK versions, and warns about pkg-config env vars.

..

.. date: 2022-08-10-17-08-43
.. gh-issue: 95853
.. nonce: HCjC2m
.. section: Tools/Demos

The new tool ``Tools/wasm/wasm_builder.py`` automates configure, compile,
and test steps for building CPython on WebAssembly platforms.

..

.. date: 2022-08-05-23-25-59
.. gh-issue: 95731
.. nonce: N2KohU
.. section: Tools/Demos

Fix handling of module docstrings in :file:`Tools/i18n/pygettext.py`.

..

.. date: 2022-12-05-17-30-13
.. gh-issue: 98680
.. nonce: FiMCxZ
.. section: C API

``PyBUF_*`` constants were marked as part of Limited API of Python 3.11+.
These were available in 3.11.0 with :c:macro:`Py_LIMITED_API` defined for
3.11, and are necessary to use the buffer API.

..

.. date: 2022-11-03-17-46-41
.. gh-issue: 98978
.. nonce: KJjBvv
.. section: C API

Fix use-after-free in ``Py_SetPythonHome(NULL)``,
``Py_SetProgramName(NULL)`` and ``_Py_SetProgramFullPath(NULL)`` function
calls. Issue reported by Benedikt Reinartz. Patch by Victor Stinner.

..

.. date: 2022-10-16-15-00-25
.. gh-issue: 96853
.. nonce: V0wiXP
.. section: C API

``Py_InitializeEx`` now correctly calls ``PyConfig_Clear`` after
initializing the interpreter (the omission didn't cause a memory leak only
because none of the dynamically allocated config fields are populated by the
wrapper function)
