.. bpo: 38945
.. date: 2019-12-01-22-44-40
.. nonce: ztmNXc
.. release date: 2019-12-09
.. section: Security

Newline characters have been escaped when performing uu encoding to prevent
them from overflowing into to content section of the encoded file. This
prevents malicious or accidental modification of data during the decoding
process.

..

.. bpo: 37228
.. date: 2019-11-21-21-36-54
.. nonce: yBZnFG
.. section: Security

Due to significant security concerns, the *reuse_address* parameter of
:meth:`asyncio.loop.create_datagram_endpoint` is no longer supported. This
is because of the behavior of ``SO_REUSEADDR`` in UDP. For more details, see
the documentation for ``loop.create_datagram_endpoint()``. (Contributed by
Kyle Stanley, Antoine Pitrou, and Yury Selivanov in :issue:`37228`.)

..

.. bpo: 38722
.. date: 2019-11-18-16-17-56
.. nonce: x3mECW
.. section: Security

:mod:`runpy` now uses :meth:`io.open_code` to open code files. Patch by
Jason Killen.

..

.. bpo: 38804
.. date: 2019-11-15-00-54-42
.. nonce: vjbM8V
.. section: Security

Fixes a ReDoS vulnerability in :mod:`http.cookiejar`. Patch by Ben Caller.

..

.. bpo: 38622
.. date: 2019-11-14-16-13-23
.. nonce: 3DYkfb
.. section: Security

Add additional audit events for the :mod:`ctypes` module.

..

.. bpo: 38418
.. date: 2019-10-08-19-29-55
.. nonce: QL7s0-
.. section: Security

Fixes audit event for :func:`os.system` to be named ``os.system``.

..

.. bpo: 38673
.. date: 2019-12-01-00-17-44
.. nonce: K_Tze-
.. section: Core and Builtins

In REPL mode, don't switch to PS2 if the line starts with comment or
whitespace. Based on work by Batuhan Taşkaya.

..

.. bpo: 38922
.. date: 2019-11-26-12-20-34
.. nonce: i6ja-i
.. section: Core and Builtins

Calling ``replace`` on a code object now raises the ``code.__new__`` audit
event.

..

.. bpo: 38920
.. date: 2019-11-26-09-16-47
.. nonce: Vx__sT
.. section: Core and Builtins

Add audit hooks for when :func:`sys.excepthook` and
:func:`sys.unraisablehook` are invoked

..

.. bpo: 38892
.. date: 2019-11-22-22-18-50
.. nonce: LS586s
.. section: Core and Builtins

Improve documentation for audit events table and functions.

..

.. bpo: 38707
.. date: 2019-11-08-00-36-10
.. nonce: SZL036
.. section: Core and Builtins

``MainThread.native_id`` is now correctly reset in child processes spawned
using :class:`multiprocessing.Process`, instead of retaining the parent's
value.

..

.. bpo: 38640
.. date: 2019-10-30-11-25-25
.. nonce: 4sAFh5
.. section: Core and Builtins

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: 38535
.. date: 2019-10-20-12-43-48
.. nonce: ESMkVN
.. section: Core and Builtins

Fixed line numbers and column offsets for AST nodes for calls without
arguments in decorators.

..

.. bpo: 38525
.. date: 2019-10-20-00-36-18
.. nonce: Vty1cA
.. section: Core and Builtins

Fix a segmentation fault when using reverse iterators of empty ``dict``
objects. Patch by Dong-hee Na and Inada Naoki.

..

.. bpo: 35409
.. date: 2019-07-13-18-01-13
.. nonce: ozbcsR
.. section: Core and Builtins

Ignore GeneratorExit exceptions when throwing an exception into the aclose
coroutine of an asynchronous generator.

..

.. bpo: 39006
.. date: 2019-12-09-14-40-09
.. nonce: v4VsPg
.. section: Library

Fix asyncio when the ssl module is missing: only check for ssl.SSLSocket
instance if the ssl module is available.

..

.. bpo: 38708
.. date: 2019-12-07-22-25-39
.. nonce: rZTUfk
.. section: Library

Fix a potential IndexError in email parser when parsing an empty msg-id.

..

.. bpo: 38698
.. date: 2019-12-07-21-49-50
.. nonce: HxoSym
.. section: Library

Add a new ``InvalidMessageID`` token to email parser to represent invalid
Message-ID headers.  Also, add defects when there is remaining value after
parsing the header.

..

.. bpo: 38979
.. date: 2019-12-07-16-32-42
.. nonce: q0sIHy
.. section: Library

Return class from ``ContextVar.__class_getitem__`` to simplify subclassing.

..

.. bpo: 38986
.. date: 2019-12-06-15-11-42
.. nonce: bg6iZt
.. section: Library

