cpython/Misc/NEWS.d/3.12.0a7.rst

746 lines
16 KiB
ReStructuredText
Raw Normal View History

2023-04-04 12:51:44 -03:00
.. date: 2023-03-31-12-22-25
.. gh-issue: 102192
.. nonce: gYxJP_
.. release date: 2023-04-04
.. section: Core and Builtins
Deprecated ``_PyErr_ChainExceptions`` in favour of
``_PyErr_ChainExceptions1``.
..
.. date: 2023-03-24-02-50-33
.. gh-issue: 89987
.. nonce: oraTzh
.. section: Core and Builtins
Reduce the number of inline :opcode:`CACHE` entries for
:opcode:`BINARY_SUBSCR`.
..
.. date: 2023-03-21-00-46-36
.. gh-issue: 102859
.. nonce: PRkGca
.. section: Core and Builtins
Removed :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!JUMP_IF_TRUE_OR_POP`
2023-04-04 12:51:44 -03:00
instructions.
..
.. date: 2023-03-18-02-36-39
.. gh-issue: 101975
.. nonce: HwMR1d
.. section: Core and Builtins
Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage
collection.
..
.. date: 2023-03-17-13-43-34
.. gh-issue: 102778
.. nonce: ANDv8I
.. section: Core and Builtins
Add :data:`sys.last_exc` and deprecate :data:`sys.last_type`,
:data:`sys.last_value` and :data:`sys.last_traceback`, which hold the same
information in its legacy form.
..
.. date: 2023-03-17-12-09-45
.. gh-issue: 100982
.. nonce: Pf_BI6
.. section: Core and Builtins
Replace all occurrences of ``COMPARE_AND_BRANCH`` with :opcode:`COMPARE_OP`.
..
.. date: 2023-03-16-17-24-44
.. gh-issue: 102701
.. nonce: iNGVaS
.. section: Core and Builtins
Fix overflow when creating very large dict.
..
.. date: 2023-03-16-14-44-29
.. gh-issue: 102755
.. nonce: j1GxlV
.. section: Core and Builtins
Add :c:func:`PyErr_DisplayException` which takes just an exception instance,
to replace the legacy :c:func:`PyErr_Display` which takes the ``(typ, exc,
tb)`` triplet.
..
.. date: 2023-03-14-00-11-46
.. gh-issue: 102594
.. nonce: BjU-m2
.. section: Core and Builtins
Add note to exception raised in ``PyErr_SetObject`` when normalization
fails.
..
.. date: 2023-03-09-13-57-35
.. gh-issue: 90997
.. nonce: J-Yhn2
.. section: Core and Builtins
Shrink the number of inline :opcode:`CACHE` entries used by
:opcode:`LOAD_GLOBAL`.
..
.. date: 2023-03-08-08-37-36
.. gh-issue: 102491
.. nonce: SFvvsC
.. section: Core and Builtins
Improve import time of ``platform`` by removing IronPython version parsing.
The IronPython version parsing was not functional (see
https://github.com/IronLanguages/ironpython3/issues/1667).
..
.. date: 2023-03-06-10-02-22
.. gh-issue: 101291
.. nonce: 0FT2QS
.. section: Core and Builtins
Rearrage bits in first field (after header) of PyLongObject. * Bits 0 and 1:
1 - sign. I.e. 0 for positive numbers, 1 for zero and 2 for negative
numbers. * Bit 2 reserved (probably for the immortal bit) * Bits 3+ the
unsigned size.
This makes a few operations slightly more efficient, and will enable a more
compact and faster 2s-complement representation of most ints in future.
..
.. date: 2023-03-04-06-48-34
.. gh-issue: 102397
.. nonce: ACJaOf
.. section: Core and Builtins
Fix segfault from race condition in signal handling during garbage
collection. Patch by Kumar Aditya.
..
.. date: 2023-03-03-23-21-16
.. gh-issue: 102406
.. nonce: XLqYO3
.. section: Core and Builtins
:mod:`codecs` encoding/decoding errors now get the context information
(which operation and which codecs) attached as :pep:`678` notes instead of
through chaining a new instance of the exception.
..
.. date: 2023-03-02-13-49-21
.. gh-issue: 102281
.. nonce: QCuu2N
.. section: Core and Builtins
Fix potential nullptr dereference and use of uninitialized memory in
fileutils. Patch by Max Bachmann.
..
.. date: 2023-02-27-15-48-31
.. gh-issue: 102300
.. nonce: 8o-_Mt
.. section: Core and Builtins
Reuse operands with refcount of 1 in float specializations of BINARY_OP.
..
.. date: 2023-02-26-13-12-55
.. gh-issue: 102213
.. nonce: fTH8X7
.. section: Core and Builtins
Fix performance loss when accessing an object's attributes with
``__getattr__`` defined.
..
.. date: 2023-02-26-11-43-56
.. gh-issue: 102255
.. nonce: cRnI5x
.. section: Core and Builtins
Improve build support for the Xbox. Patch by Max Bachmann.
..
.. date: 2023-02-21-23-42-39
.. gh-issue: 102027
.. nonce: fQARG0
.. section: Core and Builtins
Fix SSE2 and SSE3 detection in ``_blake2`` internal module. Patch by Max
Bachmann.
..
.. date: 2023-02-21-17-22-06
.. gh-issue: 101865
.. nonce: fwrTOA
.. section: Core and Builtins
Deprecate ``co_lnotab`` in code objects, schedule it for removal in Python
3.14
..
.. bpo: 1635741
.. date: 2020-07-04-09-04-41
.. nonce: ZsP31Y
.. section: Core and Builtins
Adapt :mod:`!_pickle` to :pep:`687`. Patch by Mohamed Koubaa and Erlend
Aasland.
..
.. date: 2023-03-28-15-12-53
.. gh-issue: 103085
.. nonce: DqNehf
.. section: Library
Pure python :func:`locale.getencoding()` will not warn deprecation.
..
.. date: 2023-03-28-05-14-59
.. gh-issue: 103068
.. nonce: YQTmrA
.. section: Library
It's no longer possible to register conditional breakpoints in
:class:`~pdb.Pdb` that raise :exc:`SyntaxError`. Patch by Tian Gao.
..
.. date: 2023-03-27-19-21-51
.. gh-issue: 102549
.. nonce: NQ6Nlv
.. section: Library
Don't ignore exceptions in member type creation.
..
.. date: 2023-03-27-15-01-16
.. gh-issue: 103056
.. nonce: -Efh5Q
.. section: Library
Ensure final ``_generate_next_value_`` is a ``staticmethod``.
..
.. date: 2023-03-26-20-54-57
.. gh-issue: 103046
.. nonce: xBlA2l
.. section: Library
Display current line label correctly in :mod:`dis` when ``show_caches`` is
False and ``lasti`` points to a CACHE entry.
..
.. date: 2023-03-25-16-57-18
.. gh-issue: 102433
.. nonce: L-7x2Q
.. section: Library
:func:`isinstance` checks against :func:`runtime-checkable protocols
<typing.runtime_checkable>` now use :func:`inspect.getattr_static` rather
than :func:`hasattr` to lookup whether attributes exist. This means that
descriptors and :meth:`~object.__getattr__` methods are no longer
unexpectedly evaluated during ``isinstance()`` checks against
runtime-checkable protocols. However, it may also mean that some objects
which used to be considered instances of a runtime-checkable protocol may no
longer be considered instances of that protocol on Python 3.12+, and vice
versa. Most users are unlikely to be affected by this change. Patch by Alex
Waygood.
..
.. date: 2023-03-25-02-08-05
.. gh-issue: 103023
.. nonce: Qfn7Hl
.. section: Library
It's no longer possible to register expressions to display in
:class:`~pdb.Pdb` that raise :exc:`SyntaxError`. Patch by Tian Gao.
..
.. date: 2023-03-23-13-34-33
.. gh-issue: 102947
.. nonce: cTwcpU
.. section: Library
Improve traceback when :func:`dataclasses.fields` is called on a
non-dataclass. Patch by Alex Waygood
..
.. date: 2023-03-22-16-15-18
.. gh-issue: 102780
.. nonce: NEcljy
.. section: Library
The :class:`asyncio.Timeout` context manager now works reliably even when
performing cleanup due to task cancellation. Previously it could raise a
:exc:`~asyncio.CancelledError` instead of an :exc:`~asyncio.TimeoutError` in
such cases.
..
.. date: 2023-03-21-15-17-07
.. gh-issue: 102871
.. nonce: U9mchn
.. section: Library
Remove support for obsolete browsers from :mod:`webbrowser`. Removed
browsers include Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape,
Firebird, and Firefox versions 35 and below.
..
.. date: 2023-03-20-12-21-19
.. gh-issue: 102839
.. nonce: RjRi12
.. section: Library
Improve performance of :func:`math.log` arguments handling by removing the
argument clinic.
..
.. date: 2023-03-19-15-30-59
.. gh-issue: 102828
.. nonce: NKClXg
.. section: Library
Add the ``onexc`` arg to :func:`shutil.rmtree`, which is like ``onerror``
but expects an exception instance rather than an exc_info tuple. Deprecate
``onerror``.
..
.. date: 2023-03-18-14-59-21
.. gh-issue: 88965
.. nonce: kA70Km
.. section: Library
typing: Fix a bug relating to substitution in custom classes generic over a
:class:`~typing.ParamSpec`. Previously, if the ``ParamSpec`` was substituted
with a parameters list that itself contained a :class:`~typing.TypeVar`, the
``TypeVar`` in the parameters list could not be subsequently substituted.
This is now fixed.
Patch by Nikita Sobolev.
..
.. date: 2023-03-17-19-14-26
.. gh-issue: 76846
.. nonce: KEamjK
.. section: Library
Fix issue where ``__new__()`` and ``__init__()`` methods of
:class:`pathlib.PurePath` and :class:`~pathlib.Path` subclasses were not
called in some circumstances.
..
.. date: 2023-03-16-16-43-04
.. gh-issue: 78530
.. nonce: Lr8eq_
.. section: Library
:func:`asyncio.wait` now accepts generators yielding tasks. Patch by Kumar
Aditya.
..
.. date: 2023-03-16-08-17-29
.. gh-issue: 102748
.. nonce: WNACpI
.. section: Library
:func:`asyncio.iscoroutine` now returns ``False`` for generators as
:mod:`asyncio` does not support legacy generator-based coroutines. Patch by
Kumar Aditya.
..
.. date: 2023-03-13-18-27-00
.. gh-issue: 102670
.. nonce: GyoThv
.. section: Library
Optimized fmean(), correlation(), covariance(), and linear_regression()
using the new math.sumprod() function.
..
.. date: 2023-03-13-12-05-55
.. gh-issue: 102615
.. nonce: NcA_ZL
.. section: Library
Typing: Improve the ``repr`` of generic aliases for classes generic over a
:class:`~typing.ParamSpec`. (Use square brackets to represent a parameter
list.)
..
.. date: 2023-03-10-13-51-21
.. gh-issue: 100112
.. nonce: VHh4mw
.. section: Library
:meth:`asyncio.Task.get_coro` now always returns a coroutine when wrapping
an awaitable object. Patch by Kumar Aditya.
..
.. date: 2023-03-10-13-21-16
.. gh-issue: 102578
.. nonce: -gujoI
.. section: Library
Speed up setting or deleting mutable attributes on non-dataclass subclasses
of frozen dataclasses. Due to the implementation of ``__setattr__`` and
``__delattr__`` for frozen dataclasses, this previously had a time
complexity of *O*\ (*n*). It now has a time complexity of *O*\ (1).
2023-04-04 12:51:44 -03:00
..
.. date: 2023-03-08-23-08-38
.. gh-issue: 102519
.. nonce: wlcsFI
.. section: Library
Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts`
functions on Windows for enumerating drives, volumes and mount points
..
.. date: 2023-03-04-20-58-29
.. gh-issue: 74468
.. nonce: Ac5Ew_
.. section: Library
Attribute name of the extracted :mod:`tarfile` file object now holds
filename of itself rather than of the archive it is contained in. Patch by
Oleg Iarygin.
..
.. date: 2023-03-03-19-53-08
.. gh-issue: 102378
.. nonce: kRdOZc
.. section: Library
Private helper method ``inspect._signature_strip_non_python_syntax`` will no
longer strip ``/`` from the input string.
..
.. date: 2023-02-26-17-29-57
.. gh-issue: 79940
.. nonce: SAfmAy
.. section: Library
Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals`.
Patch by Thomas Krennwallner.
..
.. date: 2023-02-21-11-56-16
.. gh-issue: 102103
.. nonce: Dj0WEj
.. section: Library
Add ``module`` argument to :func:`dataclasses.make_dataclass` and make
classes produced by it pickleable.
..
.. date: 2023-02-20-16-47-56
.. gh-issue: 102069
.. nonce: FS7f1j
.. section: Library
Fix ``__weakref__`` descriptor generation for custom dataclasses.
..
.. date: 2023-02-19-01-49-46
.. gh-issue: 102038
.. nonce: n3if3D
.. section: Library
Skip a ``stat`` in :mod:`site` if we have already found a ``pyvenv.cfg``
..
.. date: 2023-02-18-23-03-50
.. gh-issue: 98886
.. nonce: LkKGWv
.. section: Library
Fix issues when defining dataclasses that have fields with specific
underscore names that aren't clearly reserved by :mod:`dataclasses`.
..
.. date: 2023-02-09-19-40-41
.. gh-issue: 101673
.. nonce: mX-Ppq
.. section: Library
Fix a :mod:`pdb` bug where ``ll`` clears the changes to local variables.
..
.. date: 2023-01-27-14-51-07
.. gh-issue: 101313
.. nonce: 10AEXh
.. section: Library
Added -h and --help arguments to the webbrowser CLI
..
.. date: 2022-12-20-10-55-14
.. gh-issue: 100372
.. nonce: utfP65
.. section: Library
:meth:`ssl.SSLContext.load_verify_locations` no longer incorrectly accepts
some cases of trailing data when parsing DER.
..
.. date: 2022-12-16-10-27-58
.. gh-issue: 89727
.. nonce: y64ZLM
.. section: Library
Fix pathlib.Path.walk RecursionError on deep directory trees by rewriting it
using iteration instead of recursion.
..
.. date: 2022-12-09-11-21-38
.. gh-issue: 100131
.. nonce: v863yR
.. section: Library
Added an optional ``delete`` keyword argument to
:class:`tempfile.TemporaryDirectory`.
..
.. date: 2022-11-24-13-23-07
.. gh-issue: 48330
.. nonce: 6uAX9F
.. section: Library
Added ``--durations`` command line option, showing the N slowest test cases.
:class:`unittest.TextTestRunner` and :class:`unittest.TextTestResult`
constructors accept a new *durations* keyword argument. Subclasses should
take this into account or accept ``**kwargs``. Added
:meth:`unittest.TestResult.addDuration` method and
:attr:`unittest.TestResult.collectedDurations` attribute.
(Contributed by Giampaolo Rodola)
..
.. date: 2022-10-10-19-14-51
.. gh-issue: 98169
.. nonce: DBWIxL
.. section: Library
Fix :func:`dataclasses.astuple` crash when :class:`collections.defaultdict`
is present in the attributes.
..
.. date: 2022-09-19-08-12-58
.. gh-issue: 96931
.. nonce: x0WQhh
.. section: Library
Fix incorrect results from :meth:`ssl.SSLSocket.shared_ciphers`
..
.. date: 2022-07-30-23-01-43
.. gh-issue: 95495
.. nonce: RA-q1d
.. section: Library
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
2023-04-04 12:51:44 -03:00
specify the previous OpenSSL 3.0 behavior.
..
.. date: 2022-07-09-13-07-30
.. gh-issue: 94684
.. nonce: nV5yno
.. section: Library
Now :func:`uuid.uuid3` and :func:`uuid.uuid5` functions support
:class:`bytes` objects as their *name* argument.
..
.. date: 2022-06-30-21-28-41
.. gh-issue: 94440
.. nonce: LtgX0d
.. section: Library
Fix a :mod:`concurrent.futures.process` bug where ``ProcessPoolExecutor``
shutdown could hang after a future has been quickly submitted and canceled.
..
.. date: 2022-04-11-18-34-33
.. gh-issue: 72346
.. nonce: pC7gnM
.. section: Library
Added deprecation warning to *isdst* parameter of
:func:`email.utils.localtime`.
..
.. bpo: 36305
.. date: 2019-03-15-22-50-27
.. nonce: Pbkv6u
.. section: Library
Fix handling of Windows filenames that resemble drives, such as ``./a:b``,
in :mod:`pathlib`.
..
.. date: 2023-03-29-14-51-39
.. gh-issue: 103112
.. nonce: XgGSEO
.. section: Documentation
Add docstring to :meth:`http.client.HTTPResponse.read` to fix ``pydoc``
output.
..
.. date: 2023-03-23-23-25-18
.. gh-issue: 102980
.. nonce: Zps4QF
.. section: Tests
Improve test coverage on :mod:`pdb`.
..
.. date: 2023-03-08-13-54-20
.. gh-issue: 102537
.. nonce: Vfplpb
.. section: Tests
Adjust the error handling strategy in
``test_zoneinfo.TzPathTest.python_tzpath_context``. Patch by Paul Ganssle.
..
.. date: 2023-01-27-18-10-40
.. gh-issue: 101377
.. nonce: IJGpqh
.. section: Tests
Improved test_locale_calendar_formatweekday of calendar.
..
.. date: 2023-03-23-20-58-56
.. gh-issue: 102973
.. nonce: EaJUrw
.. section: Build
Add a dev container (along with accompanying Dockerfile) for development
purposes.
..
.. date: 2023-03-15-02-03-39
.. gh-issue: 102711
.. nonce: zTkjts
.. section: Build
Fix ``-Wstrict-prototypes`` compiler warnings.
..
.. date: 2023-03-14-10-52-43
.. gh-issue: 102690
.. nonce: sbXtqk
.. section: Windows
Update :mod:`webbrowser` to fall back to Microsoft Edge instead of Internet
Explorer.
..
.. date: 2023-02-22-17-26-10
.. gh-issue: 99726
.. nonce: 76t957
.. section: Windows
Improves correctness of stat results for Windows, and uses faster API when
available
..
.. date: 2023-03-21-01-27-07
.. gh-issue: 102809
.. nonce: 2F1Byz
.. section: Tools/Demos
``Misc/gdbinit`` was removed.
..
.. date: 2023-02-18-00-55-14
.. gh-issue: 102013
.. nonce: 83mrtI
.. section: C API
Add a new (unstable) C-API function for iterating over GC'able objects using
a callback: ``PyUnstable_VisitObjects``.