Make repr of C accelerated TaskWakeupMethWrapper the same as of pure Python
version.

..

.. bpo: 38529
.. date: 2019-12-05-16-13-25
.. nonce: yvQgx3
.. section: Library

Drop too noisy asyncio warning about deletion of a stream without explicit
``.close()`` call.

..

.. bpo: 38634
.. date: 2019-12-04-15-56-28
.. nonce: pq0ZWa
.. section: Library

The :mod:`readline` module now detects if Python is linked to libedit at
runtime on all platforms.  Previously, the check was only done on macOS.

..

.. bpo: 33684
.. date: 2019-12-04-15-28-40
.. nonce: QeSmQP
.. section: Library

Fix ``json.tool`` failed to read a JSON file with non-ASCII characters when
locale encoding is not UTF-8.

..

.. bpo: 38698
.. date: 2019-12-02-10-35-19
.. nonce: WZnAPQ
.. section: Library

Prevent UnboundLocalError to pop up in parse_message_id

parse_message_id() was improperly using a token defined inside an exception
handler, which was raising `UnboundLocalError` on parsing an invalid value.
Patch by Claudiu Popa.

..

.. bpo: 26730
.. date: 2019-11-27-16-30-02
.. nonce: 56cdBn
.. section: Library

Fix ``SpooledTemporaryFile.rollover()`` might corrupt the file when it is in
text mode. Patch by Serhiy Storchaka.

..

.. bpo: 38668
.. date: 2019-11-22-10-45-03
.. nonce: iKx23z
.. section: Library

Calling func:`shutil.copytree` to copy a directory tree from one directory
to another subdirectory resulted in an endless loop and a RecursionError. A
fix was added to consume an iterator and create the list of the entries to
be copied, avoiding the recursion for newly created directories. Patch by
Bruno P. Kinoshita.

..

.. bpo: 37838
.. date: 2019-11-21-11-39-17
.. nonce: lRFcEC
.. section: Library

:meth:`typing.get_type_hints` properly handles functions decorated with
:meth:`functools.wraps`.

..

.. bpo: 38859
.. date: 2019-11-19-16-30-46
.. nonce: AZUzL8
.. section: Library

AsyncMock now returns StopAsyncIteration on the exaustion of a side_effects
iterable. Since PEP-479 its Impossible to raise a StopIteration exception
from a coroutine.

..

.. bpo: 38857
.. date: 2019-11-19-16-28-25
.. nonce: YPUkU9
.. section: Library

AsyncMock fix for return values that are awaitable types.  This also covers
side_effect iterable values that happend to be awaitable, and wraps
callables that return an awaitable type. Before these awaitables were being
awaited instead of being returned as is.

..

.. bpo: 38821
.. date: 2019-11-16-23-26-25
.. nonce: -albNN
.. section: Library

Fix unhandled exceptions in :mod:`argparse` when internationalizing error
messages for arguments with ``nargs`` set to special (non-integer) values.
Patch by Federico Bond.

..

.. bpo: 38820
.. date: 2019-11-16-16-09-07
.. nonce: ivhUSV
.. section: Library

Make Python compatible with OpenSSL 3.0.0. :func:`ssl.SSLSocket.getpeercert`
no longer returns IPv6 addresses with a trailing new line.

..

.. bpo: 38807
.. date: 2019-11-15-09-30-29
.. nonce: PsmRog
.. section: Library

Update :exc:`TypeError` messages for :meth:`os.path.join` to include
:class:`os.PathLike` objects as acceptable input types.

..

.. bpo: 38785
.. date: 2019-11-13-16-17-43
.. nonce: NEOEfk
.. section: Library

Prevent asyncio from crashing if parent ``__init__`` is not called from a
constructor of object derived from ``asyncio.Future``.

..

.. bpo: 38723
.. date: 2019-11-12-15-46-28
.. nonce: gcdMFn
.. section: Library

:mod:`pdb` now uses :meth:`io.open_code` to trigger auditing events.

..

.. bpo: 27805
.. date: 2019-11-11-21-43-06
.. nonce: D3zl1_
.. section: Library

Allow opening pipes and other non-seekable files in append mode with
:func:`open`.

..

.. bpo: 38686
.. date: 2019-11-06-15-26-15
.. nonce: HNFBce
.. section: Library

Added support for multiple ``qop`` values in
:class:`urllib.request.AbstractDigestAuthHandler`.

..

.. bpo: 38334
.. date: 2019-10-27-00-08-49
.. nonce: pfLLmc
.. section: Library

Fixed seeking backward on an encrypted :class:`zipfile.ZipExtFile`.

..

.. bpo: 34679
.. date: 2019-10-23-16-25-12
.. nonce: Bnw8o3
.. section: Library

asynci.ProactorEventLoop.close() now only calls signal.set_wakeup_fd() in
the main thread.

..

.. bpo: 31202
.. date: 2019-10-20-12-04-48
.. nonce: NfdIus
.. section: Library

The case the result of :func:`pathlib.WindowsPath.glob` matches now the case
of the pattern for literal parts.

..

.. bpo: 38521
.. date: 2019-10-18-13-57-31
.. nonce: U-7aaM
.. section: Library

Fixed erroneous equality comparison in statistics.NormalDist().

..

.. bpo: 38478
.. date: 2019-10-15-11-37-57
.. nonce: A87OPO
.. section: Library

Fixed a bug in :meth:`inspect.signature.bind` that was causing it to fail
when handling a keyword argument with same name as positional-only
parameter. Patch by Pablo Galindo.

..

.. bpo: 33604
.. date: 2019-10-15-09-47-40
.. nonce: J12cWT
.. section: Library

Fixed `hmac.new` and `hmac.HMAC` to raise TypeError instead of ValueError
when the digestmod parameter, now required in 3.8, is omitted.  Also
clarified the hmac module documentation and docstrings.

..

.. bpo: 38422
.. date: 2019-10-09-18-16-51
.. nonce: aiM5bq
.. section: Library

Clarify docstrings of pathlib suffix(es)

..

.. bpo: 36993
.. date: 2019-07-09-05-44-39
.. nonce: 4javqu
.. section: Library

Improve error reporting for corrupt zip files with bad zip64 extra data.
Patch by Daniel Hillier.

..

.. bpo: 36820
.. date: 2019-05-06-15-34-17
.. nonce: Eh5mIB
.. section: Library

Break cycle generated when saving an exception in socket.py, codeop.py and
dyld.py as they keep alive not only the exception but user objects through
the ``__traceback__`` attribute. Patch by Mario Corchero.

..

.. bpo: 34776
.. date: 2018-09-23-14-24-37
.. nonce: 1SrQe3
.. section: Library

Fix dataclasses to support forward references in type annotations

..

.. bpo: 33348
.. date: 2018-04-24-13-18-48
.. nonce: XaJDei
.. section: Library

lib2to3 now recognizes expressions after ``*`` and `**` like in ``f(*[] or
[])``.

..

.. bpo: 27657
.. date: 2017-12-26-14-32-23
.. nonce: 6BhyVK
.. section: Library

Fix urllib.parse.urlparse() with numeric paths. A string like "path:80" is
no longer parsed as a path but as a scheme ("path") and a path ("80").

..

.. bpo: 38816
.. date: 2019-11-15-11-39-13
.. nonce: vUaSVL
.. section: Documentation

Provides more details about the interaction between :c:func:`fork` and
CPython's runtime, focusing just on the C-API.  This includes cautions about
where :c:func:`fork` should and shouldn't be called.

..

.. bpo: 38351
.. date: 2019-11-15-09-22-28
.. nonce: xwhlse
.. section: Documentation

Modernize :mod:`email` examples from %-formatting to f-strings.

..

.. bpo: 38778
.. date: 2019-11-12-15-31-09
.. nonce: PHhTlv
.. section: Documentation

Document the fact that :exc:`RuntimeError` is raised if :meth:`os.fork` is
called in a subinterpreter.

..

.. bpo: 38592
.. date: 2019-10-26-13-19-07
.. nonce: Y96BYO
.. section: Documentation

Add Brazilian Portuguese to the language switcher at Python Documentation
website.

..

.. bpo: 38547
.. date: 2019-12-09-11-32-34
.. nonce: Juw54e
.. section: Tests

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: 38992
.. date: 2019-12-08-15-11-06
.. nonce: cVoHOZ
.. section: Tests

Fix a test for :func:`math.fsum` that was failing due to constant folding.

..

.. bpo: 38965
.. date: 2019-12-04-17-08-55
.. nonce: yqax3m
.. section: Tests

Fix test_faulthandler on GCC 10. Use the "volatile" keyword in
``faulthandler._stack_overflow()`` to prevent tail call optimization on any
compiler, rather than relying on compiler specific pragma.

..

.. bpo: 38875
.. date: 2019-11-21-09-11-06
.. nonce: wSZJal
.. section: Tests

test_capi: trashcan tests now require the test "cpu" resource.

..

.. bpo: 38841
.. date: 2019-11-20-16-08-19
.. nonce: 5F5Lbw
.. section: Tests

Skip asyncio test_create_datagram_endpoint_existing_sock_unix on platforms
lacking a functional bind() for named unix domain sockets.

..

.. bpo: 38669
.. date: 2019-11-04-02-54-16
.. nonce: pazXZ8
.. section: Tests

Raise :exc:`TypeError` when passing target as a string with
:meth:`unittest.mock.patch.object`.

..

.. bpo: 35998
.. date: 2019-10-16-01-36-15
.. nonce: G305Bf
.. section: Tests

Fix a race condition in test_asyncio.test_start_tls_server_1(). Previously,
there was a race condition between the test main() function which replaces
the protocol and the test ServerProto protocol which sends ANSWER once it
gets HELLO. Now, only the test main() function is responsible to send data,
ServerProto no longer sends data.

..

.. bpo: 37404
.. date: 2019-12-01-21-45-24
.. nonce: cNsA7S
.. section: Build

:mod:`asyncio` now raises :exc:`TyperError` when calling incompatible
methods with an :class:`ssl.SSLSocket` socket.  Patch by Ido Michael.

..

.. bpo: 38809
.. date: 2019-11-15-09-25-44
.. nonce: 9jwta6
.. section: Build

On Windows, build scripts will now recognize and use python.exe from an
active virtual env.

..

.. bpo: 38684
.. date: 2019-11-04-14-30-37
.. nonce: aed593
.. section: Build

Fix _hashlib build when Blake2 is disabled, but OpenSSL supports it.

..

.. bpo: 37415
.. date: 2019-10-11-15-32-58
.. nonce: D9RXrq
.. section: Build

Fix stdatomic.h header check for ICC compiler: the ICC implementation lacks
atomic_uintptr_t type which is needed by Python.

..

.. bpo: 33125
.. date: 2019-11-14-08-57-50
.. nonce: EN5MWS
.. section: Windows

Add support for building and releasing Windows ARM64 packages.

..

.. bpo: 38589
.. date: 2019-10-28-10-48-16
.. nonce: V69Q1a
.. section: Windows

Fixes HTML Help shortcut when Windows is not installed to C drive

..

.. bpo: 38453
.. date: 2019-10-28-10-32-43
.. nonce: NwwatW
.. section: Windows

Ensure ntpath.realpath() correctly resolves relative paths.

..

.. bpo: 38519
.. date: 2019-10-28-05-01-29
.. nonce: dCkY66
.. section: Windows

Restores the internal C headers that were missing from the nuget.org and
Microsoft Store packages.

..

.. bpo: 38492
.. date: 2019-10-16-09-49-09
.. nonce: Te1LxC
.. section: Windows

Remove ``pythonw.exe`` dependency on the Microsoft C++ runtime.

..

.. bpo: 37931
.. date: 2019-08-23-12-14-34
.. nonce: goYgQj
.. section: macOS

Fixed a crash on OSX dynamic builds that occurred when re-initializing the
posix module after a Py_Finalize if the environment had changed since the
previous `import posix`. Patch by Benoît Hudson.

..

.. bpo: 38862
.. date: 2019-11-23-21-50-57
.. nonce: KQ9A0m
.. section: IDLE

'Strip Trailing Whitespace' on the Format menu removes extra newlines at the
end of non-shell files.

..

.. bpo: 26353
.. date: 2019-11-09-23-55-59
.. nonce: duYZiF
.. section: IDLE

Stop adding newline when saving an IDLE shell window.

..

.. bpo: 38636
.. date: 2019-10-30-22-11-16
.. nonce: hUhDeB
.. section: IDLE

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.

..

.. bpo: 4630
.. date: 2019-10-28-04-48-03
.. nonce: upgjiV
.. section: IDLE

Add an option to toggle IDLE's cursor blink for shell, editor, and output
windows.  See Settings, General, Window Preferences, Cursor Blink. Patch by
Zachary Spytz.

..

.. bpo: 38598
.. date: 2019-10-26-18-16-24
.. nonce: 6kH9FY
.. section: IDLE

Do not try to compile IDLE shell or output windows

..

.. bpo: 37633
.. date: 2019-11-04-21-10-47
.. nonce: oOGVdo
.. section: C API

Re-export some function compatibility wrappers for macros in ``pythonrun.h``.

..

.. bpo: 38540
.. date: 2019-10-21-09-24-03
.. nonce: 314N_T
.. section: C API

Fixed possible leak in :c:func:`PyArg_Parse` and similar functions for
format units ``"es#"`` and ``"et#"`` when the macro
:c:macro:`PY_SSIZE_T_CLEAN` is not defined.

..

.. bpo: 36389
.. date: 2019-10-07-17-15-09
.. nonce: hFX_jD
.. section: C API

The ``_PyObject_CheckConsistency()`` function is now also available in
release mode. For example, it can be used to debug a crash in the
``visit_decref()`` function of the GC.
