diff --git a/Doc/c-api/extension-modules.rst b/Doc/c-api/extension-modules.rst index 6c5287faa9770f..92b531665e135d 100644 --- a/Doc/c-api/extension-modules.rst +++ b/Doc/c-api/extension-modules.rst @@ -29,7 +29,7 @@ and must be named after the module name plus an extension listed in Extension export hook ..................... -.. versionadded:: next +.. versionadded:: 3.15 Support for the :samp:`PyModExport_{}` export hook was added in Python 3.15. The older way of defining modules is still available: consult either @@ -191,7 +191,7 @@ the :c:data:`Py_mod_multiple_interpreters` slot. ``PyInit`` function ................... -.. deprecated:: next +.. deprecated:: 3.15 This functionality is :term:`soft deprecated`. It will not get new features, but there are no plans to remove it. @@ -272,7 +272,7 @@ For example, a module called ``spam`` would be defined like this:: Legacy single-phase initialization ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. deprecated:: next +.. deprecated:: 3.15 Single-phase initialization is :term:`soft deprecated`. It is a legacy mechanism to initialize extension diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index 0608d45f7c2a26..22f8b1309aa38b 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -142,7 +142,7 @@ Modules created using the C API are typically defined using an array of :dfn:`slots`. The slots provide a "description" of how a module should be created. -.. versionchanged:: next +.. versionchanged:: 3.15 Previously, a :c:type:`PyModuleDef` struct was necessary to define modules. The older way of defining modules is still available: consult either the @@ -190,7 +190,7 @@ Metadata slots However, it is still recommended to include this slot for introspection and debugging purposes. - .. versionadded:: next + .. versionadded:: 3.15 Use :c:member:`PyModuleDef.m_name` instead to support previous versions. @@ -201,7 +201,7 @@ Metadata slots Usually it is set to a variable created with :c:macro:`PyDoc_STRVAR`. - .. versionadded:: next + .. versionadded:: 3.15 Use :c:member:`PyModuleDef.m_doc` instead to support previous versions. @@ -332,7 +332,7 @@ Creation and initialization slots .. versionadded:: 3.5 - .. versionchanged:: next + .. versionchanged:: 3.15 The *slots* argument may be a ``ModuleSpec``-like object, rather than a true :py:class:`~importlib.machinery.ModuleSpec` instance. @@ -365,7 +365,7 @@ Creation and initialization slots .. versionadded:: 3.5 - .. versionchanged:: next + .. versionchanged:: 3.15 Repeated ``Py_mod_exec`` slots are disallowed, except in :c:type:`PyModuleDef.m_slots`. @@ -384,7 +384,7 @@ Creation and initialization slots The table must be statically allocated (or otherwise guaranteed to outlive the module object). - .. versionadded:: next + .. versionadded:: 3.15 Use :c:member:`PyModuleDef.m_methods` instead to support previous versions. @@ -434,7 +434,7 @@ To retrieve the state from a given module, use the following functions: On error, set *\*result* to -1, and return -1 with an exception set. - .. versionadded:: next + .. versionadded:: 3.15 @@ -459,7 +459,7 @@ defining the module state. Use :c:func:`PyModule_GetStateSize` to retrieve the size of a given module. - .. versionadded:: next + .. versionadded:: 3.15 Use :c:member:`PyModuleDef.m_size` instead to support previous versions. @@ -482,7 +482,7 @@ defining the module state. (:c:data:`Py_mod_state_size`) is greater than 0 and the module state (as returned by :c:func:`PyModule_GetState`) is ``NULL``. - .. versionadded:: next + .. versionadded:: 3.15 Use :c:member:`PyModuleDef.m_size` instead to support previous versions. @@ -510,7 +510,7 @@ defining the module state. the cyclic garbage collector is not involved and the :c:macro:`Py_mod_state_free` function is called directly. - .. versionadded:: next + .. versionadded:: 3.15 Use :c:member:`PyModuleDef.m_clear` instead to support previous versions. @@ -532,7 +532,7 @@ defining the module state. (:c:data:`Py_mod_state_size`) is greater than 0 and the module state (as returned by :c:func:`PyModule_GetState`) is ``NULL``. - .. versionadded:: next + .. versionadded:: 3.15 Use :c:member:`PyModuleDef.m_free` instead to support previous versions. @@ -593,7 +593,7 @@ A module's token -- and the *your_token* value to use in the above code -- is: This means that :c:macro:`!Py_mod_token` cannot be used in :c:member:`PyModuleDef.m_slots`. - .. versionadded:: next + .. versionadded:: 3.15 .. c:function:: int PyModule_GetToken(PyObject *module, void** result) @@ -601,7 +601,7 @@ A module's token -- and the *your_token* value to use in the above code -- is: On error, set *\*result* to NULL, and return -1 with an exception set. - .. versionadded:: next + .. versionadded:: 3.15 See also :c:func:`PyType_GetModuleByToken`. @@ -641,7 +641,7 @@ rather than from an extension's :ref:`export hook `. :c:func:`!PyModule_FromSlotsAndSpec` call. In particular, it may be heap-allocated. - .. versionadded:: next + .. versionadded:: 3.15 .. c:function:: int PyModule_Exec(PyObject *module) @@ -654,7 +654,7 @@ rather than from an extension's :ref:`export hook `. :ref:`legacy single-phase initialization `, this function does nothing and returns 0. - .. versionadded:: next + .. versionadded:: 3.15 diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index 76971c46c1696b..3e0cc660317ba9 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -111,7 +111,7 @@ Object Protocol object type name: str object repr : 'abcdef' - .. versionadded:: next + .. versionadded:: 3.15 .. c:function:: int PyObject_HasAttrWithError(PyObject *o, PyObject *attr_name) diff --git a/Doc/c-api/tuple.rst b/Doc/c-api/tuple.rst index d0add48d7e8457..3e3752696c46d8 100644 --- a/Doc/c-api/tuple.rst +++ b/Doc/c-api/tuple.rst @@ -148,8 +148,11 @@ Tuple Objects Struct Sequence Objects ----------------------- -Struct sequence objects are the C equivalent of :func:`~collections.namedtuple` -objects, i.e. a sequence whose items can also be accessed through attributes. +A struct sequence object is a :term:`named tuple`, that is, a sequence +whose items can also be accessed through attributes. +It is similar to :func:`collections.namedtuple`, but provides a slightly +different interface. + To create a struct sequence, you first have to create a specific struct sequence type. diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index 1f57cc04f5dc27..8cadf26cee3027 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -317,7 +317,7 @@ Type Objects and other places where a method's defining class cannot be passed using the :c:type:`PyCMethod` calling convention. - .. versionadded:: next + .. versionadded:: 3.15 .. c:function:: PyObject* PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def) diff --git a/Doc/deprecations/pending-removal-in-3.20.rst b/Doc/deprecations/pending-removal-in-3.20.rst index 4a6a6c3c43a722..185f20fbc6d125 100644 --- a/Doc/deprecations/pending-removal-in-3.20.rst +++ b/Doc/deprecations/pending-removal-in-3.20.rst @@ -23,6 +23,7 @@ Pending removal in Python 3.20 - :mod:`tabnanny` - :mod:`tkinter.font` - :mod:`tkinter.ttk` + - :mod:`wsgiref.simple_server` - :mod:`zlib` (Contributed by Hugo van Kemenade and Stan Ulbrych in :gh:`76007`.) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index a4066d42927f64..3a01df99c38caf 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -813,7 +813,7 @@ Glossary :func:`itertools.groupby`. There are several ways to create a key function. For example. the - :meth:`str.lower` method can serve as a key function for case insensitive + :meth:`str.casefold` method can serve as a key function for case insensitive sorts. Alternatively, a key function can be built from a :keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. Also, :func:`operator.attrgetter`, :func:`operator.itemgetter`, and diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 70dd342ab66a47..5cfe047d746f68 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -1370,7 +1370,7 @@ behavior:: >>> parser.parse_args('--foo XXX'.split()) Namespace(bar='XXX') -.. versionchanged:: next +.. versionchanged:: 3.15 Single-dash long option now takes precedence over short options. @@ -1473,7 +1473,7 @@ this API may be passed as the ``action`` parameter to .. versionadded:: 3.9 - .. versionchanged:: next + .. versionchanged:: 3.15 Added support for single-dash options. Added support for alternate prefix_chars_. diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index 621aa23ecc8057..376bcc7aaf9eb2 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -34,10 +34,12 @@ The :mod:`decimal` module provides support for fast correctly rounded decimal floating-point arithmetic. It offers several advantages over the :class:`float` datatype: -* Decimal "is based on a floating-point model which was designed with people - in mind, and necessarily has a paramount guiding principle -- computers must - provide an arithmetic that works in the same way as the arithmetic that - people learn at school." -- excerpt from the decimal arithmetic specification. +* Decimal "is based on a `floating-point model + `__ which was designed + with people in mind, and necessarily has a paramount guiding principle -- + computers must provide an arithmetic that works in the same way as the + arithmetic that people learn at school." -- excerpt from the decimal + arithmetic specification. * Decimal numbers can be represented exactly. In contrast, numbers like ``1.1`` and ``2.2`` do not have exact representations in binary @@ -238,6 +240,26 @@ floating-point flying circus: >>> c % a Decimal('0.77') +Decimals can be formatted (with :func:`format` built-in or :ref:`f-strings`) in +fixed-point or scientific notation, using the same formatting syntax (see +:ref:`formatspec`) as builtin :class:`float` type: + +.. doctest:: + + >>> format(Decimal('2.675'), "f") + '2.675' + >>> format(Decimal('2.675'), ".2f") + '2.68' + >>> f"{Decimal('2.675'):.2f}" + '2.68' + >>> format(Decimal('2.675'), ".2e") + '2.68e+0' + >>> with localcontext() as ctx: + ... ctx.rounding = ROUND_DOWN + ... print(format(Decimal('2.675'), ".2f")) + ... + 2.67 + And some mathematical functions are also available to Decimal: >>> getcontext().prec = 28 diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index b5e3a84b4556dd..f3aca1ba49257b 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -742,8 +742,8 @@ depending on the system error code. .. attribute:: characters_written - An integer containing the number of characters written to the stream - before it blocked. This attribute is available when using the + An integer containing the number of **bytes** written to the stream + before it blocked. This attribute is available when using the buffered I/O classes from the :mod:`io` module. .. exception:: ChildProcessError diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst index 79a8c38626f002..0e041b5395ec93 100644 --- a/Doc/library/gc.rst +++ b/Doc/library/gc.rst @@ -118,7 +118,7 @@ The :mod:`gc` module provides the following functions: .. versionadded:: 3.4 - .. versionchanged:: next + .. versionchanged:: 3.15 Add ``duration`` and ``candidates``. @@ -340,7 +340,7 @@ values but should not rebind them): .. versionadded:: 3.3 - .. versionchanged:: next + .. versionchanged:: 3.15 Add "duration" and "candidates". diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 08cb1770d7a22e..e4b5b6831fa0b2 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -210,7 +210,7 @@ Functions :exc:`ModuleNotFoundError` is raised when the module being reloaded lacks a :class:`~importlib.machinery.ModuleSpec`. - .. versionchanged:: next + .. versionchanged:: 3.15 If *module* is a lazy module that has not yet been materialized (i.e., loaded via :class:`importlib.util.LazyLoader` and not yet accessed), calling :func:`reload` is a no-op and returns the module unchanged. diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index 94fc046d3f3c46..ce025670c92999 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -48,8 +48,19 @@ The :mod:`locale` module defines the following exception and functions: If *locale* is omitted or ``None``, the current setting for *category* is returned. + Example:: + + >>> import locale + >>> loc = locale.setlocale(locale.LC_ALL) # get current locale + # use German locale; name and availability varies with platform + >>> locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8') + >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut + >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale + >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale + >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale + :func:`setlocale` is not thread-safe on most systems. Applications typically - start with a call of :: + start with a call of:: import locale locale.setlocale(locale.LC_ALL, '') @@ -580,18 +591,6 @@ The :mod:`locale` module defines the following exception and functions: :func:`localeconv`. -Example:: - - >>> import locale - >>> loc = locale.getlocale() # get current locale - # use German locale; name might vary with platform - >>> locale.setlocale(locale.LC_ALL, 'de_DE') - >>> locale.strcoll('f\xe4n', 'foo') # compare a string containing an umlaut - >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale - >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale - >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale - - Background, details, hints, tips and caveats -------------------------------------------- diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index c90e30ccf4fb8a..3cfe08a1fe1f7a 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -57,8 +57,9 @@ the :mod:`glob` module.) .. function:: abspath(path) Return a normalized absolutized version of the pathname *path*. On most - platforms, this is equivalent to calling the function :func:`normpath` as - follows: ``normpath(join(os.getcwd(), path))``. + platforms, this is equivalent to calling ``normpath(join(os.getcwd(), path))``. + + .. seealso:: :func:`os.path.join` and :func:`os.path.normpath`. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -243,6 +244,8 @@ the :mod:`glob` module.) begins with a slash, on Windows that it begins with two (back)slashes, or a drive letter, colon, and (back)slash together. + .. seealso:: :func:`abspath` + .. versionchanged:: 3.6 Accepts a :term:`path-like object`. @@ -357,14 +360,28 @@ the :mod:`glob` module.) concatenation of *path* and all members of *\*paths*, with exactly one directory separator following each non-empty part, except the last. That is, the result will only end in a separator if the last part is either empty or - ends in a separator. If a segment is an absolute path (which on Windows - requires both a drive and a root), then all previous segments are ignored and - joining continues from the absolute path segment. + ends in a separator. + + If a segment is an absolute path (which on Windows requires both a drive and + a root), then all previous segments are ignored and joining continues from the + absolute path segment. On Linux, for example:: + + >>> os.path.join('/home/foo', 'bar') + '/home/foo/bar' + >>> os.path.join('/home/foo', '/home/bar') + '/home/bar' On Windows, the drive is not reset when a rooted path segment (e.g., ``r'\foo'``) is encountered. If a segment is on a different drive or is an - absolute path, all previous segments are ignored and the drive is reset. Note - that since there is a current directory for each drive, + absolute path, all previous segments are ignored and the drive is reset. For + example:: + + >>> os.path.join('c:\\', 'foo') + 'c:\\foo' + >>> os.path.join('c:\\foo', 'd:\\bar') + 'd:\\bar' + + Note that since there is a current directory for each drive, ``os.path.join("c:", "foo")`` represents a path relative to the current directory on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\foo`. @@ -527,8 +544,8 @@ the :mod:`glob` module.) *path* is empty, both *head* and *tail* are empty. Trailing slashes are stripped from *head* unless it is the root (one or more slashes only). In all cases, ``join(head, tail)`` returns a path to the same location as *path* - (but the strings may differ). Also see the functions :func:`dirname` and - :func:`basename`. + (but the strings may differ). Also see the functions :func:`join`, + :func:`dirname` and :func:`basename`. .. versionchanged:: 3.6 Accepts a :term:`path-like object`. diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst index 780cc77340366a..0449682585c8d0 100644 --- a/Doc/library/readline.rst +++ b/Doc/library/readline.rst @@ -252,7 +252,7 @@ Startup hooks function has been set. This function only exists if Python was compiled for a version of the library that supports it. - .. versionadded:: next + .. versionadded:: 3.15 .. _readline-completion: diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index b16cde34ec1ef5..743d768bfa1f49 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -482,7 +482,7 @@ The AF_* and SOCK_* constants are now :class:`AddressFamily` and .. versionchanged:: 3.14 Added support for ``TCP_QUICKACK`` on Windows platforms when available. - .. versionchanged:: next + .. versionchanged:: 3.15 ``IPV6_HDRINCL`` was added. diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 5cfa888706f9b9..f33b73238ec8b3 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -164,7 +164,7 @@ This table summarizes the comparison operations: pair: object; numeric pair: objects; comparing -Objects of different types, except different numeric types, never compare equal. +Unless stated otherwise, objects of different types never compare equal. The ``==`` operator is always defined but for some object types (for example, class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, ``>`` and ``>=`` operators are only defined where they make sense; for example, they raise a @@ -2261,6 +2261,19 @@ expression support in the :mod:`re` module). done using the specified *fillchar* (default is an ASCII space). The original string is returned if *width* is less than or equal to ``len(s)``. + For example: + + .. doctest:: + + >>> 'Python'.ljust(10) + 'Python ' + >>> 'Python'.ljust(10, '.') + 'Python....' + >>> 'Monty Python'.ljust(10, '.') + 'Monty Python' + + See also :meth:`rjust`. + .. method:: str.lower() @@ -5087,9 +5100,6 @@ can be used interchangeably to index the same dictionary entry. being added is already present, the value from the keyword argument replaces the value from the positional argument. - Providing keyword arguments as in the first example only works for keys that - are valid Python identifiers. Otherwise, any valid keys can be used. - Dictionaries compare equal if and only if they have the same ``(key, value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', '>') raise :exc:`TypeError`. To illustrate dictionary creation and equality, diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 58c836c7382330..e3ad018d1d073b 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -546,6 +546,9 @@ The available presentation types for :class:`float` and | | :class:`float`, and shows all coefficient digits | | | for :class:`~decimal.Decimal`. If ``p=0``, the decimal | | | point is omitted unless the ``#`` option is used. | + | | | + | | For :class:`float`, the exponent always contains at | + | | least two digits, and is zero if the value is zero. | +---------+----------------------------------------------------------+ | ``'E'`` | Scientific notation. Same as ``'e'`` except it uses | | | an upper case 'E' as the separator character. | diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 97f55acf00d521..d92972117a31f1 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -2640,7 +2640,7 @@ Notes on using *__slots__*: of the iterator's values. However, the *__slots__* attribute will be an empty iterator. -.. versionchanged:: next +.. versionchanged:: 3.15 Allowed defining the *__dict__* and *__weakref__* *__slots__* for any class. diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst index dff0fe036ea53a..af055d35290429 100644 --- a/Doc/using/configure.rst +++ b/Doc/using/configure.rst @@ -344,7 +344,7 @@ General Options "_tkinter": "Install the python-tk package to use tkinter", } - .. versionadded:: next + .. versionadded:: 3.15 .. option:: --enable-pystats diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index a67b7153e238de..24a51f87c0f410 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -1040,6 +1040,7 @@ New deprecations - :mod:`tabnanny` - :mod:`tkinter.font` - :mod:`tkinter.ttk` + - :mod:`wsgiref.simple_server` - :mod:`zlib` (Contributed by Hugo van Kemenade and Stan Ulbrych in :gh:`76007`.) diff --git a/Include/patchlevel.h b/Include/patchlevel.h index 804aa1a0427ba9..90a73c8f2b1ecc 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -24,10 +24,10 @@ #define PY_MINOR_VERSION 15 #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA -#define PY_RELEASE_SERIAL 2 +#define PY_RELEASE_SERIAL 3 /* Version as a string */ -#define PY_VERSION "3.15.0a2+" +#define PY_VERSION "3.15.0a3+" /*--end constants--*/ diff --git a/InternalDocs/interpreter.md b/InternalDocs/interpreter.md index 38e9f6fced6088..75acdf596a7f30 100644 --- a/InternalDocs/interpreter.md +++ b/InternalDocs/interpreter.md @@ -226,10 +226,11 @@ Up through 3.10, the call stack was implemented as a singly-linked list of heap allocation for the stack frame. Since 3.11, frames are no longer fully-fledged objects. Instead, a leaner internal -`_PyInterpreterFrame` structure is used, which is allocated using a custom allocator -function (`_PyThreadState_BumpFramePointer()`), which allocates and initializes a -frame structure. Usually a frame allocation is just a pointer bump, which improves -memory locality. +`_PyInterpreterFrame` structure is used. Most frames are allocated contiguously in a +per-thread stack (see `_PyThreadState_PushFrame` in [Python/pystate.c](../Python/pystate.c)), +which improves memory locality and reduces overhead. +If the current `datastack_chunk` has enough space (`_PyThreadState_HasStackSpace`) +then the lightweight `_PyFrame_PushUnchecked` can be used instead of `_PyThreadState_PushFrame`. Sometimes an actual `PyFrameObject` is needed, such as when Python code calls `sys._getframe()` or an extension module calls diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py index 11ffc6bf3a1bb5..2f19e84d2e47e5 100644 --- a/Lib/pydoc_data/topics.py +++ b/Lib/pydoc_data/topics.py @@ -1,4 +1,4 @@ -# Autogenerated by Sphinx on Tue Nov 18 16:51:09 2025 +# Autogenerated by Sphinx on Tue Dec 16 14:26:04 2025 # as part of the release process. topics = { @@ -865,9 +865,9 @@ class to a new value, *value*. renders the meaning of the program undefined. In the future, a check may be added to prevent this. -* "TypeError" will be raised if nonempty *__slots__* are defined for a - class derived from a ""variable-length" built-in type" such as - "int", "bytes", and "tuple". +* "TypeError" will be raised if *__slots__* other than *__dict__* and + *__weakref__* are defined for a class derived from a ""variable- + length" built-in type" such as "int", "bytes", and "tuple". * Any non-string *iterable* may be assigned to *__slots__*. @@ -887,6 +887,9 @@ class derived from a ""variable-length" built-in type" such as * If an *iterator* is used for *__slots__* then a *descriptor* is created for each of the iterator’s values. However, the *__slots__* attribute will be an empty iterator. + +Changed in version 3.15.0a2 (unreleased): Allowed defining the +*__dict__* and *__weakref__* *__slots__* for any class. ''', 'attribute-references': r'''Attribute references ******************** @@ -2112,7 +2115,7 @@ class with multiple inheritance will raise an error if one of the ... except* BlockingIOError as e: ... print(repr(e)) ... - ExceptionGroup('', (BlockingIOError())) + ExceptionGroup('', (BlockingIOError(),)) "break", "continue" and "return" cannot appear in an "except*" clause. @@ -2784,7 +2787,7 @@ def foo(): If only keyword patterns are present, they are processed as follows, one by one: - I. The keyword is looked up as an attribute on the subject. + 1. The keyword is looked up as an attribute on the subject. * If this raises an exception other than "AttributeError", the exception bubbles up. @@ -2796,14 +2799,14 @@ def foo(): the class pattern fails; if this succeeds, the match proceeds to the next keyword. - II. If all keyword patterns succeed, the class pattern succeeds. + 2. If all keyword patterns succeed, the class pattern succeeds. If any positional patterns are present, they are converted to keyword patterns using the "__match_args__" attribute on the class "name_or_attr" before matching: - I. The equivalent of "getattr(cls, "__match_args__", ())" is - called. + 1. The equivalent of "getattr(cls, "__match_args__", ())" is + called. * If this raises an exception, the exception bubbles up. @@ -2824,9 +2827,9 @@ def foo(): Customizing positional arguments in class pattern matching - II. Once all positional patterns have been converted to keyword - patterns, - the match proceeds as if there were only keyword patterns. + 2. Once all positional patterns have been converted to keyword + patterns, the match proceeds as if there were only keyword + patterns. For the following built-in types the handling of positional subpatterns is different: @@ -6020,7 +6023,9 @@ class of the instance or a *non-virtual base class* thereof. The | | With no precision given, uses a precision of "6" digits | | | after the decimal point for "float", and shows all | | | coefficient digits for "Decimal". If "p=0", the decimal | - | | point is omitted unless the "#" option is used. | + | | point is omitted unless the "#" option is used. For | + | | "float", the exponent always contains at least two digits, | + | | and is zero if the value is zero. | +-----------+------------------------------------------------------------+ | "'E'" | Scientific notation. Same as "'e'" except it uses an upper | | | case ‘E’ as the separator character. | @@ -6484,78 +6489,31 @@ def whats_on_the_telly(penguin=None): "NAME" tokens represent *identifiers*, *keywords*, and *soft keywords*. -Within the ASCII range (U+0001..U+007F), the valid characters for -names include the uppercase and lowercase letters ("A-Z" and "a-z"), -the underscore "_" and, except for the first character, the digits "0" -through "9". - -Names must contain at least one character, but have no upper length -limit. Case is significant. - -Besides "A-Z", "a-z", "_" and "0-9", names can also use “letter-like” -and “number-like” characters from outside the ASCII range, as detailed -below. - -All identifiers are converted into the normalization form NFKC while -parsing; comparison of identifiers is based on NFKC. - -Formally, the first character of a normalized identifier must belong -to the set "id_start", which is the union of: - -* Unicode category "" - uppercase letters (includes "A" to "Z") - -* Unicode category "" - lowercase letters (includes "a" to "z") +Names are composed of the following characters: -* Unicode category "" - titlecase letters +* uppercase and lowercase letters ("A-Z" and "a-z"), -* Unicode category "" - modifier letters +* the underscore ("_"), -* Unicode category "" - other letters +* digits ("0" through "9"), which cannot appear as the first + character, and -* Unicode category "" - letter numbers - -* {""_""} - the underscore - -* "" - an explicit set of characters in PropList.txt - to support backwards compatibility +* non-ASCII characters. Valid names may only contain “letter-like” and + “digit-like” characters; see Non-ASCII characters in names for + details. -The remaining characters must belong to the set "id_continue", which -is the union of: - -* all characters in "id_start" - -* Unicode category "" - decimal numbers (includes "0" to "9") - -* Unicode category "" - connector punctuations - -* Unicode category "" - nonspacing marks - -* Unicode category "" - spacing combining marks - -* "" - another explicit set of characters in - PropList.txt to support backwards compatibility - -Unicode categories use the version of the Unicode Character Database -as included in the "unicodedata" module. - -These sets are based on the Unicode standard annex UAX-31. See also -**PEP 3131** for further details. +Names must contain at least one character, but have no upper length +limit. Case is significant. -Even more formally, names are described by the following lexical -definitions: +Formally, names are described by the following lexical definitions: - NAME: xid_start xid_continue* - id_start: | | | | | | "_" | - id_continue: id_start | | | | | - xid_start: - xid_continue: - identifier: + NAME: name_start name_continue* + name_start: "a"..."z" | "A"..."Z" | "_" | + name_continue: name_start | "0"..."9" + identifier: -A non-normative listing of all valid identifier characters as defined -by Unicode is available in the DerivedCoreProperties.txt file in the -Unicode Character Database. +Note that not all names matched by this grammar are valid; see Non- +ASCII characters in names for details. Keywords @@ -6638,6 +6596,101 @@ def whats_on_the_telly(penguin=None): context of a class definition, are re-written to use a mangled form to help avoid name clashes between “private” attributes of base and derived classes. See section Identifiers (Names). + + +Non-ASCII characters in names +============================= + +Names that contain non-ASCII characters need additional normalization +and validation beyond the rules and grammar explained above. For +example, "ř_1", "蛇", or "साँप" are valid names, but "r〰2", "€", or +"🐍" are not. + +This section explains the exact rules. + +All names are converted into the normalization form NFKC while +parsing. This means that, for example, some typographic variants of +characters are converted to their “basic” form. For example, +"fiⁿₐˡᵢᶻₐᵗᵢᵒₙ" normalizes to "finalization", so Python treats them as +the same name: + + >>> fiⁿₐˡᵢᶻₐᵗᵢᵒₙ = 3 + >>> finalization + 3 + +Note: + + Normalization is done at the lexical level only. Run-time functions + that take names as *strings* generally do not normalize their + arguments. For example, the variable defined above is accessible at + run time in the "globals()" dictionary as + "globals()["finalization"]" but not "globals()["fiⁿₐˡᵢᶻₐᵗᵢᵒₙ"]". + +Similarly to how ASCII-only names must contain only letters, digits +and the underscore, and cannot start with a digit, a valid name must +start with a character in the “letter-like” set "xid_start", and the +remaining characters must be in the “letter- and digit-like” set +"xid_continue". + +These sets based on the *XID_Start* and *XID_Continue* sets as defined +by the Unicode standard annex UAX-31. Python’s "xid_start" +additionally includes the underscore ("_"). Note that Python does not +necessarily conform to UAX-31. + +A non-normative listing of characters in the *XID_Start* and +*XID_Continue* sets as defined by Unicode is available in the +DerivedCoreProperties.txt file in the Unicode Character Database. For +reference, the construction rules for the "xid_*" sets are given +below. + +The set "id_start" is defined as the union of: + +* Unicode category "" - uppercase letters (includes "A" to "Z") + +* Unicode category "" - lowercase letters (includes "a" to "z") + +* Unicode category "" - titlecase letters + +* Unicode category "" - modifier letters + +* Unicode category "" - other letters + +* Unicode category "" - letter numbers + +* {""_""} - the underscore + +* "" - an explicit set of characters in PropList.txt + to support backwards compatibility + +The set "xid_start" then closes this set under NFKC normalization, by +removing all characters whose normalization is not of the form +"id_start id_continue*". + +The set "id_continue" is defined as the union of: + +* "id_start" (see above) + +* Unicode category "" - decimal numbers (includes "0" to "9") + +* Unicode category "" - connector punctuations + +* Unicode category "" - nonspacing marks + +* Unicode category "" - spacing combining marks + +* "" - another explicit set of characters in + PropList.txt to support backwards compatibility + +Again, "xid_continue" closes this set under NFKC normalization. + +Unicode categories use the version of the Unicode Character Database +as included in the "unicodedata" module. + +See also: + + * **PEP 3131** – Supporting Non-ASCII Identifiers + + * **PEP 672** – Unicode-related Security Considerations for Python ''', 'if': r'''The "if" statement ****************** @@ -8956,9 +9009,9 @@ class to a new value, *value*. renders the meaning of the program undefined. In the future, a check may be added to prevent this. -* "TypeError" will be raised if nonempty *__slots__* are defined for a - class derived from a ""variable-length" built-in type" such as - "int", "bytes", and "tuple". +* "TypeError" will be raised if *__slots__* other than *__dict__* and + *__weakref__* are defined for a class derived from a ""variable- + length" built-in type" such as "int", "bytes", and "tuple". * Any non-string *iterable* may be assigned to *__slots__*. @@ -8979,6 +9032,9 @@ class derived from a ""variable-length" built-in type" such as created for each of the iterator’s values. However, the *__slots__* attribute will be an empty iterator. +Changed in version 3.15.0a2 (unreleased): Allowed defining the +*__dict__* and *__weakref__* *__slots__* for any class. + Customizing class creation ========================== @@ -10150,10 +10206,14 @@ class is used in a class pattern with positional arguments, each the numeric index of a positional argument, or the name of a keyword argument. Returns a copy of the string where each replacement field is replaced with the string value of the - corresponding argument. + corresponding argument. For example: - >>> "The sum of 1 + 2 is {0}".format(1+2) - 'The sum of 1 + 2 is 3' + >>> "The sum of 1 + 2 is {0}".format(1+2) + 'The sum of 1 + 2 is 3' + >>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2) + 'The sum of 1 + 2 is 3' + >>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody") + 'Nobody expects the Spanish Inquisition!' See Format String Syntax for a description of the various formatting options that can be specified in format strings. @@ -10208,13 +10268,28 @@ class is used in a class pattern with positional arguments, each database as “Letter”, i.e., those with general category property being one of “Lm”, “Lt”, “Lu”, “Ll”, or “Lo”. Note that this is different from the Alphabetic property defined in the section 4.10 - ‘Letters, Alphabetic, and Ideographic’ of the Unicode Standard. + ‘Letters, Alphabetic, and Ideographic’ of the Unicode Standard. For + example: + + >>> 'Letters and spaces'.isalpha() + False + >>> 'LettersOnly'.isalpha() + True + >>> 'µ'.isalpha() # non-ASCII characters can be considered alphabetical too + True + + See Unicode Properties. str.isascii() Return "True" if the string is empty or all characters in the string are ASCII, "False" otherwise. ASCII characters have code - points in the range U+0000-U+007F. + points in the range U+0000-U+007F. For example: + + >>> 'ASCII characters'.isascii() + True + >>> 'µ'.isascii() + False Added in version 3.7. @@ -10223,8 +10298,16 @@ class is used in a class pattern with positional arguments, each Return "True" if all characters in the string are decimal characters and there is at least one character, "False" otherwise. Decimal characters are those that can be used to form numbers in - base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal - character is a character in the Unicode General Category “Nd”. + base 10, such as U+0660, ARABIC-INDIC DIGIT ZERO. Formally a + decimal character is a character in the Unicode General Category + “Nd”. For example: + + >>> '0123456789'.isdecimal() + True + >>> '٠١٢٣٤٥٦٧٨٩'.isdecimal() # Arabic-Indic digits zero to nine + True + >>> 'alphabetic'.isdecimal() + False str.isdigit() @@ -10267,7 +10350,19 @@ class is used in a class pattern with positional arguments, each that have the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric characters are those with the property value Numeric_Type=Digit, Numeric_Type=Decimal or - Numeric_Type=Numeric. + Numeric_Type=Numeric. For example: + + >>> '0123456789'.isnumeric() + True + >>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine + True + >>> '⅕'.isnumeric() # Vulgar fraction one fifth + True + >>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric() + (False, True, True) + + See also "isdecimal()" and "isdigit()". Numeric characters are a + superset of decimal numbers. str.isprintable() @@ -10333,7 +10428,15 @@ class is used in a class pattern with positional arguments, each Return a string which is the concatenation of the strings in *iterable*. A "TypeError" will be raised if there are any non- string values in *iterable*, including "bytes" objects. The - separator between elements is the string providing this method. + separator between elements is the string providing this method. For + example: + + >>> ', '.join(['spam', 'spam', 'spam']) + 'spam, spam, spam' + >>> '-'.join('Python') + 'P-y-t-h-o-n' + + See also "split()". str.ljust(width, fillchar=' ', /) @@ -10342,6 +10445,17 @@ class is used in a class pattern with positional arguments, each space). The original string is returned if *width* is less than or equal to "len(s)". + For example: + + >>> 'Python'.ljust(10) + 'Python ' + >>> 'Python'.ljust(10, '.') + 'Python....' + >>> 'Monty Python'.ljust(10, '.') + 'Monty Python' + + See also "rjust()". + str.lower() Return a copy of the string with all the cased characters [4] @@ -10543,6 +10657,8 @@ class is used in a class pattern with positional arguments, each >>> " foo ".split(maxsplit=0) ['foo '] + See also "join()". + str.splitlines(keepends=False) Return a list of the lines in the string, breaking at line @@ -11046,119 +11162,56 @@ class is used in a class pattern with positional arguments, each Added in version 3.6. -A *formatted string literal* or *f-string* is a string literal that is -prefixed with ‘"f"’ or ‘"F"’. These strings may contain replacement -fields, which are expressions delimited by curly braces "{}". While -other string literals always have a constant value, formatted strings -are really expressions evaluated at run time. - -Escape sequences are decoded like in ordinary string literals (except -when a literal is also marked as a raw string). After decoding, the -grammar for the contents of the string is: - - f_string: (literal_char | "{{" | "}}" | replacement_field)* - replacement_field: "{" f_expression ["="] ["!" conversion] [":" format_spec] "}" - f_expression: (conditional_expression | "*" or_expr) - ("," conditional_expression | "," "*" or_expr)* [","] - | yield_expression - conversion: "s" | "r" | "a" - format_spec: (literal_char | replacement_field)* - literal_char: - -The parts of the string outside curly braces are treated literally, -except that any doubled curly braces "'{{'" or "'}}'" are replaced -with the corresponding single curly brace. A single opening curly -bracket "'{'" marks a replacement field, which starts with a Python -expression. To display both the expression text and its value after -evaluation, (useful in debugging), an equal sign "'='" may be added -after the expression. A conversion field, introduced by an exclamation -point "'!'" may follow. A format specifier may also be appended, -introduced by a colon "':'". A replacement field ends with a closing -curly bracket "'}'". - -Expressions in formatted string literals are treated like regular -Python expressions surrounded by parentheses, with a few exceptions. -An empty expression is not allowed, and both "lambda" and assignment -expressions ":=" must be surrounded by explicit parentheses. Each -expression is evaluated in the context where the formatted string -literal appears, in order from left to right. Replacement expressions -can contain newlines in both single-quoted and triple-quoted f-strings -and they can contain comments. Everything that comes after a "#" -inside a replacement field is a comment (even closing braces and -quotes). In that case, replacement fields must be closed in a -different line. - - >>> f"abc{a # This is a comment }" - ... + 3}" - 'abc5' - -Changed in version 3.7: Prior to Python 3.7, an "await" expression and -comprehensions containing an "async for" clause were illegal in the -expressions in formatted string literals due to a problem with the -implementation. - -Changed in version 3.12: Prior to Python 3.12, comments were not -allowed inside f-string replacement fields. +Changed in version 3.7: The "await" and "async for" can be used in +expressions within f-strings. -When the equal sign "'='" is provided, the output will have the -expression text, the "'='" and the evaluated value. Spaces after the -opening brace "'{'", within the expression and after the "'='" are all -retained in the output. By default, the "'='" causes the "repr()" of -the expression to be provided, unless there is a format specified. -When a format is specified it defaults to the "str()" of the -expression unless a conversion "'!r'" is declared. +Changed in version 3.8: Added the debug specifier ("=") -Added in version 3.8: The equal sign "'='". +Changed in version 3.12: Many restrictions on expressions within +f-strings have been removed. Notably, nested strings, comments, and +backslashes are now permitted. -If a conversion is specified, the result of evaluating the expression -is converted before formatting. Conversion "'!s'" calls "str()" on -the result, "'!r'" calls "repr()", and "'!a'" calls "ascii()". +A *formatted string literal* or *f-string* is a string literal that is +prefixed with ‘"f"’ or ‘"F"’. Unlike other string literals, f-strings +do not have a constant value. They may contain *replacement fields* +delimited by curly braces "{}". Replacement fields contain expressions +which are evaluated at run time. For example: + + >>> who = 'nobody' + >>> nationality = 'Spanish' + >>> f'{who.title()} expects the {nationality} Inquisition!' + 'Nobody expects the Spanish Inquisition!' + +Any doubled curly braces ("{{" or "}}") outside replacement fields are +replaced with the corresponding single curly brace: + + >>> print(f'{{...}}') + {...} + +Other characters outside replacement fields are treated like in +ordinary string literals. This means that escape sequences are decoded +(except when a literal is also marked as a raw string), and newlines +are possible in triple-quoted f-strings: + + >>> name = 'Galahad' + >>> favorite_color = 'blue' + >>> print(f'{name}:\\t{favorite_color}') + Galahad: blue + >>> print(rf"C:\\Users\\{name}") + C:\\Users\\Galahad + >>> print(f\'\'\'Three shall be the number of the counting + ... and the number of the counting shall be three.\'\'\') + Three shall be the number of the counting + and the number of the counting shall be three. -The result is then formatted using the "format()" protocol. The -format specifier is passed to the "__format__()" method of the -expression or conversion result. An empty string is passed when the -format specifier is omitted. The formatted result is then included in -the final value of the whole string. +Expressions in formatted string literals are treated like regular +Python expressions. Each expression is evaluated in the context where +the formatted string literal appears, in order from left to right. An +empty expression is not allowed, and both "lambda" and assignment +expressions ":=" must be surrounded by explicit parentheses: -Top-level format specifiers may include nested replacement fields. -These nested fields may include their own conversion fields and format -specifiers, but may not include more deeply nested replacement fields. -The format specifier mini-language is the same as that used by the -"str.format()" method. - -Formatted string literals may be concatenated, but replacement fields -cannot be split across literals. - -Some examples of formatted string literals: - - >>> name = "Fred" - >>> f"He said his name is {name!r}." - "He said his name is 'Fred'." - >>> f"He said his name is {repr(name)}." # repr() is equivalent to !r - "He said his name is 'Fred'." - >>> width = 10 - >>> precision = 4 - >>> value = decimal.Decimal("12.34567") - >>> f"result: {value:{width}.{precision}}" # nested fields - 'result: 12.35' - >>> today = datetime(year=2017, month=1, day=27) - >>> f"{today:%B %d, %Y}" # using date format specifier - 'January 27, 2017' - >>> f"{today=:%B %d, %Y}" # using date format specifier and debugging - 'today=January 27, 2017' - >>> number = 1024 - >>> f"{number:#0x}" # using integer format specifier - '0x400' - >>> foo = "bar" - >>> f"{ foo = }" # preserves whitespace - " foo = 'bar'" - >>> line = "The mill's closed" - >>> f"{line = }" - 'line = "The mill\\'s closed"' - >>> f"{line = :20}" - "line = The mill's closed " - >>> f"{line = !r:20}" - 'line = "The mill\\'s closed" ' + >>> f'{(half := 1/2)}, {half * 42}' + '0.5, 21.0' Reusing the outer f-string quoting type inside a replacement field is permitted: @@ -11167,10 +11220,6 @@ class is used in a class pattern with positional arguments, each >>> f"abc {a["x"]} def" 'abc 2 def' -Changed in version 3.12: Prior to Python 3.12, reuse of the same -quoting type of the outer f-string inside a replacement field was not -possible. - Backslashes are also allowed in replacement fields and are evaluated the same way as in any other context: @@ -11181,21 +11230,84 @@ class is used in a class pattern with positional arguments, each b c -Changed in version 3.12: Prior to Python 3.12, backslashes were not -permitted inside an f-string replacement field. +It is possible to nest f-strings: + + >>> name = 'world' + >>> f'Repeated:{f' hello {name}' * 3}' + 'Repeated: hello world hello world hello world' + +Portable Python programs should not use more than 5 levels of nesting. + +**CPython implementation detail:** CPython does not limit nesting of +f-strings. + +Replacement expressions can contain newlines in both single-quoted and +triple-quoted f-strings and they can contain comments. Everything that +comes after a "#" inside a replacement field is a comment (even +closing braces and quotes). This means that replacement fields with +comments must be closed in a different line: + + >>> a = 2 + >>> f"abc{a # This comment }" continues until the end of the line + ... + 3}" + 'abc5' + +After the expression, replacement fields may optionally contain: + +* a *debug specifier* – an equal sign ("="), optionally surrounded by + whitespace on one or both sides; + +* a *conversion specifier* – "!s", "!r" or "!a"; and/or + +* a *format specifier* prefixed with a colon (":"). -Formatted string literals cannot be used as docstrings, even if they -do not include expressions. +See the Standard Library section on f-strings for details on how these +fields are evaluated. + +As that section explains, *format specifiers* are passed as the second +argument to the "format()" function to format a replacement field +value. For example, they can be used to specify a field width and +padding characters using the Format Specification Mini-Language: + + >>> number = 14.3 + >>> f'{number:20.7f}' + ' 14.3000000' + +Top-level format specifiers may include nested replacement fields: + + >>> field_size = 20 + >>> precision = 7 + >>> f'{number:{field_size}.{precision}f}' + ' 14.3000000' + +These nested fields may include their own conversion fields and format +specifiers: + + >>> number = 3 + >>> f'{number:{field_size}}' + ' 3' + >>> f'{number:{field_size:05}}' + '00000000000000000003' + +However, these nested fields may not include more deeply nested +replacement fields. + +Formatted string literals cannot be used as *docstrings*, even if they +do not include expressions: >>> def foo(): ... f"Not a docstring" ... - >>> foo.__doc__ is None - True + >>> print(foo.__doc__) + None + +See also: -See also **PEP 498** for the proposal that added formatted string -literals, and "str.format()", which uses a related format string -mechanism. + * **PEP 498** – Literal String Interpolation + + * **PEP 701** – Syntactic formalization of f-strings + + * "str.format()", which uses a related format string mechanism. t-strings @@ -11204,34 +11316,90 @@ class is used in a class pattern with positional arguments, each Added in version 3.14. A *template string literal* or *t-string* is a string literal that is -prefixed with ‘"t"’ or ‘"T"’. These strings follow the same syntax and -evaluation rules as formatted string literals, with the following -differences: - -* Rather than evaluating to a "str" object, template string literals - evaluate to a "string.templatelib.Template" object. - -* The "format()" protocol is not used. Instead, the format specifier - and conversions (if any) are passed to a new "Interpolation" object - that is created for each evaluated expression. It is up to code that - processes the resulting "Template" object to decide how to handle - format specifiers and conversions. - -* Format specifiers containing nested replacement fields are evaluated - eagerly, prior to being passed to the "Interpolation" object. For - instance, an interpolation of the form "{amount:.{precision}f}" will - evaluate the inner expression "{precision}" to determine the value - of the "format_spec" attribute. If "precision" were to be "2", the - resulting format specifier would be "'.2f'". - -* When the equals sign "'='" is provided in an interpolation - expression, the text of the expression is appended to the literal - string that precedes the relevant interpolation. This includes the - equals sign and any surrounding whitespace. The "Interpolation" - instance for the expression will be created as normal, except that - "conversion" will be set to ‘"r"’ ("repr()") by default. If an - explicit conversion or format specifier are provided, this will - override the default behaviour. +prefixed with ‘"t"’ or ‘"T"’. These strings follow the same syntax +rules as formatted string literals. For differences in evaluation +rules, see the Standard Library section on t-strings + + +Formal grammar for f-strings +============================ + +F-strings are handled partly by the *lexical analyzer*, which produces +the tokens "FSTRING_START", "FSTRING_MIDDLE" and "FSTRING_END", and +partly by the parser, which handles expressions in the replacement +field. The exact way the work is split is a CPython implementation +detail. + +Correspondingly, the f-string grammar is a mix of lexical and +syntactic definitions. + +Whitespace is significant in these situations: + +* There may be no whitespace in "FSTRING_START" (between the prefix + and quote). + +* Whitespace in "FSTRING_MIDDLE" is part of the literal string + contents. + +* In "fstring_replacement_field", if "f_debug_specifier" is present, + all whitespace after the opening brace until the + "f_debug_specifier", as well as whitespace immediately following + "f_debug_specifier", is retained as part of the expression. + + **CPython implementation detail:** The expression is not handled in + the tokenization phase; it is retrieved from the source code using + locations of the "{" token and the token after "=". + +The "FSTRING_MIDDLE" definition uses negative lookaheads ("!") to +indicate special characters (backslash, newline, "{", "}") and +sequences ("f_quote"). + + fstring: FSTRING_START fstring_middle* FSTRING_END + + FSTRING_START: fstringprefix ("'" | '"' | "\'\'\'" | '"""') + FSTRING_END: f_quote + fstringprefix: <("f" | "fr" | "rf"), case-insensitive> + f_debug_specifier: '=' + f_quote: + + fstring_middle: + | fstring_replacement_field + | FSTRING_MIDDLE + FSTRING_MIDDLE: + | (!"\\" !newline !'{' !'}' !f_quote) source_character + | stringescapeseq + | "{{" + | "}}" + | + fstring_replacement_field: + | '{' f_expression [f_debug_specifier] [fstring_conversion] + [fstring_full_format_spec] '}' + fstring_conversion: + | "!" ("s" | "r" | "a") + fstring_full_format_spec: + | ':' fstring_format_spec* + fstring_format_spec: + | FSTRING_MIDDLE + | fstring_replacement_field + f_expression: + | ','.(conditional_expression | "*" or_expr)+ [","] + | yield_expression + +Note: + + In the above grammar snippet, the "f_quote" and "FSTRING_MIDDLE" + rules are context-sensitive – they depend on the contents of + "FSTRING_START" of the nearest enclosing "fstring".Constructing a + more traditional formal grammar from this template is left as an + exercise for the reader. + +The grammar for t-strings is identical to the one for f-strings, with +*t* instead of *f* at the beginning of rule and token names and in the +prefix. + + tstring: TSTRING_START tstring_middle* TSTRING_END + + ''', 'subscriptions': r'''Subscriptions ************* @@ -11480,7 +11648,7 @@ class is used in a class pattern with positional arguments, each ... except* BlockingIOError as e: ... print(repr(e)) ... - ExceptionGroup('', (BlockingIOError())) + ExceptionGroup('', (BlockingIOError(),)) "break", "continue" and "return" cannot appear in an "except*" clause. @@ -11790,7 +11958,7 @@ def foo(): Sets These represent a mutable set. They are created by the built-in "set()" constructor and can be modified afterwards by several - methods, such as "add". + methods, such as "add()". Frozen sets These represent an immutable set. They are created by the built-in @@ -12239,41 +12407,25 @@ def foo(): module.__file__ -module.__cached__ - - "__file__" and "__cached__" are both optional attributes that may - or may not be set. Both attributes should be a "str" when they are - available. - - "__file__" indicates the pathname of the file from which the module - was loaded (if loaded from a file), or the pathname of the shared - library file for extension modules loaded dynamically from a shared - library. It might be missing for certain types of modules, such as - C modules that are statically linked into the interpreter, and the - import system may opt to leave it unset if it has no semantic - meaning (for example, a module loaded from a database). - - If "__file__" is set then the "__cached__" attribute might also be - set, which is the path to any compiled version of the code (for - example, a byte-compiled file). The file does not need to exist to - set this attribute; the path can simply point to where the compiled - file *would* exist (see **PEP 3147**). - - Note that "__cached__" may be set even if "__file__" is not set. - However, that scenario is quite atypical. Ultimately, the *loader* - is what makes use of the module spec provided by the *finder* (from - which "__file__" and "__cached__" are derived). So if a loader can - load from a cached module but otherwise does not load from a file, - that atypical scenario may be appropriate. + "__file__" is an optional attribute that may or may not be set. + Both attributes should be a "str" when they are available. - It is **strongly** recommended that you use - "module.__spec__.cached" instead of "module.__cached__". + An optional attribute, "__file__" indicates the pathname of the + file from which the module was loaded (if loaded from a file), or + the pathname of the shared library file for extension modules + loaded dynamically from a shared library. It might be missing for + certain types of modules, such as C modules that are statically + linked into the interpreter, and the import system may opt to leave + it unset if it has no semantic meaning (for example, a module + loaded from a database). Deprecated since version 3.13, removed in version 3.15: Setting "__cached__" on a module while failing to set "__spec__.cached" is deprecated. In Python 3.15, "__cached__" will cease to be set or taken into consideration by the import system or standard library. + Changed in version 3.15: "__cached__" is no longer set. + Other writable attributes on module objects ------------------------------------------- @@ -12957,10 +13109,6 @@ class dict(iterable, /, **kwargs) the keyword argument replaces the value from the positional argument. - Providing keyword arguments as in the first example only works for - keys that are valid Python identifiers. Otherwise, any valid keys - can be used. - Dictionaries compare equal if and only if they have the same "(key, value)" pairs (regardless of ordering). Order comparisons (‘<’, ‘<=’, ‘>=’, ‘>’) raise "TypeError". To illustrate dictionary diff --git a/Lib/test/test_defaultdict.py b/Lib/test/test_defaultdict.py index bdbe9b81e8fb3f..fbd7354a915a0a 100644 --- a/Lib/test/test_defaultdict.py +++ b/Lib/test/test_defaultdict.py @@ -186,5 +186,23 @@ def test_union(self): with self.assertRaises(TypeError): i |= None + def test_factory_conflict_with_set_value(self): + key = "conflict_test" + count = 0 + + def default_factory(): + nonlocal count + count += 1 + local_count = count + if count == 1: + test_dict[key] + return local_count + + test_dict = defaultdict(default_factory) + + self.assertEqual(count, 0) + self.assertEqual(test_dict[key], 2) + self.assertEqual(count, 2) + if __name__ == "__main__": unittest.main() diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index 4fa5a4e6768b25..7717a98583f741 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -9,7 +9,7 @@ import xml.dom.minidom -from xml.dom.minidom import parse, Attr, Node, Document, parseString +from xml.dom.minidom import parse, Attr, Node, Document, Element, parseString from xml.dom.minidom import getDOMImplementation from xml.parsers.expat import ExpatError @@ -191,6 +191,14 @@ def testAppendChildNoQuadraticComplexity(self): # This example used to take at least 30 seconds. self.assertLess(end - start, 1) + def testSetAttributeNodeWithoutOwnerDocument(self): + # regression test for gh-142754 + elem = Element("test") + attr = Attr("id") + attr.value = "test-id" + elem.setAttributeNode(attr) + self.assertEqual(elem.getAttribute("id"), "test-id") + def testAppendChildFragment(self): dom, orig, c1, c2, c3, frag = self._create_fragment_test_nodes() dom.documentElement.appendChild(frag) diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index e04a4d2c2218a3..a8f71c636f9cca 100644 --- a/Lib/test/test_wsgiref.py +++ b/Lib/test/test_wsgiref.py @@ -109,7 +109,7 @@ def check_hello(self, out, has_length=True): sys.version.split()[0]) self.assertEqual(out, ("HTTP/1.0 200 OK\r\n" - "Server: WSGIServer/0.2 " + pyver +"\r\n" + "Server: WSGIServer " + pyver + "\r\n" "Content-Type: text/plain\r\n" "Date: Mon, 05 Jun 2006 18:49:54 GMT\r\n" + (has_length and "Content-Length: 13\r\n" or "") + @@ -206,7 +206,7 @@ def app(e, s): pyver = py + b"/" + ver self.assertEqual( b"HTTP/1.0 200 OK\r\n" - b"Server: WSGIServer/0.2 "+ pyver + b"\r\n" + b"Server: WSGIServer " + pyver + b"\r\n" b"Content-Type: text/plain; charset=utf-8\r\n" b"Date: Wed, 24 Dec 2008 13:29:32 GMT\r\n" b"\r\n" @@ -840,5 +840,17 @@ def write(self, b): self.assertIsNotNone(h.environ) +class TestModule(unittest.TestCase): + def test_deprecated__version__(self): + from wsgiref import simple_server + + with self.assertWarnsRegex( + DeprecationWarning, + "'__version__' is deprecated and slated for removal in Python 3.20", + ) as cm: + getattr(simple_server, "__version__") + self.assertEqual(cm.filename, __file__) + + if __name__ == "__main__": unittest.main() diff --git a/Lib/wsgiref/simple_server.py b/Lib/wsgiref/simple_server.py index a0f2397fcf0006..31efd8c9baea0d 100644 --- a/Lib/wsgiref/simple_server.py +++ b/Lib/wsgiref/simple_server.py @@ -16,11 +16,10 @@ from wsgiref.handlers import SimpleHandler from platform import python_implementation -__version__ = "0.2" __all__ = ['WSGIServer', 'WSGIRequestHandler', 'demo_app', 'make_server'] -server_version = "WSGIServer/" + __version__ +server_version = "WSGIServer" sys_version = python_implementation() + "/" + sys.version.split()[0] software_version = server_version + ' ' + sys_version @@ -70,7 +69,7 @@ def set_app(self,application): class WSGIRequestHandler(BaseHTTPRequestHandler): - server_version = "WSGIServer/" + __version__ + server_version = "WSGIServer" def get_environ(self): env = self.server.base_environ.copy() @@ -152,6 +151,15 @@ def make_server( return server +def __getattr__(name): + if name == "__version__": + from warnings import _deprecated + + _deprecated("__version__", remove=(3, 20)) + return "0.2" # Do not change + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + + if __name__ == '__main__': with make_server('', 8000, demo_app) as httpd: sa = httpd.socket.getsockname() diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 0a2ccc00f1857d..16b33b90184dc5 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -364,6 +364,7 @@ class Attr(Node): def __init__(self, qName, namespaceURI=EMPTY_NAMESPACE, localName=None, prefix=None): self.ownerElement = None + self.ownerDocument = None self._name = qName self.namespaceURI = namespaceURI self._prefix = prefix @@ -689,6 +690,7 @@ class Element(Node): def __init__(self, tagName, namespaceURI=EMPTY_NAMESPACE, prefix=None, localName=None): + self.ownerDocument = None self.parentNode = None self.tagName = self.nodeName = tagName self.prefix = prefix diff --git a/Misc/NEWS.d/3.15.0a3.rst b/Misc/NEWS.d/3.15.0a3.rst new file mode 100644 index 00000000000000..7d52b3d0c80c55 --- /dev/null +++ b/Misc/NEWS.d/3.15.0a3.rst @@ -0,0 +1,1605 @@ +.. date: 2025-11-18-13-55-47 +.. gh-issue: 141692 +.. nonce: tud9if +.. release date: 2025-12-16 +.. section: Tools/Demos + +Each slice of an iOS XCframework now contains a ``lib`` folder that contains +a symlink to the libpython dylib. This allows binary modules to be compiled +for iOS using dynamic libreary linking, rather than Framework linking. + +.. + +.. date: 2025-10-27-15-53-47 +.. gh-issue: 140381 +.. nonce: N5o3pa +.. section: Tests + +Fix flaky test_profiling tests on i686 and s390x architectures by increasing +slow_fibonacci call frequency from every 5th iteration to every 2nd +iteration. + +.. + +.. date: 2025-10-16-15-08-58 +.. gh-issue: 140210 +.. nonce: P9vUP8 +.. section: Tests + +Make ``test_sysconfig.test_parse_makefile_renamed_vars`` less fragile by +clearing the environment variables before parsing the Makefile. + +.. + +.. date: 2025-12-01-09-36-45 +.. gh-issue: 142145 +.. nonce: tcAUhg +.. section: Security + +Remove quadratic behavior in ``xml.minidom`` node ID cache clearing. + +.. + +.. date: 2025-11-13-22-31-56 +.. gh-issue: 42400 +.. nonce: pqB5Kq +.. section: Security + +Fix buffer overflow in ``_Py_wrealpath()`` for paths exceeding +``MAXPATHLEN`` bytes by using dynamic memory allocation instead of +fixed-size buffer. Patch by Shamil Abdulaev. + +.. + +.. date: 2024-05-23-11-47-48 +.. gh-issue: 119451 +.. nonce: qkJe9- +.. section: Security + +Fix a potential memory denial of service in the :mod:`http.client` module. +When connecting to a malicious server, it could cause an arbitrary amount of +memory to be allocated. This could have led to symptoms including a +:exc:`MemoryError`, swapping, out of memory (OOM) killed processes or +containers, or even system crashes. + +.. + +.. date: 2024-05-21-22-11-31 +.. gh-issue: 119342 +.. nonce: BTFj4Z +.. section: Security + +Fix a potential memory denial of service in the :mod:`plistlib` module. When +reading a Plist file received from untrusted source, it could cause an +arbitrary amount of memory to be allocated. This could have led to symptoms +including a :exc:`MemoryError`, swapping, out of memory (OOM) killed +processes or containers, or even system crashes. + +.. + +.. date: 2025-12-16-11-55-55 +.. gh-issue: 142754 +.. nonce: xuCrt3 +.. section: Library + +Add the *ownerDocument* attribute to :mod:`xml.dom.minidom` elements and +attributes created by directly instantiating the ``Element`` or ``Attr`` +class. Note that this way of creating nodes is not supported; creator +functions like :py:meth:`xml.dom.Document.documentElement` should be used +instead. + +.. + +.. date: 2025-12-14-18-30-48 +.. gh-issue: 142594 +.. nonce: belDmD +.. section: Library + +Fix crash in ``TextIOWrapper.close()`` when the underlying buffer's +``closed`` property calls :meth:`~io.TextIOBase.detach`. + +.. + +.. date: 2025-12-13-21-19-28 +.. gh-issue: 76007 +.. nonce: 6fs_gT +.. section: Library + +Deprecate ``__version__`` from :mod:`ctypes`. Patch by Hugo van Kemenade. + +.. + +.. date: 2025-12-13-19-17-01 +.. gh-issue: 76007 +.. nonce: -OSQU3 +.. section: Library + +Deprecate ``__version__`` from :mod:`wsgiref.simple_server`. Patch by Hugo +van Kemenade. + +.. + +.. date: 2025-12-13-06-17-44 +.. gh-issue: 142651 +.. nonce: ZRtBu4 +.. section: Library + +:mod:`unittest.mock`: fix a thread safety issue where :attr:`Mock.call_count +` may return inaccurate values when the mock +is called concurrently from multiple threads. + +.. + +.. date: 2025-12-13-00-09-09 +.. gh-issue: 76007 +.. nonce: Xg1xCO +.. section: Library + +Deprecate ``__version__`` from :mod:`http.server`. Patch by Hugo van +Kemenade. + +.. + +.. date: 2025-12-12-15-14-03 +.. gh-issue: 138122 +.. nonce: m3EF9E +.. section: Library + +Add ``--subprocesses`` flag to :mod:`profiling.sampling` CLI to +automatically profile subprocesses spawned by the target. When enabled, the +profiler monitors for new Python subprocesses and profiles each one +separately, writing results to individual output files. This is useful for +profiling applications that use :mod:`multiprocessing`, +:class:`~concurrent.futures.ProcessPoolExecutor`, or other subprocess-based +parallelism. Patch by Pablo Galindo. + +.. + +.. date: 2025-12-12-02-56-26 +.. gh-issue: 142595 +.. nonce: wHvTqq +.. section: Library + +Added type check during initialization of the :mod:`decimal` module to +prevent a crash in case of broken stdlib. Patch by Sergey B Kirpichev. + +.. + +.. date: 2025-12-11-09-03-07 +.. gh-issue: 142556 +.. nonce: RuiBte +.. section: Library + +Fix crash when a task gets re-registered during finalization in +:mod:`asyncio`. Patch by Kumar Aditya. + +.. + +.. date: 2025-12-11-04-18-49 +.. gh-issue: 138122 +.. nonce: m3EF9E +.. section: Library + +Add ``--mode=exception`` to the sampling profiler to capture samples only +from threads with an active exception, useful for analyzing exception +handling overhead. Patch by Pablo Galindo. + +.. + +.. date: 2025-12-10-21-19-10 +.. gh-issue: 142539 +.. nonce: _8Vzr0 +.. section: Library + +:mod:`traceback`: Fix location of carets in :exc:`SyntaxError`\s when the +source contains wide characters. + +.. + +.. date: 2025-12-10-11-20-05 +.. gh-issue: 123241 +.. nonce: oYg2n7 +.. section: Library + +Avoid reference count operations in garbage collection of :mod:`ctypes` +objects. + +.. + +.. date: 2025-12-10-11-02-53 +.. gh-issue: 142451 +.. nonce: eCLvhG +.. section: Library + +:mod:`hmac`: correctly copy :class:`~hmac.HMAC` attributes for objects +copied through :meth:`HMAC.copy() `. Patch by Bénédikt Tran. + +.. + +.. date: 2025-12-09-22-11-59 +.. gh-issue: 138122 +.. nonce: CsoBEo +.. section: Library + +The ``profiling.sampling`` flamegraph profiler now supports inverted +flamegraph view that aggregates all leaf nodes. In a standard flamegraph, if +a hot function is called from multiple locations, it appears multiple times +as separate leaf nodes. In the inverted flamegraph, all occurrences of the +same leaf function are merged into a single aggregated node at the root, +showing the total hotness of that function in one place. The children of +each aggregated node represent its callers, making it easier to identify +which functions consume the most CPU time and where they are called from. + +.. + +.. date: 2025-12-09-14-40-45 +.. gh-issue: 112527 +.. nonce: Tvf5Zk +.. section: Library + +The help text for required options in :mod:`argparse` no longer extended +with " (default: None)". + +.. + +.. date: 2025-12-08-18-12-44 +.. gh-issue: 142438 +.. nonce: UF_0nd +.. section: Library + +Fixed a possible leaked GIL in _PySSL_keylog_callback. + +.. + +.. date: 2025-12-07-23-21-13 +.. gh-issue: 138122 +.. nonce: m3EF9E +.. section: Library + +Add bytecode-level instruction profiling to the sampling profiler via the +new ``--opcodes`` flag. When enabled, the profiler captures which bytecode +opcode is executing at each sample, including Python 3.11+ adaptive +specializations, and visualizes this data in the heatmap, flamegraph, gecko, +and live output formats. Patch by Pablo Galindo + +.. + +.. date: 2025-12-07-22-13-28 +.. gh-issue: 142389 +.. nonce: J9v904 +.. section: Library + +Add backtick markup support in :mod:`argparse` description and epilog text +to highlight inline code when color output is enabled. + +.. + +.. date: 2025-12-07-17-30-05 +.. gh-issue: 142346 +.. nonce: okcAAp +.. section: Library + +Fix usage formatting for mutually exclusive groups in :mod:`argparse` when +they are preceded by positional arguments or followed or intermixed with +other optional arguments. + +.. + +.. date: 2025-12-07-13-37-18 +.. gh-issue: 142374 +.. nonce: m3EF9E +.. section: Library + +Fix cumulative percentage calculation for recursive functions in the new +sampling profiler. When profiling recursive functions, cumulative statistics +(cumul%, cumtime) could exceed 100% because each recursive frame in a stack +was counted separately. For example, a function recursing 500 times in every +sample would show 50000% cumulative presence. The fix deduplicates locations +within each sample so cumulative stats correctly represent "percentage of +samples where this function was on the stack". Patch by Pablo Galindo. + +.. + +.. date: 2025-12-07-02-36-24 +.. gh-issue: 142315 +.. nonce: 02o5E_ +.. section: Library + +Pdb can now run scripts from anonymous pipes used in process substitution. +Patch by Bartosz Sławecki. + +.. + +.. date: 2025-12-06-16-45-34 +.. gh-issue: 64532 +.. nonce: 4OXZpF +.. section: Library + +Subparser help now includes required optional arguments from the parent +parser in the usage, making it clearer what arguments are needed to run a +subcommand. Patch by Savannah Ostrowski. + +.. + +.. date: 2025-12-06-13-19-43 +.. gh-issue: 142207 +.. nonce: x_X9oH +.. section: Library + +Fix: profiling.sampling may cause assertion ``!(has_gil && gil_requested)`` + +.. + +.. date: 2025-12-06-13-02-13 +.. gh-issue: 142332 +.. nonce: PNvXCV +.. section: Library + +Fix usage formatting for positional arguments in mutually exclusive groups +in :mod:`argparse`. in :mod:`argparse`. + +.. + +.. date: 2025-12-05-18-26-50 +.. gh-issue: 142282 +.. nonce: g6RQUN +.. section: Library + +Fix :func:`winreg.QueryValueEx` to not accidentally read garbage buffer +under race condition. + +.. + +.. date: 2025-12-05-18-25-29 +.. gh-issue: 142318 +.. nonce: EzcQ3N +.. section: Library + +Fix typing ``'q'`` at the help of the interactive tachyon profiler exiting +the profiler. + +.. + +.. date: 2025-12-05-16-39-17 +.. gh-issue: 75949 +.. nonce: pHxW98 +.. section: Library + +Fix :mod:`argparse` to preserve ``|`` separators in mutually exclusive +groups when the usage line wraps due to length. + +.. + +.. date: 2025-12-04-23-26-12 +.. gh-issue: 142267 +.. nonce: yOM6fP +.. section: Library + +Improve :mod:`argparse` performance by caching the formatter used for +argument validation. + +.. + +.. date: 2025-12-04-23-24-24 +.. gh-issue: 139862 +.. nonce: NBfsD4 +.. section: Library + +Remove ``color`` parameter from :class:`!argparse.HelpFormatter` +constructor. Color is controlled by :class:`~argparse.ArgumentParser`. + +.. + +.. date: 2025-12-04-09-22-31 +.. gh-issue: 68552 +.. nonce: I_v-xB +.. section: Library + +``MisplacedEnvelopeHeaderDefect`` and ``Missing header name`` defects are +now correctly passed to the ``handle_defect`` method of ``policy`` in +:class:`~email.parser.FeedParser`. + +.. + +.. date: 2025-12-03-09-36-29 +.. gh-issue: 142206 +.. nonce: ilwegH +.. section: Library + +The resource tracker in the :mod:`multiprocessing` module can now understand +messages from older versions of itself. This avoids issues with upgrading +Python while it is running. (Note that such 'in-place' upgrades are not +tested.) + +.. + +.. date: 2025-12-03-06-12-39 +.. gh-issue: 142214 +.. nonce: appYNZ +.. section: Library + +Fix two regressions in :mod:`dataclasses` in Python 3.14.1 related to +annotations. + +* An exception is no longer raised if ``slots=True`` is used and the + ``__init__`` method does not have an ``__annotate__`` attribute + (likely because ``init=False`` was used). + +* An exception is no longer raised if annotations are requested on the + ``__init__`` method and one of the fields is not present in the class + annotations. This can occur in certain dynamic scenarios. + +Patch by Jelle Zijlstra. + +.. + +.. date: 2025-12-02-14-52-51 +.. gh-issue: 142203 +.. nonce: ofWOvV +.. section: Library + +Remove the *debug_override* parameter from +:func:`importlib.util.cache_from_source` which has been deprecated since +Python 3.5. + +.. + +.. date: 2025-12-01-14-43-58 +.. gh-issue: 138122 +.. nonce: nRm3ic +.. section: Library + +The ``_remote_debugging`` module now implements frame caching in the +``RemoteUnwinder`` class to reduce memory reads when profiling remote +processes. When ``cache_frames=True``, unchanged portions of the call stack +are reused from previous samples, significantly improving profiling +performance for deep call stacks. + +.. + +.. date: 2025-12-01-10-03-08 +.. gh-issue: 116738 +.. nonce: 972YsG +.. section: Library + +Fix :mod:`cmath` data race when initializing trigonometric tables with +subinterpreters. + +.. + +.. date: 2025-11-30-04-28-30 +.. gh-issue: 141982 +.. nonce: pxZct9 +.. section: Library + +Allow :mod:`pdb` to set breakpoints on async functions with function names. + +.. + +.. date: 2025-11-29-04-20-44 +.. gh-issue: 74389 +.. nonce: pW3URj +.. section: Library + +When the stdin being used by a :class:`subprocess.Popen` instance is closed, +this is now ignored in :meth:`subprocess.Popen.communicate` instead of +leaving the class in an inconsistent state. + +.. + +.. date: 2025-11-29-03-02-45 +.. gh-issue: 87512 +.. nonce: bn4xbm +.. section: Library + +Fix :func:`subprocess.Popen.communicate` timeout handling on Windows when +writing large input. Previously, the timeout was ignored during stdin +writing, causing the method to block indefinitely if the child process did +not consume input quickly. The stdin write is now performed in a background +thread, allowing the timeout to be properly enforced. + +.. + +.. date: 2025-11-28-08-25-19 +.. gh-issue: 141939 +.. nonce: BXPnFj +.. section: Library + +Add color to all interpolated values in :mod:`argparse` help, like +``%(default)s`` or ``%(choices)s``. Patch by Alex Prengère. + +.. + +.. date: 2025-11-27-20-16-38 +.. gh-issue: 141473 +.. nonce: Wq4xVN +.. section: Library + +When :meth:`subprocess.Popen.communicate` was called with *input* and a +*timeout* and is called for a second time after a +:exc:`~subprocess.TimeoutExpired` exception before the process has died, it +should no longer hang. + +.. + +.. date: 2025-11-27-11-39-50 +.. gh-issue: 141999 +.. nonce: _FKGlu +.. section: Library + +Correctly allow :exc:`KeyboardInterrupt` to stop the process when using +:mod:`!profiling.sampling`. + +.. + +.. date: 2025-11-27-10-49-13 +.. gh-issue: 142006 +.. nonce: nzJDG5 +.. section: Library + +Fix a bug in the :mod:`email.policy.default` folding algorithm which +incorrectly resulted in a doubled newline when a line ending at exactly +max_line_length was followed by an unfoldable token. + +.. + +.. date: 2025-11-26-14-20-10 +.. gh-issue: 141968 +.. nonce: W139Pv +.. section: Library + +Remove data copy from :mod:`re` compilation of regexes with large charsets +by using :meth:`bytearray.take_bytes`. + +.. + +.. date: 2025-11-25-23-35-07 +.. gh-issue: 141968 +.. nonce: b3Gscp +.. section: Library + +Remove data copy from :mod:`encodings.idna` :meth:`~codecs.Codec.encode` and +:meth:`~codecs.IncrementalEncoder.encode` by using +:meth:`bytearray.take_bytes`. + +.. + +.. date: 2025-11-25-23-29-08 +.. gh-issue: 141968 +.. nonce: 0JnjXf +.. section: Library + +Remove data copy from :mod:`codecs` ``punycode`` encoding by using +:meth:`bytearray.take_bytes`. + +.. + +.. date: 2025-11-25-23-22-46 +.. gh-issue: 141968 +.. nonce: R1sHnJ +.. section: Library + +Remove data copy from :func:`wave.Wave_read.readframes` and +:func:`wave.Wave_write.writeframes` by using :meth:`bytearray.take_bytes`. + +.. + +.. date: 2025-11-25-22-54-07 +.. gh-issue: 141968 +.. nonce: vg3AMJ +.. section: Library + +Remove a data copy from :func:`base64.b32decode` and +:func:`base64.b32encode` by using :meth:`bytearray.take_bytes`. + +.. + +.. date: 2025-11-25-16-00-29 +.. gh-issue: 59000 +.. nonce: YtOyJy +.. section: Library + +Fix :mod:`pdb` breakpoint resolution for class methods when the module +defining the class is not imported. + +.. + +.. date: 2025-11-25-13-13-34 +.. gh-issue: 116738 +.. nonce: MnZRdV +.. section: Library + +Fix thread safety issue with :mod:`re` scanner objects in free-threaded +builds. + +.. + +.. date: 2025-11-24-14-05-52 +.. gh-issue: 138122 +.. nonce: 2bbGA8 +.. section: Library + +The ``profiling.sampling`` flamegraph profiler now displays thread status +statistics showing the percentage of time threads spend holding the GIL, +running without the GIL, waiting for the GIL, and performing garbage +collection. These statistics help identify GIL contention and thread +behavior patterns. When filtering by thread, the display shows per-thread +metrics. + +.. + +.. date: 2025-11-24-06-44-45 +.. gh-issue: 141781 +.. nonce: MsK27r +.. section: Library + +Fixed an issue where pdb.line_prefix assignment was ignored if assigned +after the module was imported. + +.. + +.. date: 2025-11-22-16-33-48 +.. gh-issue: 141863 +.. nonce: 4PLhnv +.. section: Library + +Update :ref:`asyncio-streams` to use :meth:`bytearray.take_bytes` for a over +10% performance improvement on pyperformance asyncio_tcp benchmark. + +.. + +.. date: 2025-11-21-21-14-10 +.. gh-issue: 141817 +.. nonce: _v5LdB +.. section: Library + +Add :data:`!socket.IPV6_HDRINCL` constant. + +.. + +.. date: 2025-11-18-15-48-13 +.. gh-issue: 105836 +.. nonce: sbUw24 +.. section: Library + +Fix :meth:`asyncio.run_coroutine_threadsafe` leaving underlying cancelled +asyncio task running. + +.. + +.. date: 2025-11-18-14-39-31 +.. gh-issue: 141570 +.. nonce: q3n984 +.. section: Library + +Support :term:`file-like object` raising :exc:`OSError` from +:meth:`~io.IOBase.fileno` in color detection (``_colorize.can_colorize()``). +This can occur when ``sys.stdout`` is redirected. + +.. + +.. date: 2025-11-17-21-41-58 +.. gh-issue: 141679 +.. nonce: fs7zLJ +.. section: Library + +Add colour to defaults in :mod:`argparse` help. Patch by Hugo van Kemenade. + +.. + +.. date: 2025-11-17-16-53-49 +.. gh-issue: 141686 +.. nonce: V-xaoI +.. section: Library + +Break reference cycles created by each call to :func:`json.dump` or +:meth:`json.JSONEncoder.iterencode`. + +.. + +.. date: 2025-11-17-08-16-30 +.. gh-issue: 141659 +.. nonce: QNi9Aj +.. section: Library + +Fix bad file descriptor errors from ``_posixsubprocess`` on AIX. + +.. + +.. date: 2025-11-17-00-53-51 +.. gh-issue: 141645 +.. nonce: TC3TL3 +.. section: Library + +Add a new ``--live`` mode to the tachyon profiler in +:mod:`!profiling.sampling` module. This mode consist of a live TUI that +displays real-time profiling statistics as the target application runs, +similar to ``top``. Patch by Pablo Galindo + +.. + +.. date: 2025-11-16-06-08-46 +.. gh-issue: 141615 +.. nonce: --6EK3 +.. section: Library + +Check ``stdin`` instead of ``stdout`` for ``use_rawinput`` in :mod:`pdb`. + +.. + +.. date: 2025-11-16-04-40-06 +.. gh-issue: 69113 +.. nonce: Xy7Fmn +.. section: Library + +Fix :mod:`doctest` to correctly report line numbers for doctests in +``__test__`` dictionary when formatted as triple-quoted strings by finding +unique lines in the string and matching them in the source file. + +.. + +.. date: 2025-11-15-14-58-12 +.. gh-issue: 141600 +.. nonce: XY2BXg +.. section: Library + +Fix musl version detection on Void Linux. + +.. + +.. date: 2025-11-15-11-10-16 +.. gh-issue: 48752 +.. nonce: aB3xYz +.. section: Library + +Add :func:`readline.get_pre_input_hook` function to retrieve the current +pre-input hook. This allows applications to save and restore the hook +without overwriting user settings. Patch by Sanyam Khurana. + +.. + +.. date: 2025-11-14-18-00-41 +.. gh-issue: 141565 +.. nonce: Ap2bhJ +.. section: Library + +Add async-aware profiling to the Tachyon sampling profiler. The profiler now +reconstructs and displays async task hierarchies in flamegraphs, making the +output more actionable for users. Patch by Savannah Ostrowski and Pablo +Galindo Salgado. + +.. + +.. date: 2025-11-13-13-11-02 +.. gh-issue: 60107 +.. nonce: LZq3QF +.. section: Library + +Remove a copy from :meth:`io.RawIOBase.read`. If the underlying I/O class +keeps a reference to the mutable memory, raise a :exc:`BufferError`. + +.. + +.. date: 2025-11-10-00-14-20 +.. gh-issue: 116738 +.. nonce: IxliC_ +.. section: Library + +Make csv module thread-safe on the :term:`free threaded ` +build. + +.. + +.. date: 2025-11-03-17-13-00 +.. gh-issue: 140911 +.. nonce: 7KFvSQ +.. section: Library + +:mod:`collections`: Ensure that the methods ``UserString.rindex()`` and +``UserString.index()`` accept :class:`collections.UserString` instances as +the sub argument. + +.. + +.. date: 2025-11-02-10-44-23 +.. gh-issue: 140875 +.. nonce: wt6B37 +.. section: Library + +Fix handling of unclosed character references (named and numerical) followed +by the end of file in :class:`html.parser.HTMLParser` with +``convert_charrefs=False``. + +.. + +.. date: 2025-10-27-17-00-11 +.. gh-issue: 140677 +.. nonce: hM9pTq +.. section: Library + +Add heatmap visualization mode to the Tachyon sampling profiler. The new +``--heatmap`` output format provides a line-by-line view showing execution +intensity with color-coded samples, inline statistics, and interactive call +graph navigation between callers and callees. + +.. + +.. date: 2025-10-23-06-38-35 +.. gh-issue: 139946 +.. nonce: HZa5hu +.. section: Library + +Distinguish stdout and stderr when colorizing output in argparse module. + +.. + +.. date: 2025-10-12-12-43-56 +.. gh-issue: 76007 +.. nonce: PyGM14 +.. section: Library + +:mod:`pydoc`: Fix :exc:`DeprecationWarning` being raised when generating doc +for :term:`stdlib` modules. + +.. + +.. date: 2025-10-09-15-46-18 +.. gh-issue: 139686 +.. nonce: XwIZB2 +.. section: Library + +Make importlib.reload no-op for lazy modules. + +.. + +.. date: 2025-09-09-13-00-42 +.. gh-issue: 138697 +.. nonce: QVwJw_ +.. section: Library + +Fix inferring *dest* from a single-dash long option in :mod:`argparse`. If a +short option and a single-dash long option are passed to +:meth:`!add_argument`, *dest* is now inferred from the single-dash long +option. + +.. + +.. date: 2025-09-09-10-13-24 +.. gh-issue: 138525 +.. nonce: hDTaAM +.. section: Library + +Add support for single-dash long options and alternate prefix characters in +:class:`argparse.BooleanOptionalAction`. + +.. + +.. date: 2025-07-29-11-37-22 +.. gh-issue: 79986 +.. nonce: fnJbE_ +.. section: Library + +Add parsing for ``References`` and ``In-Reply-To`` headers to the +:mod:`email` library that parses the header content as lists of message id +tokens. This prevents them from being folded incorrectly. + +.. + +.. date: 2025-07-10-18-40-11 +.. gh-issue: 135559 +.. nonce: BMDtYn +.. section: Library + +Flag: a ``dir()`` on a ``Flag`` enumeration now shows non-canonical members. +(i.e. aliases). + +.. + +.. date: 2025-05-30-18-37-44 +.. gh-issue: 134453 +.. nonce: kxkA-o +.. section: Library + +Fixed :func:`subprocess.Popen.communicate` ``input=`` handling of +:class:`memoryview` instances that were non-byte shaped on POSIX platforms. +Those are now properly cast to a byte shaped view instead of truncating the +input. Windows platforms did not have this bug. + +.. + +.. date: 2024-12-14-19-51-39 +.. gh-issue: 127930 +.. nonce: WsGnh9 +.. section: Library + +Add ``__all__`` to :mod:`tkinter.simpledialog`. + +.. + +.. date: 2024-05-20-12-35-52 +.. gh-issue: 115952 +.. nonce: J6n_Kf +.. section: Library + +Fix a potential memory denial of service in the :mod:`pickle` module. When +reading a pickled data received from untrusted source, it could cause an +arbitrary amount of memory to be allocated, even if the code that is allowed +to execute is restricted by overriding the +:meth:`~pickle.Unpickler.find_class` method. This could have led to symptoms +including a :exc:`MemoryError`, swapping, out of memory (OOM) killed +processes or containers, or even system crashes. + +.. + +.. bpo: 40350 +.. date: 2021-10-23-22-12-13 +.. nonce: t0dQMY +.. section: Library + +Fix support for namespace packages in :mod:`modulefinder`. + +.. + +.. date: 2025-11-26-23-30-09 +.. gh-issue: 141994 +.. nonce: arBEG6 +.. section: Documentation + +:mod:`xml.sax.handler`: Make Documentation of +:data:`xml.sax.handler.feature_external_ges` warn of opening up to `external +entity attacks `_. +Patch by Sebastian Pipping. + +.. + +.. date: 2025-12-16-01-17-21 +.. gh-issue: 134584 +.. nonce: tsxYYw +.. section: Core and Builtins + +Eliminate redundant refcounting from ``_STORE_ATTR_INSTANCE_VALUE``. + +.. + +.. date: 2025-12-15-15-07-40 +.. gh-issue: 142718 +.. nonce: zjiGjS +.. section: Core and Builtins + +JIT: Fix segfault caused by not flushing the stack to memory at side exits. + +.. + +.. date: 2025-12-15-15-01-21 +.. gh-issue: 142737 +.. nonce: xYXzeB +.. section: Core and Builtins + +Tracebacks will be displayed in fallback mode even if :func:`io.open` is +lost. Previously, this would crash the interpreter. Patch by Bartosz +Sławecki. + +.. + +.. date: 2025-12-15-03-20-24 +.. gh-issue: 116738 +.. nonce: NNHiTK +.. section: Core and Builtins + +Make the attributes in :mod:`bz2` thread-safe on the :term:`free threaded +` build. + +.. + +.. date: 2025-12-14-21-46-07 +.. gh-issue: 134584 +.. nonce: vyec2h +.. section: Core and Builtins + +Eliminate redundant refcounting from ``_CALL_LIST_APPEND``. + +.. + +.. date: 2025-12-13-17-20-38 +.. gh-issue: 142554 +.. nonce: wNtEFF +.. section: Core and Builtins + +Fix a crash in :func:`divmod` when :func:`!_pylong.int_divmod` does not +return a tuple of length two exactly. Patch by Bénédikt Tran. + +.. + +.. date: 2025-12-10-23-03-10 +.. gh-issue: 142531 +.. nonce: NUEa1T +.. section: Core and Builtins + +Fix a free-threaded GC performance regression. If there are many untracked +tuples, the GC will run too often, resulting in poor performance. The fix +is to include untracked tuples in the "long lived" object count. The number +of frozen objects is also now included since the free-threaded GC must scan +those too. + +.. + +.. date: 2025-12-08-17-34-57 +.. gh-issue: 142402 +.. nonce: iV0ON3 +.. section: Core and Builtins + +Fix reference counting when adjacent literal parts are merged while +constructing :class:`string.templatelib.Template`, preventing the displaced +string object from leaking. + +.. + +.. date: 2025-12-08-14-14-40 +.. gh-issue: 116738 +.. nonce: x7aaBF +.. section: Core and Builtins + +Make the attributes in :mod:`zlib` thread-safe on the :term:`free threaded +` build. + +.. + +.. date: 2025-12-08-13-04-37 +.. gh-issue: 142343 +.. nonce: BTAyML +.. section: Core and Builtins + +Fix SIGILL crash on m68k due to incorrect assembly constraint. + +.. + +.. date: 2025-12-06-00-38-37 +.. gh-issue: 142236 +.. nonce: m3EF9E +.. section: Core and Builtins + +Improve the "Perhaps you forgot a comma?" syntax error for multi-line string +concatenations to point to the last string instead of the first, making it +easier to locate where the comma is missing. Patch by Pablo Galindo. + +.. + +.. date: 2025-12-06-00-16-43 +.. gh-issue: 142236 +.. nonce: m3EF9E +.. section: Core and Builtins + +Fix incorrect keyword suggestions for syntax errors in :mod:`traceback`. The +keyword typo suggestion mechanism would incorrectly suggest replacements +when the extracted source code was incomplete rather than containing an +actual typo. Patch by Pablo Galindo. + +.. + +.. date: 2025-12-05-17-24-34 +.. gh-issue: 142305 +.. nonce: ybXvtr +.. section: Core and Builtins + +Decrease the size of the generated stencils and the runtime JIT code. Patch +by Diego Russo. + +.. + +.. date: 2025-12-05-15-59-03 +.. gh-issue: 135379 +.. nonce: lDXbKO +.. section: Core and Builtins + +Implement a limited form of register allocation known as "top of stack +caching" in the JIT. It works by keeping 0-3 of the top items in the stack +in registers. The code generator generates multiple versions of those uops +that do not escape and are relatively small. During JIT compilation, the +copy that produces the least memory traffic is selected, spilling or +reloading values when needed. + +.. + +.. date: 2025-12-05-14-33-54 +.. gh-issue: 142276 +.. nonce: H4j8hP +.. section: Core and Builtins + +Fix missing type watcher when promoting attribute loads to constants in the +JIT. Patch by Ken Jin. Reproducer by Yuancheng Jiang. + +.. + +.. date: 2025-12-03-11-03-35 +.. gh-issue: 142218 +.. nonce: 44Fq_J +.. section: Core and Builtins + +Fix crash when inserting into a split table dictionary with a non +:class:`str` key that matches an existing key. + +.. + +.. date: 2025-12-02-21-11-46 +.. gh-issue: 141976 +.. nonce: yu7pDV +.. section: Core and Builtins + +Check against abstract stack overflow in the JIT optimizer. + +.. + +.. date: 2025-12-02-15-39-16 +.. gh-issue: 97850 +.. nonce: H6QKwl +.. section: Core and Builtins + +Remove all ``*.load_module()`` usage and definitions from the import system +and importlib. The method has been deprecated in favor of +``importlib.abc.Loader.exec_module()`` since Python 3.4. + +.. + +.. date: 2025-12-01-20-41-26 +.. gh-issue: 142048 +.. nonce: c2YosX +.. section: Core and Builtins + +Fix quadratically increasing garbage collection delays in free-threaded +build. + +.. + +.. date: 2025-12-01-15-22-54 +.. gh-issue: 65961 +.. nonce: hCJvRB +.. section: Core and Builtins + +Stop setting ``__cached__`` on modules. + +.. + +.. date: 2025-11-29-18-14-28 +.. gh-issue: 141770 +.. nonce: JURnvg +.. section: Core and Builtins + +Annotate anonymous mmap usage only when supported by the Linux kernel and if +``-X dev`` is used or Python is built in debug mode. Patch by Donghee Na. + +.. + +.. date: 2025-11-29-08-51-56 +.. gh-issue: 142029 +.. nonce: rUpcmt +.. section: Core and Builtins + +Raise :exc:`ModuleNotFoundError` instead of crashing when a nonexistent +module is used as a name in ``_imp.create_builtin()``. + +.. + +.. date: 2025-11-28-16-45-07 +.. gh-issue: 142029 +.. nonce: JuXiKu +.. section: Core and Builtins + +Raise :exc:`ValueError` instead of crashing when empty string is used as a +name in ``_imp.create_builtin()``. + +.. + +.. date: 2025-11-26-20-01-07 +.. gh-issue: 141976 +.. nonce: K8NDmR +.. section: Core and Builtins + +Protect against specialization failures in the tracing JIT compiler for +performance reasons. + +.. + +.. date: 2025-11-25-02-23-31 +.. gh-issue: 141861 +.. nonce: QcMdcM +.. section: Core and Builtins + +Fix invalid memory read in the ``ENTER_EXECUTOR`` instruction. + +.. + +.. date: 2025-11-24-21-09-30 +.. gh-issue: 141930 +.. nonce: hIIzSd +.. section: Core and Builtins + +When importing a module, use Python's regular file object to ensure that +writes to ``.pyc`` files are complete or an appropriate error is raised. + +.. + +.. date: 2025-11-24-16-07-57 +.. gh-issue: 138122 +.. nonce: m3EF9E +.. section: Core and Builtins + +Add incomplete sample detection to prevent corrupted profiling data. Each +thread state now contains an embedded base frame (sentinel at the bottom of +the frame stack) with owner type ``FRAME_OWNED_BY_INTERPRETER``. The +profiler validates that stack unwinding terminates at this sentinel frame. +Samples that fail to reach the base frame (due to race conditions, memory +corruption, or other errors) are now rejected rather than being included as +spurious data. + +.. + +.. date: 2025-11-22-10-43-26 +.. gh-issue: 120158 +.. nonce: 41_rXd +.. section: Core and Builtins + +Fix inconsistent state when enabling or disabling monitoring events too many +times. + +.. + +.. date: 2025-11-20-22-09-22 +.. gh-issue: 140638 +.. nonce: f6btj0 +.. section: Core and Builtins + +Expose a ``"candidates"`` stat in :func:`gc.get_stats` and +:data:`gc.callbacks`. + +.. + +.. date: 2025-11-20-13-18-57 +.. gh-issue: 141780 +.. nonce: xDrVNr +.. section: Core and Builtins + +Fix :c:macro:`Py_mod_gil` with API added in :pep:`793`: +:c:func:`!PyModule_FromSlotsAndSpec` and ``PyModExport`` hooks + +.. + +.. date: 2025-11-19-16-40-24 +.. gh-issue: 141732 +.. nonce: PTetqp +.. section: Core and Builtins + +Ensure the :meth:`~object.__repr__` for :exc:`ExceptionGroup` and +:exc:`BaseExceptionGroup` does not change when the exception sequence that +was original passed in to its constructor is subsequently mutated. + +.. + +.. date: 2025-11-18-07-45-37 +.. gh-issue: 140638 +.. nonce: i06qxD +.. section: Core and Builtins + +Expose a ``"duration"`` stat in :func:`gc.get_stats` and +:data:`gc.callbacks`. + +.. + +.. date: 2025-11-17-14-40-45 +.. gh-issue: 139653 +.. nonce: LzOy1M +.. section: Core and Builtins + +Only raise a ``RecursionError`` or trigger a fatal error if the stack +pointer is both below the limit pointer *and* above the stack base. If +outside of these bounds assume that it is OK. This prevents false positives +when user-space threads swap stacks. + +.. + +.. date: 2025-11-16-21-14-48 +.. gh-issue: 41779 +.. nonce: rXIj5h +.. section: Core and Builtins + +Allowed defining the *__dict__* and *__weakref__* :ref:`__slots__ ` +for any class. + +.. + +.. date: 2025-11-15-23-58-23 +.. gh-issue: 139103 +.. nonce: 9cVYJ0 +.. section: Core and Builtins + +Improve multithreaded scaling of dataclasses on the free-threaded build. + +.. + +.. date: 2025-11-15-14-04-35 +.. gh-issue: 141589 +.. nonce: VfdMDD +.. section: Core and Builtins + +Change ``backoff counter`` to use prime numbers instead of powers of 2. Use +only 3 bits for ``counter`` and 13 bits for ``value``. This allows to +support values up to 8191. Patch by Mikhail Efimov. + +.. + +.. date: 2025-07-22-16-20-06 +.. gh-issue: 137007 +.. nonce: 1oPvvK +.. section: Core and Builtins + +Fix a bug during JIT compilation failure which caused garbage collection +debug assertions to fail. + +.. + +.. date: 2025-07-11-19-57-27 +.. gh-issue: 132657 +.. nonce: vwDuO2 +.. section: Core and Builtins + +For the free-threaded build, avoid locking the :class:`set` object for the +``__contains__`` method. + +.. + +.. date: 2025-06-28-17-54-27 +.. gh-issue: 134584 +.. nonce: EXgPub +.. section: Core and Builtins + +Eliminate redundant refcounting from ``_CALL_STR_1``. + +.. + +.. date: 2025-06-28-04-32-38 +.. gh-issue: 134584 +.. nonce: eZogqn +.. section: Core and Builtins + +Eliminate redundant refcounting from ``_CALL_BUILTIN_O``. + +.. + +.. date: 2025-06-23-22-52-20 +.. gh-issue: 134584 +.. nonce: qbiQfG +.. section: Core and Builtins + +Eliminate redundant refcounting from ``_CALL_TUPLE_1``. Patch by Noam Cohen + +.. + +.. date: 2025-12-11-13-01-49 +.. gh-issue: 142589 +.. nonce: nNAqgw +.. section: C API + +Fix :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()` handling of +tagged ints on the interpreter stack. + +.. + +.. date: 2025-12-11-09-06-36 +.. gh-issue: 142571 +.. nonce: Csdxnn +.. section: C API + +:c:func:`!PyUnstable_CopyPerfMapFile` now checks that opening the file +succeeded before flushing. + +.. + +.. date: 2025-12-03-16-35-24 +.. gh-issue: 142225 +.. nonce: vmCJoo +.. section: C API + +Fixed the :c:macro:`PyABIInfo_VAR` macro. + +.. + +.. date: 2025-12-03-14-41-07 +.. gh-issue: 141049 +.. nonce: VuAUe2 +.. section: C API + +:c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and +:c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed +in 3.20. Instead, use :c:func:`PyUnicode_InternFromString()` and cache the +result in the module state, then call :c:func:`PyObject_CallMethod` or +:c:func:`PyObject_GetAttr`. Patch by Victor Stinner. + +.. + +.. date: 2025-12-01-18-17-16 +.. gh-issue: 142163 +.. nonce: 2HiX5A +.. section: C API + +Fix the ``HAVE_THREAD_LOCAL`` macro being defined without the +``Py_BUILD_CORE`` macro set after including :file:`Python.h`. + +.. + +.. date: 2025-11-21-10-34-00 +.. gh-issue: 137422 +.. nonce: tzZKLi +.. section: C API + +Fix :term:`free threading` race condition in +:c:func:`PyImport_AddModuleRef`. It was previously possible for two calls to +the function return two different objects, only one of which was stored in +:data:`sys.modules`. + +.. + +.. date: 2025-11-18-18-36-15 +.. gh-issue: 141726 +.. nonce: ILrhyK +.. section: C API + +Add :c:func:`PyDict_SetDefaultRef` to the Stable ABI. + +.. + +.. date: 2025-11-18-04-16-09 +.. gh-issue: 140042 +.. nonce: S1C7id +.. section: C API + +Removed the sqlite3_shutdown call that could cause closing connections for +sqlite when used with multiple sub interpreters. + +.. + +.. date: 2025-11-05-21-48-31 +.. gh-issue: 141070 +.. nonce: mkrhjQ +.. section: C API + +Add :c:func:`PyUnstable_Object_Dump` to dump an object to ``stderr``. It +should only be used for debugging. Patch by Victor Stinner. + +.. + +.. date: 2025-09-22-16-32-00 +.. gh-issue: 139165 +.. nonce: 6Czn7S +.. section: C API + +Expose the functions :c:func:`Py_SIZE`, :c:func:`Py_IS_TYPE` and +:c:func:`Py_SET_SIZE` in the Stable ABI. + +.. + +.. date: 2025-12-09-14-23-51 +.. gh-issue: 131372 +.. nonce: 2TAEyz +.. section: Build + +Add ``LDVERSION`` and ``EXE`` to the ``base_interpreter`` value of +``build-details.json``. + +.. + +.. date: 2025-12-09-13-33-46 +.. gh-issue: 142454 +.. nonce: cqUxzQ +.. section: Build + +When calculating the digest of the JIT stencils input, sort the hashed files +by filenames before adding their content to the hasher. This ensures +deterministic hash input and hence deterministic hash, independent on +filesystem order. + +.. + +.. date: 2025-12-04-20-57-15 +.. gh-issue: 131372 +.. nonce: o397g7 +.. section: Build + +``build-details.py`` will only be installed as part of the main install +(``make install``). ``make altinstall`` will no longer include it. + +.. + +.. date: 2025-12-03-10-44-42 +.. gh-issue: 142234 +.. nonce: i1kaFb +.. section: Build + +Allow ``--enable-wasm-dynamic-linking`` for WASI. While CPython doesn't +directly support it so external/downstream users do not have to patch in +support for the flag. + +.. + +.. date: 2025-11-28-21-43-07 +.. gh-issue: 142050 +.. nonce: PFi4tv +.. section: Build + +Fixed a bug where JIT stencils produced on Windows contained debug data. +Patch by Chris Eibl. + +.. + +.. date: 2025-11-28-19-49-01 +.. gh-issue: 141808 +.. nonce: cV5K12 +.. section: Build + +Do not generate the jit stencils twice in case of PGO builds on Windows. + +.. + +.. date: 2025-11-25-13-17-47 +.. gh-issue: 141926 +.. nonce: KmuM2h +.. section: Build + +``RUNSHARED`` is no longer cleared when cross-compiling. Previously, +``RUNSHARED`` was cleared when cross-compiling, which breaks PGO when using +``--enabled-shared`` on systems where the cross-compiled CPython is +otherwise executable (e.g., via transparent emulation). + +.. + +.. date: 2025-11-20-23-15-39 +.. gh-issue: 141808 +.. nonce: NEewZC +.. section: Build + +When running ``make clean-retain-profile``, keep the generated JIT stencils. +That way, the stencils are not generated twice when Profile-guided +optimization (PGO) is used. It also allows distributors to supply their own +pre-built JIT stencils. + +.. + +.. date: 2025-11-20-17-01-05 +.. gh-issue: 141784 +.. nonce: LkYI2n +.. section: Build + +Fix ``_remote_debugging_module.c`` compilation on 32-bit Linux. Include +Python.h before system headers to make sure that +``_remote_debugging_module.c`` uses the same types (ABI) than Python. Patch +by Victor Stinner. + +.. + +.. date: 2025-11-19-09-21-17 +.. gh-issue: 141172 +.. nonce: cYWc4x +.. section: Build + +Update to WASI SDK 29. + +.. + +.. date: 2025-10-30-10-36-15 +.. gh-issue: 139707 +.. nonce: QJ1FfJ +.. section: Build + +Add configure option :option:`--with-missing-stdlib-config=FILE` allows +which distributors to pass a `JSON `_ +configuration file containing custom error messages for missing +:term:`standard library` modules. + +.. + +.. date: 2025-04-29-18-25-34 +.. gh-issue: 108819 +.. nonce: qMUTRB +.. section: Build + +Honor :option:`--with-platlibdir` in the pure-Python standard library +installation path, if ``PLATLIBDIR`` doesn't match the value used in +``LIBDIR``. diff --git a/Misc/NEWS.d/next/Build/2025-04-29-18-25-34.gh-issue-108819.qMUTRB.rst b/Misc/NEWS.d/next/Build/2025-04-29-18-25-34.gh-issue-108819.qMUTRB.rst deleted file mode 100644 index e374a86f0bc9a2..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-04-29-18-25-34.gh-issue-108819.qMUTRB.rst +++ /dev/null @@ -1,3 +0,0 @@ -Honor :option:`--with-platlibdir` in the pure-Python standard library -installation path, if ``PLATLIBDIR`` doesn't match the value used in -``LIBDIR``. diff --git a/Misc/NEWS.d/next/Build/2025-10-30-10-36-15.gh-issue-139707.QJ1FfJ.rst b/Misc/NEWS.d/next/Build/2025-10-30-10-36-15.gh-issue-139707.QJ1FfJ.rst deleted file mode 100644 index d9870d267042af..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-10-30-10-36-15.gh-issue-139707.QJ1FfJ.rst +++ /dev/null @@ -1,4 +0,0 @@ -Add configure option :option:`--with-missing-stdlib-config=FILE` allows -which distributors to pass a `JSON `_ -configuration file containing custom error messages for missing -:term:`standard library` modules. diff --git a/Misc/NEWS.d/next/Build/2025-11-19-09-21-17.gh-issue-141172.cYWc4x.rst b/Misc/NEWS.d/next/Build/2025-11-19-09-21-17.gh-issue-141172.cYWc4x.rst deleted file mode 100644 index 7cade1ebd414e3..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-11-19-09-21-17.gh-issue-141172.cYWc4x.rst +++ /dev/null @@ -1 +0,0 @@ -Update to WASI SDK 29. diff --git a/Misc/NEWS.d/next/Build/2025-11-20-17-01-05.gh-issue-141784.LkYI2n.rst b/Misc/NEWS.d/next/Build/2025-11-20-17-01-05.gh-issue-141784.LkYI2n.rst deleted file mode 100644 index f20d84094162ac..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-11-20-17-01-05.gh-issue-141784.LkYI2n.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fix ``_remote_debugging_module.c`` compilation on 32-bit Linux. Include -Python.h before system headers to make sure that -``_remote_debugging_module.c`` uses the same types (ABI) than Python. Patch -by Victor Stinner. diff --git a/Misc/NEWS.d/next/Build/2025-11-20-23-15-39.gh-issue-141808.NEewZC.rst b/Misc/NEWS.d/next/Build/2025-11-20-23-15-39.gh-issue-141808.NEewZC.rst deleted file mode 100644 index 73220e1990006b..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-11-20-23-15-39.gh-issue-141808.NEewZC.rst +++ /dev/null @@ -1,4 +0,0 @@ -When running ``make clean-retain-profile``, keep the -generated JIT stencils. That way, the stencils are not generated twice when -Profile-guided optimization (PGO) is used. It also allows distributors to -supply their own pre-built JIT stencils. diff --git a/Misc/NEWS.d/next/Build/2025-11-25-13-17-47.gh-issue-141926.KmuM2h.rst b/Misc/NEWS.d/next/Build/2025-11-25-13-17-47.gh-issue-141926.KmuM2h.rst deleted file mode 100644 index dab79ba5cf949d..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-11-25-13-17-47.gh-issue-141926.KmuM2h.rst +++ /dev/null @@ -1,4 +0,0 @@ -``RUNSHARED`` is no longer cleared when cross-compiling. Previously, -``RUNSHARED`` was cleared when cross-compiling, which breaks PGO when using -``--enabled-shared`` on systems where the cross-compiled CPython is otherwise -executable (e.g., via transparent emulation). diff --git a/Misc/NEWS.d/next/Build/2025-11-28-19-49-01.gh-issue-141808.cV5K12.rst b/Misc/NEWS.d/next/Build/2025-11-28-19-49-01.gh-issue-141808.cV5K12.rst deleted file mode 100644 index 3162c7c41418cc..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-11-28-19-49-01.gh-issue-141808.cV5K12.rst +++ /dev/null @@ -1 +0,0 @@ -Do not generate the jit stencils twice in case of PGO builds on Windows. diff --git a/Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst b/Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst deleted file mode 100644 index 8917d5df76e5c0..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-11-28-21-43-07.gh-issue-142050.PFi4tv.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a bug where JIT stencils produced on Windows contained debug data. Patch by Chris Eibl. diff --git a/Misc/NEWS.d/next/Build/2025-12-03-10-44-42.gh-issue-142234.i1kaFb.rst b/Misc/NEWS.d/next/Build/2025-12-03-10-44-42.gh-issue-142234.i1kaFb.rst deleted file mode 100644 index a586512fc0a80b..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-12-03-10-44-42.gh-issue-142234.i1kaFb.rst +++ /dev/null @@ -1,3 +0,0 @@ -Allow ``--enable-wasm-dynamic-linking`` for WASI. While CPython doesn't -directly support it so external/downstream users do not have to patch in -support for the flag. diff --git a/Misc/NEWS.d/next/Build/2025-12-04-20-57-15.gh-issue-131372.o397g7.rst b/Misc/NEWS.d/next/Build/2025-12-04-20-57-15.gh-issue-131372.o397g7.rst deleted file mode 100644 index 362197f110b7dd..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-12-04-20-57-15.gh-issue-131372.o397g7.rst +++ /dev/null @@ -1,2 +0,0 @@ -``build-details.py`` will only be installed as part of the main install -(``make install``). ``make altinstall`` will no longer include it. diff --git a/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst b/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst deleted file mode 100644 index 4de16866f28851..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-12-09-13-33-46.gh-issue-142454.cqUxzQ.rst +++ /dev/null @@ -1,4 +0,0 @@ -When calculating the digest of the JIT stencils input, sort the hashed files -by filenames before adding their content to the hasher. This ensures -deterministic hash input and hence deterministic hash, independent on -filesystem order. diff --git a/Misc/NEWS.d/next/Build/2025-12-09-14-23-51.gh-issue-131372.2TAEyz.rst b/Misc/NEWS.d/next/Build/2025-12-09-14-23-51.gh-issue-131372.2TAEyz.rst deleted file mode 100644 index fd53e8c28132f0..00000000000000 --- a/Misc/NEWS.d/next/Build/2025-12-09-14-23-51.gh-issue-131372.2TAEyz.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add ``LDVERSION`` and ``EXE`` to the ``base_interpreter`` value of -``build-details.json``. diff --git a/Misc/NEWS.d/next/C_API/2025-09-22-16-32-00.gh-issue-139165.6Czn7S.rst b/Misc/NEWS.d/next/C_API/2025-09-22-16-32-00.gh-issue-139165.6Czn7S.rst deleted file mode 100644 index 039c25b8ce2b3e..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-09-22-16-32-00.gh-issue-139165.6Czn7S.rst +++ /dev/null @@ -1,2 +0,0 @@ -Expose the functions :c:func:`Py_SIZE`, :c:func:`Py_IS_TYPE` and -:c:func:`Py_SET_SIZE` in the Stable ABI. diff --git a/Misc/NEWS.d/next/C_API/2025-11-05-21-48-31.gh-issue-141070.mkrhjQ.rst b/Misc/NEWS.d/next/C_API/2025-11-05-21-48-31.gh-issue-141070.mkrhjQ.rst deleted file mode 100644 index 39cfcf73404ebf..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-11-05-21-48-31.gh-issue-141070.mkrhjQ.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add :c:func:`PyUnstable_Object_Dump` to dump an object to ``stderr``. It should -only be used for debugging. Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/C_API/2025-11-18-04-16-09.gh-issue-140042.S1C7id.rst b/Misc/NEWS.d/next/C_API/2025-11-18-04-16-09.gh-issue-140042.S1C7id.rst deleted file mode 100644 index 608e806b431372..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-11-18-04-16-09.gh-issue-140042.S1C7id.rst +++ /dev/null @@ -1 +0,0 @@ -Removed the sqlite3_shutdown call that could cause closing connections for sqlite when used with multiple sub interpreters. diff --git a/Misc/NEWS.d/next/C_API/2025-11-18-18-36-15.gh-issue-141726.ILrhyK.rst b/Misc/NEWS.d/next/C_API/2025-11-18-18-36-15.gh-issue-141726.ILrhyK.rst deleted file mode 100644 index 3fdad5c6b3e8f4..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-11-18-18-36-15.gh-issue-141726.ILrhyK.rst +++ /dev/null @@ -1 +0,0 @@ -Add :c:func:`PyDict_SetDefaultRef` to the Stable ABI. diff --git a/Misc/NEWS.d/next/C_API/2025-11-21-10-34-00.gh-issue-137422.tzZKLi.rst b/Misc/NEWS.d/next/C_API/2025-11-21-10-34-00.gh-issue-137422.tzZKLi.rst deleted file mode 100644 index 656289663cfebb..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-11-21-10-34-00.gh-issue-137422.tzZKLi.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fix :term:`free threading` race condition in -:c:func:`PyImport_AddModuleRef`. It was previously possible for two calls to -the function return two different objects, only one of which was stored in -:data:`sys.modules`. diff --git a/Misc/NEWS.d/next/C_API/2025-12-01-18-17-16.gh-issue-142163.2HiX5A.rst b/Misc/NEWS.d/next/C_API/2025-12-01-18-17-16.gh-issue-142163.2HiX5A.rst deleted file mode 100644 index 5edcfd81992c13..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-12-01-18-17-16.gh-issue-142163.2HiX5A.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix the ``HAVE_THREAD_LOCAL`` macro being defined without the -``Py_BUILD_CORE`` macro set after including :file:`Python.h`. diff --git a/Misc/NEWS.d/next/C_API/2025-12-03-14-41-07.gh-issue-141049.VuAUe2.rst b/Misc/NEWS.d/next/C_API/2025-12-03-14-41-07.gh-issue-141049.VuAUe2.rst deleted file mode 100644 index 77cd5220d52fef..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-12-03-14-41-07.gh-issue-141049.VuAUe2.rst +++ /dev/null @@ -1,5 +0,0 @@ -:c:func:`!_PyObject_CallMethodId`, :c:func:`!_PyObject_GetAttrId` and -:c:func:`!_PyUnicode_FromId` are deprecated since 3.15 and will be removed in -3.20. Instead, use :c:func:`PyUnicode_InternFromString()` and cache the result in -the module state, then call :c:func:`PyObject_CallMethod` or -:c:func:`PyObject_GetAttr`. Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/C_API/2025-12-03-16-35-24.gh-issue-142225.vmCJoo.rst b/Misc/NEWS.d/next/C_API/2025-12-03-16-35-24.gh-issue-142225.vmCJoo.rst deleted file mode 100644 index 1eaf5b713d9cf5..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-12-03-16-35-24.gh-issue-142225.vmCJoo.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed the :c:macro:`PyABIInfo_VAR` macro. diff --git a/Misc/NEWS.d/next/C_API/2025-12-11-09-06-36.gh-issue-142571.Csdxnn.rst b/Misc/NEWS.d/next/C_API/2025-12-11-09-06-36.gh-issue-142571.Csdxnn.rst deleted file mode 100644 index ea419b4fe1d6b0..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-12-11-09-06-36.gh-issue-142571.Csdxnn.rst +++ /dev/null @@ -1 +0,0 @@ -:c:func:`!PyUnstable_CopyPerfMapFile` now checks that opening the file succeeded before flushing. diff --git a/Misc/NEWS.d/next/C_API/2025-12-11-13-01-49.gh-issue-142589.nNAqgw.rst b/Misc/NEWS.d/next/C_API/2025-12-11-13-01-49.gh-issue-142589.nNAqgw.rst deleted file mode 100644 index 529277b951ada3..00000000000000 --- a/Misc/NEWS.d/next/C_API/2025-12-11-13-01-49.gh-issue-142589.nNAqgw.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()` handling of -tagged ints on the interpreter stack. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-06-23-22-52-20.gh-issue-134584.qbiQfG.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-06-23-22-52-20.gh-issue-134584.qbiQfG.rst deleted file mode 100644 index 34df14750464ce..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-06-23-22-52-20.gh-issue-134584.qbiQfG.rst +++ /dev/null @@ -1 +0,0 @@ -Eliminate redundant refcounting from ``_CALL_TUPLE_1``. Patch by Noam Cohen diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-06-28-04-32-38.gh-issue-134584.eZogqn.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-06-28-04-32-38.gh-issue-134584.eZogqn.rst deleted file mode 100644 index 97e24e5f881b92..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-06-28-04-32-38.gh-issue-134584.eZogqn.rst +++ /dev/null @@ -1 +0,0 @@ -Eliminate redundant refcounting from ``_CALL_BUILTIN_O``. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-06-28-17-54-27.gh-issue-134584.EXgPub.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-06-28-17-54-27.gh-issue-134584.EXgPub.rst deleted file mode 100644 index 638c170e262cab..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-06-28-17-54-27.gh-issue-134584.EXgPub.rst +++ /dev/null @@ -1 +0,0 @@ -Eliminate redundant refcounting from ``_CALL_STR_1``. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-07-11-19-57-27.gh-issue-132657.vwDuO2.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-07-11-19-57-27.gh-issue-132657.vwDuO2.rst deleted file mode 100644 index 27099329327158..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-07-11-19-57-27.gh-issue-132657.vwDuO2.rst +++ /dev/null @@ -1,2 +0,0 @@ -For the free-threaded build, avoid locking the :class:`set` object for the -``__contains__`` method. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-07-22-16-20-06.gh-issue-137007.1oPvvK.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-07-22-16-20-06.gh-issue-137007.1oPvvK.rst deleted file mode 100644 index cb25fd10c0bd2c..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-07-22-16-20-06.gh-issue-137007.1oPvvK.rst +++ /dev/null @@ -1 +0,0 @@ -Fix a bug during JIT compilation failure which caused garbage collection debug assertions to fail. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-15-14-04-35.gh-issue-141589.VfdMDD.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-15-14-04-35.gh-issue-141589.VfdMDD.rst deleted file mode 100644 index 5eb0e0c8b89f7a..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-15-14-04-35.gh-issue-141589.VfdMDD.rst +++ /dev/null @@ -1,3 +0,0 @@ -Change ``backoff counter`` to use prime numbers instead of powers of 2. -Use only 3 bits for ``counter`` and 13 bits for ``value``. -This allows to support values up to 8191. Patch by Mikhail Efimov. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-15-23-58-23.gh-issue-139103.9cVYJ0.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-15-23-58-23.gh-issue-139103.9cVYJ0.rst deleted file mode 100644 index c038dc742ccec9..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-15-23-58-23.gh-issue-139103.9cVYJ0.rst +++ /dev/null @@ -1 +0,0 @@ -Improve multithreaded scaling of dataclasses on the free-threaded build. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-16-21-14-48.gh-issue-41779.rXIj5h.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-16-21-14-48.gh-issue-41779.rXIj5h.rst deleted file mode 100644 index 8ba3ca8df86ec8..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-16-21-14-48.gh-issue-41779.rXIj5h.rst +++ /dev/null @@ -1,2 +0,0 @@ -Allowed defining the *__dict__* and *__weakref__* :ref:`__slots__ ` -for any class. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-17-14-40-45.gh-issue-139653.LzOy1M.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-17-14-40-45.gh-issue-139653.LzOy1M.rst deleted file mode 100644 index c3ae0e8adab319..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-17-14-40-45.gh-issue-139653.LzOy1M.rst +++ /dev/null @@ -1,4 +0,0 @@ -Only raise a ``RecursionError`` or trigger a fatal error if the stack -pointer is both below the limit pointer *and* above the stack base. If -outside of these bounds assume that it is OK. This prevents false positives -when user-space threads swap stacks. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-18-07-45-37.gh-issue-140638.i06qxD.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-18-07-45-37.gh-issue-140638.i06qxD.rst deleted file mode 100644 index 891e24d764488f..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-18-07-45-37.gh-issue-140638.i06qxD.rst +++ /dev/null @@ -1,2 +0,0 @@ -Expose a ``"duration"`` stat in :func:`gc.get_stats` and -:data:`gc.callbacks`. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-19-16-40-24.gh-issue-141732.PTetqp.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-19-16-40-24.gh-issue-141732.PTetqp.rst deleted file mode 100644 index 08420fd5f4d18a..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-19-16-40-24.gh-issue-141732.PTetqp.rst +++ /dev/null @@ -1,2 +0,0 @@ -Ensure the :meth:`~object.__repr__` for :exc:`ExceptionGroup` and :exc:`BaseExceptionGroup` does -not change when the exception sequence that was original passed in to its constructor is subsequently mutated. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-20-13-18-57.gh-issue-141780.xDrVNr.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-20-13-18-57.gh-issue-141780.xDrVNr.rst deleted file mode 100644 index 8700ac14824417..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-20-13-18-57.gh-issue-141780.xDrVNr.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix :c:macro:`Py_mod_gil` with API added in :pep:`793`: -:c:func:`!PyModule_FromSlotsAndSpec` and ``PyModExport`` hooks diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-20-22-09-22.gh-issue-140638.f6btj0.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-20-22-09-22.gh-issue-140638.f6btj0.rst deleted file mode 100644 index e3af941523cb75..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-20-22-09-22.gh-issue-140638.f6btj0.rst +++ /dev/null @@ -1,2 +0,0 @@ -Expose a ``"candidates"`` stat in :func:`gc.get_stats` and -:data:`gc.callbacks`. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-22-10-43-26.gh-issue-120158.41_rXd.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-22-10-43-26.gh-issue-120158.41_rXd.rst deleted file mode 100644 index b3b5f252ac07cb..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-22-10-43-26.gh-issue-120158.41_rXd.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix inconsistent state when enabling or disabling monitoring events too many -times. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-24-16-07-57.gh-issue-138122.m3EF9E.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-24-16-07-57.gh-issue-138122.m3EF9E.rst deleted file mode 100644 index a4a29e400274cb..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-24-16-07-57.gh-issue-138122.m3EF9E.rst +++ /dev/null @@ -1,6 +0,0 @@ -Add incomplete sample detection to prevent corrupted profiling data. Each -thread state now contains an embedded base frame (sentinel at the bottom of -the frame stack) with owner type ``FRAME_OWNED_BY_INTERPRETER``. The profiler -validates that stack unwinding terminates at this sentinel frame. Samples that -fail to reach the base frame (due to race conditions, memory corruption, or -other errors) are now rejected rather than being included as spurious data. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-24-21-09-30.gh-issue-141930.hIIzSd.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-24-21-09-30.gh-issue-141930.hIIzSd.rst deleted file mode 100644 index 06a12f98224e88..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-24-21-09-30.gh-issue-141930.hIIzSd.rst +++ /dev/null @@ -1,2 +0,0 @@ -When importing a module, use Python's regular file object to ensure that -writes to ``.pyc`` files are complete or an appropriate error is raised. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-25-02-23-31.gh-issue-141861.QcMdcM.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-25-02-23-31.gh-issue-141861.QcMdcM.rst deleted file mode 100644 index 4a115669998975..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-25-02-23-31.gh-issue-141861.QcMdcM.rst +++ /dev/null @@ -1 +0,0 @@ -Fix invalid memory read in the ``ENTER_EXECUTOR`` instruction. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-26-20-01-07.gh-issue-141976.K8NDmR.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-26-20-01-07.gh-issue-141976.K8NDmR.rst deleted file mode 100644 index 654681515e43e5..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-26-20-01-07.gh-issue-141976.K8NDmR.rst +++ /dev/null @@ -1 +0,0 @@ -Protect against specialization failures in the tracing JIT compiler for performance reasons. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-28-16-45-07.gh-issue-142029.JuXiKu.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-28-16-45-07.gh-issue-142029.JuXiKu.rst deleted file mode 100644 index b4cd284804de98..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-28-16-45-07.gh-issue-142029.JuXiKu.rst +++ /dev/null @@ -1,2 +0,0 @@ -Raise :exc:`ValueError` instead of crashing when empty string is used as a name -in ``_imp.create_builtin()``. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-08-51-56.gh-issue-142029.rUpcmt.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-08-51-56.gh-issue-142029.rUpcmt.rst deleted file mode 100644 index 017761adb1255e..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-08-51-56.gh-issue-142029.rUpcmt.rst +++ /dev/null @@ -1,2 +0,0 @@ -Raise :exc:`ModuleNotFoundError` instead of crashing when a nonexistent module -is used as a name in ``_imp.create_builtin()``. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-18-14-28.gh-issue-141770.JURnvg.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-18-14-28.gh-issue-141770.JURnvg.rst deleted file mode 100644 index 3a5c0fd70edb1e..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-29-18-14-28.gh-issue-141770.JURnvg.rst +++ /dev/null @@ -1,2 +0,0 @@ -Annotate anonymous mmap usage only when supported by the -Linux kernel and if ``-X dev`` is used or Python is built in debug mode. Patch by Donghee Na. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-01-15-22-54.gh-issue-65961.hCJvRB.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-01-15-22-54.gh-issue-65961.hCJvRB.rst deleted file mode 100644 index 59ab00ac8321f6..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-01-15-22-54.gh-issue-65961.hCJvRB.rst +++ /dev/null @@ -1 +0,0 @@ -Stop setting ``__cached__`` on modules. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-01-20-41-26.gh-issue-142048.c2YosX.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-01-20-41-26.gh-issue-142048.c2YosX.rst deleted file mode 100644 index 1400dae13ffe32..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-01-20-41-26.gh-issue-142048.c2YosX.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix quadratically increasing garbage collection delays in free-threaded -build. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-02-15-39-16.gh-issue-97850.H6QKwl.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-02-15-39-16.gh-issue-97850.H6QKwl.rst deleted file mode 100644 index f26d79d0c03bc8..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-02-15-39-16.gh-issue-97850.H6QKwl.rst +++ /dev/null @@ -1,3 +0,0 @@ -Remove all ``*.load_module()`` usage and definitions from the import system -and importlib. The method has been deprecated in favor of -``importlib.abc.Loader.exec_module()`` since Python 3.4. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-02-21-11-46.gh-issue-141976.yu7pDV.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-02-21-11-46.gh-issue-141976.yu7pDV.rst deleted file mode 100644 index f77315b7c37d80..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-02-21-11-46.gh-issue-141976.yu7pDV.rst +++ /dev/null @@ -1 +0,0 @@ -Check against abstract stack overflow in the JIT optimizer. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-03-11-03-35.gh-issue-142218.44Fq_J.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-03-11-03-35.gh-issue-142218.44Fq_J.rst deleted file mode 100644 index a8ce0fc65267d5..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-03-11-03-35.gh-issue-142218.44Fq_J.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix crash when inserting into a split table dictionary with a non -:class:`str` key that matches an existing key. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-14-33-54.gh-issue-142276.H4j8hP.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-14-33-54.gh-issue-142276.H4j8hP.rst deleted file mode 100644 index aa8e3da33580c8..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-14-33-54.gh-issue-142276.H4j8hP.rst +++ /dev/null @@ -1 +0,0 @@ -Fix missing type watcher when promoting attribute loads to constants in the JIT. Patch by Ken Jin. Reproducer by Yuancheng Jiang. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-15-59-03.gh-issue-135379.lDXbKO.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-15-59-03.gh-issue-135379.lDXbKO.rst deleted file mode 100644 index 7060b9b004cc25..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-15-59-03.gh-issue-135379.lDXbKO.rst +++ /dev/null @@ -1,6 +0,0 @@ -Implement a limited form of register allocation known as "top of stack -caching" in the JIT. It works by keeping 0-3 of the top items in the stack -in registers. The code generator generates multiple versions of those uops -that do not escape and are relatively small. During JIT compilation, the -copy that produces the least memory traffic is selected, spilling or -reloading values when needed. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-17-24-34.gh-issue-142305.ybXvtr.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-17-24-34.gh-issue-142305.ybXvtr.rst deleted file mode 100644 index 9e6d25ad33c759..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-05-17-24-34.gh-issue-142305.ybXvtr.rst +++ /dev/null @@ -1 +0,0 @@ -Decrease the size of the generated stencils and the runtime JIT code. Patch by Diego Russo. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-06-00-16-43.gh-issue-142236.m3EF9E.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-06-00-16-43.gh-issue-142236.m3EF9E.rst deleted file mode 100644 index b5c6a27fd6a259..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-06-00-16-43.gh-issue-142236.m3EF9E.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fix incorrect keyword suggestions for syntax errors in :mod:`traceback`. The -keyword typo suggestion mechanism would incorrectly suggest replacements when -the extracted source code was incomplete rather than containing an actual typo. -Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-06-00-38-37.gh-issue-142236.m3EF9E.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-06-00-38-37.gh-issue-142236.m3EF9E.rst deleted file mode 100644 index a8d37b49de7160..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-06-00-38-37.gh-issue-142236.m3EF9E.rst +++ /dev/null @@ -1,3 +0,0 @@ -Improve the "Perhaps you forgot a comma?" syntax error for multi-line string -concatenations to point to the last string instead of the first, making it -easier to locate where the comma is missing. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-13-04-37.gh-issue-142343.BTAyML.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-13-04-37.gh-issue-142343.BTAyML.rst deleted file mode 100644 index 9da936c2a6f3bd..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-13-04-37.gh-issue-142343.BTAyML.rst +++ /dev/null @@ -1 +0,0 @@ -Fix SIGILL crash on m68k due to incorrect assembly constraint. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-14-14-40.gh-issue-116738.x7aaBF.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-14-14-40.gh-issue-116738.x7aaBF.rst deleted file mode 100644 index dcf4d0efa6f293..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-14-14-40.gh-issue-116738.x7aaBF.rst +++ /dev/null @@ -1,2 +0,0 @@ -Make the attributes in :mod:`zlib` thread-safe on the :term:`free threaded -` build. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-17-34-57.gh-issue-142402.iV0ON3.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-17-34-57.gh-issue-142402.iV0ON3.rst deleted file mode 100644 index bad31470a25552..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-08-17-34-57.gh-issue-142402.iV0ON3.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix reference counting when adjacent literal parts are merged while constructing -:class:`string.templatelib.Template`, preventing the displaced string object -from leaking. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-10-23-03-10.gh-issue-142531.NUEa1T.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-10-23-03-10.gh-issue-142531.NUEa1T.rst deleted file mode 100644 index 15e03c1b9dd03f..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-10-23-03-10.gh-issue-142531.NUEa1T.rst +++ /dev/null @@ -1,5 +0,0 @@ -Fix a free-threaded GC performance regression. If there are many untracked -tuples, the GC will run too often, resulting in poor performance. The fix -is to include untracked tuples in the "long lived" object count. The number -of frozen objects is also now included since the free-threaded GC must -scan those too. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-13-17-20-38.gh-issue-142554.wNtEFF.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-13-17-20-38.gh-issue-142554.wNtEFF.rst deleted file mode 100644 index d0aafe2c44bb4a..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-13-17-20-38.gh-issue-142554.wNtEFF.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a crash in :func:`divmod` when :func:`!_pylong.int_divmod` does not -return a tuple of length two exactly. Patch by Bénédikt Tran. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-14-21-46-07.gh-issue-134584.vyec2h.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-14-21-46-07.gh-issue-134584.vyec2h.rst deleted file mode 100644 index b680d4163dd215..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-14-21-46-07.gh-issue-134584.vyec2h.rst +++ /dev/null @@ -1 +0,0 @@ -Eliminate redundant refcounting from ``_CALL_LIST_APPEND``. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-03-20-24.gh-issue-116738.NNHiTK.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-03-20-24.gh-issue-116738.NNHiTK.rst deleted file mode 100644 index bf06dfee23291e..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-03-20-24.gh-issue-116738.NNHiTK.rst +++ /dev/null @@ -1,2 +0,0 @@ -Make the attributes in :mod:`bz2` thread-safe on the :term:`free threaded -` build. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-01-21.gh-issue-142737.xYXzeB.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-01-21.gh-issue-142737.xYXzeB.rst deleted file mode 100644 index 8b743d1e49de21..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-01-21.gh-issue-142737.xYXzeB.rst +++ /dev/null @@ -1,3 +0,0 @@ -Tracebacks will be displayed in fallback mode even if :func:`io.open` is lost. -Previously, this would crash the interpreter. -Patch by Bartosz Sławecki. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-07-40.gh-issue-142718.zjiGjS.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-07-40.gh-issue-142718.zjiGjS.rst deleted file mode 100644 index 022707fe33e8d5..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-15-15-07-40.gh-issue-142718.zjiGjS.rst +++ /dev/null @@ -1 +0,0 @@ -JIT: Fix segfault caused by not flushing the stack to memory at side exits. diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-16-01-17-21.gh-issue-134584.tsxYYw.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-16-01-17-21.gh-issue-134584.tsxYYw.rst deleted file mode 100644 index 66bafbfc734bb1..00000000000000 --- a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-16-01-17-21.gh-issue-134584.tsxYYw.rst +++ /dev/null @@ -1 +0,0 @@ -Eliminate redundant refcounting from ``_STORE_ATTR_INSTANCE_VALUE``. diff --git a/Misc/NEWS.d/next/Documentation/2025-11-26-23-30-09.gh-issue-141994.arBEG6.rst b/Misc/NEWS.d/next/Documentation/2025-11-26-23-30-09.gh-issue-141994.arBEG6.rst deleted file mode 100644 index c370e8a86e1766..00000000000000 --- a/Misc/NEWS.d/next/Documentation/2025-11-26-23-30-09.gh-issue-141994.arBEG6.rst +++ /dev/null @@ -1,4 +0,0 @@ -:mod:`xml.sax.handler`: Make Documentation of -:data:`xml.sax.handler.feature_external_ges` warn of opening up to `external -entity attacks `_. -Patch by Sebastian Pipping. diff --git a/Misc/NEWS.d/next/Library/2021-10-23-22-12-13.bpo-40350.t0dQMY.rst b/Misc/NEWS.d/next/Library/2021-10-23-22-12-13.bpo-40350.t0dQMY.rst deleted file mode 100644 index a5236cc57a021d..00000000000000 --- a/Misc/NEWS.d/next/Library/2021-10-23-22-12-13.bpo-40350.t0dQMY.rst +++ /dev/null @@ -1 +0,0 @@ -Fix support for namespace packages in :mod:`modulefinder`. diff --git a/Misc/NEWS.d/next/Library/2024-05-20-12-35-52.gh-issue-115952.J6n_Kf.rst b/Misc/NEWS.d/next/Library/2024-05-20-12-35-52.gh-issue-115952.J6n_Kf.rst deleted file mode 100644 index 4c4c65d45d78a4..00000000000000 --- a/Misc/NEWS.d/next/Library/2024-05-20-12-35-52.gh-issue-115952.J6n_Kf.rst +++ /dev/null @@ -1,7 +0,0 @@ -Fix a potential memory denial of service in the :mod:`pickle` module. -When reading a pickled data received from untrusted source, it could cause -an arbitrary amount of memory to be allocated, even if the code that is -allowed to execute is restricted by overriding the -:meth:`~pickle.Unpickler.find_class` method. -This could have led to symptoms including a :exc:`MemoryError`, swapping, out -of memory (OOM) killed processes or containers, or even system crashes. diff --git a/Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst b/Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst deleted file mode 100644 index 0e1e8a9d6eb10a..00000000000000 --- a/Misc/NEWS.d/next/Library/2024-12-14-19-51-39.gh-issue-127930.WsGnh9.rst +++ /dev/null @@ -1 +0,0 @@ -Add ``__all__`` to :mod:`tkinter.simpledialog`. diff --git a/Misc/NEWS.d/next/Library/2025-05-30-18-37-44.gh-issue-134453.kxkA-o.rst b/Misc/NEWS.d/next/Library/2025-05-30-18-37-44.gh-issue-134453.kxkA-o.rst deleted file mode 100644 index fee975ea70230c..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-05-30-18-37-44.gh-issue-134453.kxkA-o.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fixed :func:`subprocess.Popen.communicate` ``input=`` handling of :class:`memoryview` -instances that were non-byte shaped on POSIX platforms. Those are now properly -cast to a byte shaped view instead of truncating the input. Windows platforms -did not have this bug. diff --git a/Misc/NEWS.d/next/Library/2025-07-10-18-40-11.gh-issue-135559.BMDtYn.rst b/Misc/NEWS.d/next/Library/2025-07-10-18-40-11.gh-issue-135559.BMDtYn.rst deleted file mode 100644 index 2ab3d4d76f38e8..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-07-10-18-40-11.gh-issue-135559.BMDtYn.rst +++ /dev/null @@ -1,2 +0,0 @@ -Flag: a ``dir()`` on a ``Flag`` enumeration now shows non-canonical members. -(i.e. aliases). diff --git a/Misc/NEWS.d/next/Library/2025-07-29-11-37-22.gh-issue-79986.fnJbE_.rst b/Misc/NEWS.d/next/Library/2025-07-29-11-37-22.gh-issue-79986.fnJbE_.rst deleted file mode 100644 index 327bbf869bce09..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-07-29-11-37-22.gh-issue-79986.fnJbE_.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add parsing for ``References`` and ``In-Reply-To`` headers to the :mod:`email` -library that parses the header content as lists of message id tokens. This -prevents them from being folded incorrectly. diff --git a/Misc/NEWS.d/next/Library/2025-09-09-10-13-24.gh-issue-138525.hDTaAM.rst b/Misc/NEWS.d/next/Library/2025-09-09-10-13-24.gh-issue-138525.hDTaAM.rst deleted file mode 100644 index c4cea4b74b8a4c..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-09-09-10-13-24.gh-issue-138525.hDTaAM.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add support for single-dash long options and alternate prefix characters in -:class:`argparse.BooleanOptionalAction`. diff --git a/Misc/NEWS.d/next/Library/2025-09-09-13-00-42.gh-issue-138697.QVwJw_.rst b/Misc/NEWS.d/next/Library/2025-09-09-13-00-42.gh-issue-138697.QVwJw_.rst deleted file mode 100644 index 35aaa7cf70f2fd..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-09-09-13-00-42.gh-issue-138697.QVwJw_.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fix inferring *dest* from a single-dash long option in :mod:`argparse`. If a -short option and a single-dash long option are passed to -:meth:`!add_argument`, *dest* is now inferred from the single-dash long -option. diff --git a/Misc/NEWS.d/next/Library/2025-10-09-15-46-18.gh-issue-139686.XwIZB2.rst b/Misc/NEWS.d/next/Library/2025-10-09-15-46-18.gh-issue-139686.XwIZB2.rst deleted file mode 100644 index 00dd3447eebb9b..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-10-09-15-46-18.gh-issue-139686.XwIZB2.rst +++ /dev/null @@ -1 +0,0 @@ -Make importlib.reload no-op for lazy modules. diff --git a/Misc/NEWS.d/next/Library/2025-10-12-12-43-56.gh-issue-76007.PyGM14.rst b/Misc/NEWS.d/next/Library/2025-10-12-12-43-56.gh-issue-76007.PyGM14.rst deleted file mode 100644 index 3a0914f38228bf..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-10-12-12-43-56.gh-issue-76007.PyGM14.rst +++ /dev/null @@ -1,2 +0,0 @@ -:mod:`pydoc`: Fix :exc:`DeprecationWarning` being raised when generating doc for -:term:`stdlib` modules. diff --git a/Misc/NEWS.d/next/Library/2025-10-23-06-38-35.gh-issue-139946.HZa5hu.rst b/Misc/NEWS.d/next/Library/2025-10-23-06-38-35.gh-issue-139946.HZa5hu.rst deleted file mode 100644 index fb47931728414d..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-10-23-06-38-35.gh-issue-139946.HZa5hu.rst +++ /dev/null @@ -1 +0,0 @@ -Distinguish stdout and stderr when colorizing output in argparse module. diff --git a/Misc/NEWS.d/next/Library/2025-10-27-17-00-11.gh-issue-140677.hM9pTq.rst b/Misc/NEWS.d/next/Library/2025-10-27-17-00-11.gh-issue-140677.hM9pTq.rst deleted file mode 100644 index 2daa15e13adf2b..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-10-27-17-00-11.gh-issue-140677.hM9pTq.rst +++ /dev/null @@ -1,4 +0,0 @@ -Add heatmap visualization mode to the Tachyon sampling profiler. The new -``--heatmap`` output format provides a line-by-line view showing execution -intensity with color-coded samples, inline statistics, and interactive call -graph navigation between callers and callees. diff --git a/Misc/NEWS.d/next/Library/2025-11-02-10-44-23.gh-issue-140875.wt6B37.rst b/Misc/NEWS.d/next/Library/2025-11-02-10-44-23.gh-issue-140875.wt6B37.rst deleted file mode 100644 index c08a8966d53401..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-02-10-44-23.gh-issue-140875.wt6B37.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix handling of unclosed character references (named and numerical) -followed by the end of file in :class:`html.parser.HTMLParser` with -``convert_charrefs=False``. diff --git a/Misc/NEWS.d/next/Library/2025-11-03-17-13-00.gh-issue-140911.7KFvSQ.rst b/Misc/NEWS.d/next/Library/2025-11-03-17-13-00.gh-issue-140911.7KFvSQ.rst deleted file mode 100644 index b0b6e4611924c2..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-03-17-13-00.gh-issue-140911.7KFvSQ.rst +++ /dev/null @@ -1,3 +0,0 @@ -:mod:`collections`: Ensure that the methods ``UserString.rindex()`` and -``UserString.index()`` accept :class:`collections.UserString` instances as the -sub argument. diff --git a/Misc/NEWS.d/next/Library/2025-11-10-00-14-20.gh-issue-116738.IxliC_.rst b/Misc/NEWS.d/next/Library/2025-11-10-00-14-20.gh-issue-116738.IxliC_.rst deleted file mode 100644 index 8b08bccafd73eb..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-10-00-14-20.gh-issue-116738.IxliC_.rst +++ /dev/null @@ -1,2 +0,0 @@ -Make csv module thread-safe on the :term:`free threaded ` -build. diff --git a/Misc/NEWS.d/next/Library/2025-11-13-13-11-02.gh-issue-60107.LZq3QF.rst b/Misc/NEWS.d/next/Library/2025-11-13-13-11-02.gh-issue-60107.LZq3QF.rst deleted file mode 100644 index c5103fb8005ebe..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-13-13-11-02.gh-issue-60107.LZq3QF.rst +++ /dev/null @@ -1,2 +0,0 @@ -Remove a copy from :meth:`io.RawIOBase.read`. If the underlying I/O class -keeps a reference to the mutable memory, raise a :exc:`BufferError`. diff --git a/Misc/NEWS.d/next/Library/2025-11-14-18-00-41.gh-issue-141565.Ap2bhJ.rst b/Misc/NEWS.d/next/Library/2025-11-14-18-00-41.gh-issue-141565.Ap2bhJ.rst deleted file mode 100644 index 628f1e0af033c7..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-14-18-00-41.gh-issue-141565.Ap2bhJ.rst +++ /dev/null @@ -1 +0,0 @@ -Add async-aware profiling to the Tachyon sampling profiler. The profiler now reconstructs and displays async task hierarchies in flamegraphs, making the output more actionable for users. Patch by Savannah Ostrowski and Pablo Galindo Salgado. diff --git a/Misc/NEWS.d/next/Library/2025-11-15-11-10-16.gh-issue-48752.aB3xYz.rst b/Misc/NEWS.d/next/Library/2025-11-15-11-10-16.gh-issue-48752.aB3xYz.rst deleted file mode 100644 index 37b91196658589..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-15-11-10-16.gh-issue-48752.aB3xYz.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add :func:`readline.get_pre_input_hook` function to retrieve the current -pre-input hook. This allows applications to save and restore the hook -without overwriting user settings. Patch by Sanyam Khurana. diff --git a/Misc/NEWS.d/next/Library/2025-11-15-14-58-12.gh-issue-141600.XY2BXg.rst b/Misc/NEWS.d/next/Library/2025-11-15-14-58-12.gh-issue-141600.XY2BXg.rst deleted file mode 100644 index 8071246f130ace..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-15-14-58-12.gh-issue-141600.XY2BXg.rst +++ /dev/null @@ -1 +0,0 @@ -Fix musl version detection on Void Linux. diff --git a/Misc/NEWS.d/next/Library/2025-11-16-04-40-06.gh-issue-69113.Xy7Fmn.rst b/Misc/NEWS.d/next/Library/2025-11-16-04-40-06.gh-issue-69113.Xy7Fmn.rst deleted file mode 100644 index cd76ae9b11ef28..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-16-04-40-06.gh-issue-69113.Xy7Fmn.rst +++ /dev/null @@ -1 +0,0 @@ -Fix :mod:`doctest` to correctly report line numbers for doctests in ``__test__`` dictionary when formatted as triple-quoted strings by finding unique lines in the string and matching them in the source file. diff --git a/Misc/NEWS.d/next/Library/2025-11-16-06-08-46.gh-issue-141615.--6EK3.rst b/Misc/NEWS.d/next/Library/2025-11-16-06-08-46.gh-issue-141615.--6EK3.rst deleted file mode 100644 index bb54e68398722f..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-16-06-08-46.gh-issue-141615.--6EK3.rst +++ /dev/null @@ -1 +0,0 @@ -Check ``stdin`` instead of ``stdout`` for ``use_rawinput`` in :mod:`pdb`. diff --git a/Misc/NEWS.d/next/Library/2025-11-17-00-53-51.gh-issue-141645.TC3TL3.rst b/Misc/NEWS.d/next/Library/2025-11-17-00-53-51.gh-issue-141645.TC3TL3.rst deleted file mode 100644 index d3f3bfddf6e867..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-17-00-53-51.gh-issue-141645.TC3TL3.rst +++ /dev/null @@ -1,4 +0,0 @@ -Add a new ``--live`` mode to the tachyon profiler in -:mod:`!profiling.sampling` module. This mode consist of a live TUI that -displays real-time profiling statistics as the target application runs, -similar to ``top``. Patch by Pablo Galindo diff --git a/Misc/NEWS.d/next/Library/2025-11-17-08-16-30.gh-issue-141659.QNi9Aj.rst b/Misc/NEWS.d/next/Library/2025-11-17-08-16-30.gh-issue-141659.QNi9Aj.rst deleted file mode 100644 index eeb055c6012a12..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-17-08-16-30.gh-issue-141659.QNi9Aj.rst +++ /dev/null @@ -1 +0,0 @@ -Fix bad file descriptor errors from ``_posixsubprocess`` on AIX. diff --git a/Misc/NEWS.d/next/Library/2025-11-17-16-53-49.gh-issue-141686.V-xaoI.rst b/Misc/NEWS.d/next/Library/2025-11-17-16-53-49.gh-issue-141686.V-xaoI.rst deleted file mode 100644 index 87e9cb8d69bfbc..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-17-16-53-49.gh-issue-141686.V-xaoI.rst +++ /dev/null @@ -1,2 +0,0 @@ -Break reference cycles created by each call to :func:`json.dump` or -:meth:`json.JSONEncoder.iterencode`. diff --git a/Misc/NEWS.d/next/Library/2025-11-17-21-41-58.gh-issue-141679.fs7zLJ.rst b/Misc/NEWS.d/next/Library/2025-11-17-21-41-58.gh-issue-141679.fs7zLJ.rst deleted file mode 100644 index b8203ca5a4a213..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-17-21-41-58.gh-issue-141679.fs7zLJ.rst +++ /dev/null @@ -1 +0,0 @@ -Add colour to defaults in :mod:`argparse` help. Patch by Hugo van Kemenade. diff --git a/Misc/NEWS.d/next/Library/2025-11-18-14-39-31.gh-issue-141570.q3n984.rst b/Misc/NEWS.d/next/Library/2025-11-18-14-39-31.gh-issue-141570.q3n984.rst deleted file mode 100644 index 8f4641ce4cf8c2..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-18-14-39-31.gh-issue-141570.q3n984.rst +++ /dev/null @@ -1,2 +0,0 @@ -Support :term:`file-like object` raising :exc:`OSError` from :meth:`~io.IOBase.fileno` in color -detection (``_colorize.can_colorize()``). This can occur when ``sys.stdout`` is redirected. diff --git a/Misc/NEWS.d/next/Library/2025-11-18-15-48-13.gh-issue-105836.sbUw24.rst b/Misc/NEWS.d/next/Library/2025-11-18-15-48-13.gh-issue-105836.sbUw24.rst deleted file mode 100644 index d2edc5b2cb743d..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-18-15-48-13.gh-issue-105836.sbUw24.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix :meth:`asyncio.run_coroutine_threadsafe` leaving underlying cancelled -asyncio task running. diff --git a/Misc/NEWS.d/next/Library/2025-11-21-21-14-10.gh-issue-141817._v5LdB.rst b/Misc/NEWS.d/next/Library/2025-11-21-21-14-10.gh-issue-141817._v5LdB.rst deleted file mode 100644 index 774e13b2129f8c..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-21-21-14-10.gh-issue-141817._v5LdB.rst +++ /dev/null @@ -1 +0,0 @@ -Add :data:`!socket.IPV6_HDRINCL` constant. diff --git a/Misc/NEWS.d/next/Library/2025-11-22-16-33-48.gh-issue-141863.4PLhnv.rst b/Misc/NEWS.d/next/Library/2025-11-22-16-33-48.gh-issue-141863.4PLhnv.rst deleted file mode 100644 index 585774ba2cb66b..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-22-16-33-48.gh-issue-141863.4PLhnv.rst +++ /dev/null @@ -1,2 +0,0 @@ -Update :ref:`asyncio-streams` to use :meth:`bytearray.take_bytes` for a over -10% performance improvement on pyperformance asyncio_tcp benchmark. diff --git a/Misc/NEWS.d/next/Library/2025-11-24-06-44-45.gh-issue-141781.MsK27r.rst b/Misc/NEWS.d/next/Library/2025-11-24-06-44-45.gh-issue-141781.MsK27r.rst deleted file mode 100644 index 21db97025a3d50..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-24-06-44-45.gh-issue-141781.MsK27r.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue where pdb.line_prefix assignment was ignored if assigned after the module was imported. diff --git a/Misc/NEWS.d/next/Library/2025-11-24-14-05-52.gh-issue-138122.2bbGA8.rst b/Misc/NEWS.d/next/Library/2025-11-24-14-05-52.gh-issue-138122.2bbGA8.rst deleted file mode 100644 index 5742beeb85c2a7..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-24-14-05-52.gh-issue-138122.2bbGA8.rst +++ /dev/null @@ -1,5 +0,0 @@ -The ``profiling.sampling`` flamegraph profiler now displays thread status -statistics showing the percentage of time threads spend holding the GIL, -running without the GIL, waiting for the GIL, and performing garbage -collection. These statistics help identify GIL contention and thread behavior -patterns. When filtering by thread, the display shows per-thread metrics. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-13-13-34.gh-issue-116738.MnZRdV.rst b/Misc/NEWS.d/next/Library/2025-11-25-13-13-34.gh-issue-116738.MnZRdV.rst deleted file mode 100644 index 151f8968292a61..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-25-13-13-34.gh-issue-116738.MnZRdV.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix thread safety issue with :mod:`re` scanner objects in free-threaded -builds. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-16-00-29.gh-issue-59000.YtOyJy.rst b/Misc/NEWS.d/next/Library/2025-11-25-16-00-29.gh-issue-59000.YtOyJy.rst deleted file mode 100644 index 33ab8a0659e4a2..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-25-16-00-29.gh-issue-59000.YtOyJy.rst +++ /dev/null @@ -1 +0,0 @@ -Fix :mod:`pdb` breakpoint resolution for class methods when the module defining the class is not imported. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-22-54-07.gh-issue-141968.vg3AMJ.rst b/Misc/NEWS.d/next/Library/2025-11-25-22-54-07.gh-issue-141968.vg3AMJ.rst deleted file mode 100644 index 4c89902813f6a6..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-25-22-54-07.gh-issue-141968.vg3AMJ.rst +++ /dev/null @@ -1,2 +0,0 @@ -Remove a data copy from :func:`base64.b32decode` and -:func:`base64.b32encode` by using :meth:`bytearray.take_bytes`. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-23-22-46.gh-issue-141968.R1sHnJ.rst b/Misc/NEWS.d/next/Library/2025-11-25-23-22-46.gh-issue-141968.R1sHnJ.rst deleted file mode 100644 index eca0ac4c8e6014..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-25-23-22-46.gh-issue-141968.R1sHnJ.rst +++ /dev/null @@ -1,2 +0,0 @@ -Remove data copy from :func:`wave.Wave_read.readframes` and -:func:`wave.Wave_write.writeframes` by using :meth:`bytearray.take_bytes`. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-23-29-08.gh-issue-141968.0JnjXf.rst b/Misc/NEWS.d/next/Library/2025-11-25-23-29-08.gh-issue-141968.0JnjXf.rst deleted file mode 100644 index 0cefeed30ed8a9..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-25-23-29-08.gh-issue-141968.0JnjXf.rst +++ /dev/null @@ -1,2 +0,0 @@ -Remove data copy from :mod:`codecs` ``punycode`` encoding by using -:meth:`bytearray.take_bytes`. diff --git a/Misc/NEWS.d/next/Library/2025-11-25-23-35-07.gh-issue-141968.b3Gscp.rst b/Misc/NEWS.d/next/Library/2025-11-25-23-35-07.gh-issue-141968.b3Gscp.rst deleted file mode 100644 index 50124e8b19609f..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-25-23-35-07.gh-issue-141968.b3Gscp.rst +++ /dev/null @@ -1,2 +0,0 @@ -Remove data copy from :mod:`encodings.idna` :meth:`~codecs.Codec.encode` and -:meth:`~codecs.IncrementalEncoder.encode` by using :meth:`bytearray.take_bytes`. diff --git a/Misc/NEWS.d/next/Library/2025-11-26-14-20-10.gh-issue-141968.W139Pv.rst b/Misc/NEWS.d/next/Library/2025-11-26-14-20-10.gh-issue-141968.W139Pv.rst deleted file mode 100644 index c5375707814ff5..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-26-14-20-10.gh-issue-141968.W139Pv.rst +++ /dev/null @@ -1,2 +0,0 @@ -Remove data copy from :mod:`re` compilation of regexes with large charsets -by using :meth:`bytearray.take_bytes`. diff --git a/Misc/NEWS.d/next/Library/2025-11-27-10-49-13.gh-issue-142006.nzJDG5.rst b/Misc/NEWS.d/next/Library/2025-11-27-10-49-13.gh-issue-142006.nzJDG5.rst deleted file mode 100644 index 49643892ff9ccd..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-27-10-49-13.gh-issue-142006.nzJDG5.rst +++ /dev/null @@ -1 +0,0 @@ -Fix a bug in the :mod:`email.policy.default` folding algorithm which incorrectly resulted in a doubled newline when a line ending at exactly max_line_length was followed by an unfoldable token. diff --git a/Misc/NEWS.d/next/Library/2025-11-27-11-39-50.gh-issue-141999._FKGlu.rst b/Misc/NEWS.d/next/Library/2025-11-27-11-39-50.gh-issue-141999._FKGlu.rst deleted file mode 100644 index 3b54a831b54c3c..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-27-11-39-50.gh-issue-141999._FKGlu.rst +++ /dev/null @@ -1,2 +0,0 @@ -Correctly allow :exc:`KeyboardInterrupt` to stop the process when using -:mod:`!profiling.sampling`. diff --git a/Misc/NEWS.d/next/Library/2025-11-27-20-16-38.gh-issue-141473.Wq4xVN.rst b/Misc/NEWS.d/next/Library/2025-11-27-20-16-38.gh-issue-141473.Wq4xVN.rst deleted file mode 100644 index f6aa592cefda35..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-27-20-16-38.gh-issue-141473.Wq4xVN.rst +++ /dev/null @@ -1,4 +0,0 @@ -When :meth:`subprocess.Popen.communicate` was called with *input* and a -*timeout* and is called for a second time after a -:exc:`~subprocess.TimeoutExpired` exception before the process has died, it -should no longer hang. diff --git a/Misc/NEWS.d/next/Library/2025-11-28-08-25-19.gh-issue-141939.BXPnFj.rst b/Misc/NEWS.d/next/Library/2025-11-28-08-25-19.gh-issue-141939.BXPnFj.rst deleted file mode 100644 index 1015d90c501fd0..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-28-08-25-19.gh-issue-141939.BXPnFj.rst +++ /dev/null @@ -1 +0,0 @@ -Add color to all interpolated values in :mod:`argparse` help, like ``%(default)s`` or ``%(choices)s``. Patch by Alex Prengère. diff --git a/Misc/NEWS.d/next/Library/2025-11-29-03-02-45.gh-issue-87512.bn4xbm.rst b/Misc/NEWS.d/next/Library/2025-11-29-03-02-45.gh-issue-87512.bn4xbm.rst deleted file mode 100644 index 091350108eea1b..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-29-03-02-45.gh-issue-87512.bn4xbm.rst +++ /dev/null @@ -1,5 +0,0 @@ -Fix :func:`subprocess.Popen.communicate` timeout handling on Windows -when writing large input. Previously, the timeout was ignored during -stdin writing, causing the method to block indefinitely if the child -process did not consume input quickly. The stdin write is now performed -in a background thread, allowing the timeout to be properly enforced. diff --git a/Misc/NEWS.d/next/Library/2025-11-29-04-20-44.gh-issue-74389.pW3URj.rst b/Misc/NEWS.d/next/Library/2025-11-29-04-20-44.gh-issue-74389.pW3URj.rst deleted file mode 100644 index a9bf5f80d80c9f..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-29-04-20-44.gh-issue-74389.pW3URj.rst +++ /dev/null @@ -1,3 +0,0 @@ -When the stdin being used by a :class:`subprocess.Popen` instance is closed, -this is now ignored in :meth:`subprocess.Popen.communicate` instead of -leaving the class in an inconsistent state. diff --git a/Misc/NEWS.d/next/Library/2025-11-30-04-28-30.gh-issue-141982.pxZct9.rst b/Misc/NEWS.d/next/Library/2025-11-30-04-28-30.gh-issue-141982.pxZct9.rst deleted file mode 100644 index e5ec593dd6e65d..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-11-30-04-28-30.gh-issue-141982.pxZct9.rst +++ /dev/null @@ -1 +0,0 @@ -Allow :mod:`pdb` to set breakpoints on async functions with function names. diff --git a/Misc/NEWS.d/next/Library/2025-12-01-10-03-08.gh-issue-116738.972YsG.rst b/Misc/NEWS.d/next/Library/2025-12-01-10-03-08.gh-issue-116738.972YsG.rst deleted file mode 100644 index d6d9d02b017473..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-01-10-03-08.gh-issue-116738.972YsG.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix :mod:`cmath` data race when initializing trigonometric tables with -subinterpreters. diff --git a/Misc/NEWS.d/next/Library/2025-12-01-14-43-58.gh-issue-138122.nRm3ic.rst b/Misc/NEWS.d/next/Library/2025-12-01-14-43-58.gh-issue-138122.nRm3ic.rst deleted file mode 100644 index e24fea416ff38b..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-01-14-43-58.gh-issue-138122.nRm3ic.rst +++ /dev/null @@ -1,5 +0,0 @@ -The ``_remote_debugging`` module now implements frame caching in the -``RemoteUnwinder`` class to reduce memory reads when profiling remote -processes. When ``cache_frames=True``, unchanged portions of the call stack -are reused from previous samples, significantly improving profiling -performance for deep call stacks. diff --git a/Misc/NEWS.d/next/Library/2025-12-02-14-52-51.gh-issue-142203.ofWOvV.rst b/Misc/NEWS.d/next/Library/2025-12-02-14-52-51.gh-issue-142203.ofWOvV.rst deleted file mode 100644 index 87e5870ddd6389..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-02-14-52-51.gh-issue-142203.ofWOvV.rst +++ /dev/null @@ -1,3 +0,0 @@ -Remove the *debug_override* parameter from -:func:`importlib.util.cache_from_source` which has been deprecated since -Python 3.5. diff --git a/Misc/NEWS.d/next/Library/2025-12-03-06-12-39.gh-issue-142214.appYNZ.rst b/Misc/NEWS.d/next/Library/2025-12-03-06-12-39.gh-issue-142214.appYNZ.rst deleted file mode 100644 index b87430ec1a3d65..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-03-06-12-39.gh-issue-142214.appYNZ.rst +++ /dev/null @@ -1,12 +0,0 @@ -Fix two regressions in :mod:`dataclasses` in Python 3.14.1 related to -annotations. - -* An exception is no longer raised if ``slots=True`` is used and the - ``__init__`` method does not have an ``__annotate__`` attribute - (likely because ``init=False`` was used). - -* An exception is no longer raised if annotations are requested on the - ``__init__`` method and one of the fields is not present in the class - annotations. This can occur in certain dynamic scenarios. - -Patch by Jelle Zijlstra. diff --git a/Misc/NEWS.d/next/Library/2025-12-03-09-36-29.gh-issue-142206.ilwegH.rst b/Misc/NEWS.d/next/Library/2025-12-03-09-36-29.gh-issue-142206.ilwegH.rst deleted file mode 100644 index 90e4dd96985979..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-03-09-36-29.gh-issue-142206.ilwegH.rst +++ /dev/null @@ -1,4 +0,0 @@ -The resource tracker in the :mod:`multiprocessing` module can now understand -messages from older versions of itself. This avoids issues with upgrading -Python while it is running. (Note that such 'in-place' upgrades are not -tested.) diff --git a/Misc/NEWS.d/next/Library/2025-12-04-09-22-31.gh-issue-68552.I_v-xB.rst b/Misc/NEWS.d/next/Library/2025-12-04-09-22-31.gh-issue-68552.I_v-xB.rst deleted file mode 100644 index bd3e53c9f8193f..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-04-09-22-31.gh-issue-68552.I_v-xB.rst +++ /dev/null @@ -1 +0,0 @@ -``MisplacedEnvelopeHeaderDefect`` and ``Missing header name`` defects are now correctly passed to the ``handle_defect`` method of ``policy`` in :class:`~email.parser.FeedParser`. diff --git a/Misc/NEWS.d/next/Library/2025-12-04-23-24-24.gh-issue-139862.NBfsD4.rst b/Misc/NEWS.d/next/Library/2025-12-04-23-24-24.gh-issue-139862.NBfsD4.rst deleted file mode 100644 index 2bee8881a75749..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-04-23-24-24.gh-issue-139862.NBfsD4.rst +++ /dev/null @@ -1 +0,0 @@ -Remove ``color`` parameter from :class:`!argparse.HelpFormatter` constructor. Color is controlled by :class:`~argparse.ArgumentParser`. diff --git a/Misc/NEWS.d/next/Library/2025-12-04-23-26-12.gh-issue-142267.yOM6fP.rst b/Misc/NEWS.d/next/Library/2025-12-04-23-26-12.gh-issue-142267.yOM6fP.rst deleted file mode 100644 index f46e82105fc2f5..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-04-23-26-12.gh-issue-142267.yOM6fP.rst +++ /dev/null @@ -1 +0,0 @@ -Improve :mod:`argparse` performance by caching the formatter used for argument validation. diff --git a/Misc/NEWS.d/next/Library/2025-12-05-16-39-17.gh-issue-75949.pHxW98.rst b/Misc/NEWS.d/next/Library/2025-12-05-16-39-17.gh-issue-75949.pHxW98.rst deleted file mode 100644 index 5ca3fc05b9816d..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-05-16-39-17.gh-issue-75949.pHxW98.rst +++ /dev/null @@ -1 +0,0 @@ -Fix :mod:`argparse` to preserve ``|`` separators in mutually exclusive groups when the usage line wraps due to length. diff --git a/Misc/NEWS.d/next/Library/2025-12-05-18-25-29.gh-issue-142318.EzcQ3N.rst b/Misc/NEWS.d/next/Library/2025-12-05-18-25-29.gh-issue-142318.EzcQ3N.rst deleted file mode 100644 index 8710ebfb1a1a0a..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-05-18-25-29.gh-issue-142318.EzcQ3N.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix typing ``'q'`` at the help of the interactive tachyon profiler exiting -the profiler. diff --git a/Misc/NEWS.d/next/Library/2025-12-05-18-26-50.gh-issue-142282.g6RQUN.rst b/Misc/NEWS.d/next/Library/2025-12-05-18-26-50.gh-issue-142282.g6RQUN.rst deleted file mode 100644 index d038cd40f4f57a..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-05-18-26-50.gh-issue-142282.g6RQUN.rst +++ /dev/null @@ -1 +0,0 @@ -Fix :func:`winreg.QueryValueEx` to not accidentally read garbage buffer under race condition. diff --git a/Misc/NEWS.d/next/Library/2025-12-06-13-02-13.gh-issue-142332.PNvXCV.rst b/Misc/NEWS.d/next/Library/2025-12-06-13-02-13.gh-issue-142332.PNvXCV.rst deleted file mode 100644 index ee2d5e1d4911a7..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-06-13-02-13.gh-issue-142332.PNvXCV.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix usage formatting for positional arguments in mutually exclusive groups in :mod:`argparse`. -in :mod:`argparse`. diff --git a/Misc/NEWS.d/next/Library/2025-12-06-13-19-43.gh-issue-142207.x_X9oH.rst b/Misc/NEWS.d/next/Library/2025-12-06-13-19-43.gh-issue-142207.x_X9oH.rst deleted file mode 100644 index 69ca8c41ac9b8b..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-06-13-19-43.gh-issue-142207.x_X9oH.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix: profiling.sampling may cause assertion ``!(has_gil && -gil_requested)`` diff --git a/Misc/NEWS.d/next/Library/2025-12-06-16-45-34.gh-issue-64532.4OXZpF.rst b/Misc/NEWS.d/next/Library/2025-12-06-16-45-34.gh-issue-64532.4OXZpF.rst deleted file mode 100644 index 3bd950050aedf4..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-06-16-45-34.gh-issue-64532.4OXZpF.rst +++ /dev/null @@ -1 +0,0 @@ -Subparser help now includes required optional arguments from the parent parser in the usage, making it clearer what arguments are needed to run a subcommand. Patch by Savannah Ostrowski. diff --git a/Misc/NEWS.d/next/Library/2025-12-07-02-36-24.gh-issue-142315.02o5E_.rst b/Misc/NEWS.d/next/Library/2025-12-07-02-36-24.gh-issue-142315.02o5E_.rst deleted file mode 100644 index e9c5ba3c0639f2..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-07-02-36-24.gh-issue-142315.02o5E_.rst +++ /dev/null @@ -1,2 +0,0 @@ -Pdb can now run scripts from anonymous pipes used in process substitution. -Patch by Bartosz Sławecki. diff --git a/Misc/NEWS.d/next/Library/2025-12-07-13-37-18.gh-issue-142374.m3EF9E.rst b/Misc/NEWS.d/next/Library/2025-12-07-13-37-18.gh-issue-142374.m3EF9E.rst deleted file mode 100644 index c19100caa36aa5..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-07-13-37-18.gh-issue-142374.m3EF9E.rst +++ /dev/null @@ -1,7 +0,0 @@ -Fix cumulative percentage calculation for recursive functions in the new -sampling profiler. When profiling recursive functions, cumulative statistics -(cumul%, cumtime) could exceed 100% because each recursive frame in a stack -was counted separately. For example, a function recursing 500 times in every -sample would show 50000% cumulative presence. The fix deduplicates locations -within each sample so cumulative stats correctly represent "percentage of -samples where this function was on the stack". Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Library/2025-12-07-17-30-05.gh-issue-142346.okcAAp.rst b/Misc/NEWS.d/next/Library/2025-12-07-17-30-05.gh-issue-142346.okcAAp.rst deleted file mode 100644 index cf570f314c00cc..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-07-17-30-05.gh-issue-142346.okcAAp.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix usage formatting for mutually exclusive groups in :mod:`argparse` -when they are preceded by positional arguments or followed or intermixed -with other optional arguments. diff --git a/Misc/NEWS.d/next/Library/2025-12-07-22-13-28.gh-issue-142389.J9v904.rst b/Misc/NEWS.d/next/Library/2025-12-07-22-13-28.gh-issue-142389.J9v904.rst deleted file mode 100644 index 44e9cea7b54a8f..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-07-22-13-28.gh-issue-142389.J9v904.rst +++ /dev/null @@ -1 +0,0 @@ -Add backtick markup support in :mod:`argparse` description and epilog text to highlight inline code when color output is enabled. diff --git a/Misc/NEWS.d/next/Library/2025-12-07-23-21-13.gh-issue-138122.m3EF9E.rst b/Misc/NEWS.d/next/Library/2025-12-07-23-21-13.gh-issue-138122.m3EF9E.rst deleted file mode 100644 index 5cc54e68f24848..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-07-23-21-13.gh-issue-138122.m3EF9E.rst +++ /dev/null @@ -1,5 +0,0 @@ -Add bytecode-level instruction profiling to the sampling profiler via the -new ``--opcodes`` flag. When enabled, the profiler captures which bytecode -opcode is executing at each sample, including Python 3.11+ adaptive -specializations, and visualizes this data in the heatmap, flamegraph, gecko, -and live output formats. Patch by Pablo Galindo diff --git a/Misc/NEWS.d/next/Library/2025-12-08-18-12-44.gh-issue-142438.UF_0nd.rst b/Misc/NEWS.d/next/Library/2025-12-08-18-12-44.gh-issue-142438.UF_0nd.rst deleted file mode 100644 index ec6b3ff09e3a8c..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-08-18-12-44.gh-issue-142438.UF_0nd.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a possible leaked GIL in _PySSL_keylog_callback. diff --git a/Misc/NEWS.d/next/Library/2025-12-09-14-40-45.gh-issue-112527.Tvf5Zk.rst b/Misc/NEWS.d/next/Library/2025-12-09-14-40-45.gh-issue-112527.Tvf5Zk.rst deleted file mode 100644 index 70447bc6437677..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-09-14-40-45.gh-issue-112527.Tvf5Zk.rst +++ /dev/null @@ -1,2 +0,0 @@ -The help text for required options in :mod:`argparse` no -longer extended with " (default: None)". diff --git a/Misc/NEWS.d/next/Library/2025-12-09-22-11-59.gh-issue-138122.CsoBEo.rst b/Misc/NEWS.d/next/Library/2025-12-09-22-11-59.gh-issue-138122.CsoBEo.rst deleted file mode 100644 index 5aaa2cba99aa4d..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-09-22-11-59.gh-issue-138122.CsoBEo.rst +++ /dev/null @@ -1,8 +0,0 @@ -The ``profiling.sampling`` flamegraph profiler now supports inverted -flamegraph view that aggregates all leaf nodes. In a standard flamegraph, if -a hot function is called from multiple locations, it appears multiple times -as separate leaf nodes. In the inverted flamegraph, all occurrences of the -same leaf function are merged into a single aggregated node at the root, -showing the total hotness of that function in one place. The children of each -aggregated node represent its callers, making it easier to identify which -functions consume the most CPU time and where they are called from. diff --git a/Misc/NEWS.d/next/Library/2025-12-10-11-02-53.gh-issue-142451.eCLvhG.rst b/Misc/NEWS.d/next/Library/2025-12-10-11-02-53.gh-issue-142451.eCLvhG.rst deleted file mode 100644 index 3726d4178e26e4..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-10-11-02-53.gh-issue-142451.eCLvhG.rst +++ /dev/null @@ -1,2 +0,0 @@ -:mod:`hmac`: correctly copy :class:`~hmac.HMAC` attributes for objects -copied through :meth:`HMAC.copy() `. Patch by Bénédikt Tran. diff --git a/Misc/NEWS.d/next/Library/2025-12-10-11-20-05.gh-issue-123241.oYg2n7.rst b/Misc/NEWS.d/next/Library/2025-12-10-11-20-05.gh-issue-123241.oYg2n7.rst deleted file mode 100644 index 871a03a6fd1021..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-10-11-20-05.gh-issue-123241.oYg2n7.rst +++ /dev/null @@ -1,2 +0,0 @@ -Avoid reference count operations in garbage collection of :mod:`ctypes` -objects. diff --git a/Misc/NEWS.d/next/Library/2025-12-10-21-19-10.gh-issue-142539._8Vzr0.rst b/Misc/NEWS.d/next/Library/2025-12-10-21-19-10.gh-issue-142539._8Vzr0.rst deleted file mode 100644 index ddebe9f3ed8f8c..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-10-21-19-10.gh-issue-142539._8Vzr0.rst +++ /dev/null @@ -1,2 +0,0 @@ -:mod:`traceback`: Fix location of carets in :exc:`SyntaxError`\s when the -source contains wide characters. diff --git a/Misc/NEWS.d/next/Library/2025-12-11-04-18-49.gh-issue-138122.m3EF9E.rst b/Misc/NEWS.d/next/Library/2025-12-11-04-18-49.gh-issue-138122.m3EF9E.rst deleted file mode 100644 index 9c471ee438df15..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-11-04-18-49.gh-issue-138122.m3EF9E.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add ``--mode=exception`` to the sampling profiler to capture samples only from -threads with an active exception, useful for analyzing exception handling -overhead. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Library/2025-12-11-09-03-07.gh-issue-142556.RuiBte.rst b/Misc/NEWS.d/next/Library/2025-12-11-09-03-07.gh-issue-142556.RuiBte.rst deleted file mode 100644 index 782e62b65a36f3..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-11-09-03-07.gh-issue-142556.RuiBte.rst +++ /dev/null @@ -1 +0,0 @@ -Fix crash when a task gets re-registered during finalization in :mod:`asyncio`. Patch by Kumar Aditya. diff --git a/Misc/NEWS.d/next/Library/2025-12-12-02-56-26.gh-issue-142595.wHvTqq.rst b/Misc/NEWS.d/next/Library/2025-12-12-02-56-26.gh-issue-142595.wHvTqq.rst deleted file mode 100644 index 987e1ae8354b18..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-12-02-56-26.gh-issue-142595.wHvTqq.rst +++ /dev/null @@ -1,2 +0,0 @@ -Added type check during initialization of the :mod:`decimal` module to -prevent a crash in case of broken stdlib. Patch by Sergey B Kirpichev. diff --git a/Misc/NEWS.d/next/Library/2025-12-12-15-14-03.gh-issue-138122.m3EF9E.rst b/Misc/NEWS.d/next/Library/2025-12-12-15-14-03.gh-issue-138122.m3EF9E.rst deleted file mode 100644 index cf9a0a35ce9b76..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-12-15-14-03.gh-issue-138122.m3EF9E.rst +++ /dev/null @@ -1,6 +0,0 @@ -Add ``--subprocesses`` flag to :mod:`profiling.sampling` CLI to automatically -profile subprocesses spawned by the target. When enabled, the profiler -monitors for new Python subprocesses and profiles each one separately, -writing results to individual output files. This is useful for profiling -applications that use :mod:`multiprocessing`, :class:`~concurrent.futures.ProcessPoolExecutor`, -or other subprocess-based parallelism. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Library/2025-12-13-00-09-09.gh-issue-76007.Xg1xCO.rst b/Misc/NEWS.d/next/Library/2025-12-13-00-09-09.gh-issue-76007.Xg1xCO.rst deleted file mode 100644 index 48e9d30497716e..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-13-00-09-09.gh-issue-76007.Xg1xCO.rst +++ /dev/null @@ -1,2 +0,0 @@ -Deprecate ``__version__`` from :mod:`http.server`. Patch by Hugo van -Kemenade. diff --git a/Misc/NEWS.d/next/Library/2025-12-13-06-17-44.gh-issue-142651.ZRtBu4.rst b/Misc/NEWS.d/next/Library/2025-12-13-06-17-44.gh-issue-142651.ZRtBu4.rst deleted file mode 100644 index 236900bac5d6f6..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-13-06-17-44.gh-issue-142651.ZRtBu4.rst +++ /dev/null @@ -1,3 +0,0 @@ -:mod:`unittest.mock`: fix a thread safety issue where :attr:`Mock.call_count -` may return inaccurate values when the mock -is called concurrently from multiple threads. diff --git a/Misc/NEWS.d/next/Library/2025-12-13-21-19-28.gh-issue-76007.6fs_gT.rst b/Misc/NEWS.d/next/Library/2025-12-13-21-19-28.gh-issue-76007.6fs_gT.rst deleted file mode 100644 index 99f73bb094c620..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-13-21-19-28.gh-issue-76007.6fs_gT.rst +++ /dev/null @@ -1 +0,0 @@ -Deprecate ``__version__`` from :mod:`ctypes`. Patch by Hugo van Kemenade. diff --git a/Misc/NEWS.d/next/Library/2025-12-13-23-26-42.gh-issue-142495.I88Uv_.rst b/Misc/NEWS.d/next/Library/2025-12-13-23-26-42.gh-issue-142495.I88Uv_.rst new file mode 100644 index 00000000000000..3e1a624fe56473 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-12-13-23-26-42.gh-issue-142495.I88Uv_.rst @@ -0,0 +1,4 @@ +:class:`collections.defaultdict` now prioritizes :meth:`~object.__setitem__` +when inserting default values from ``default_factory``. This prevents race +conditions where a default value would overwrite a value set before +``default_factory`` returns. diff --git a/Misc/NEWS.d/next/Library/2025-12-14-18-30-48.gh-issue-142594.belDmD.rst b/Misc/NEWS.d/next/Library/2025-12-14-18-30-48.gh-issue-142594.belDmD.rst deleted file mode 100644 index ee6a958933f7c8..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-12-14-18-30-48.gh-issue-142594.belDmD.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix crash in ``TextIOWrapper.close()`` when the underlying buffer's -``closed`` property calls :meth:`~io.TextIOBase.detach`. diff --git a/Misc/NEWS.d/next/Security/2024-05-21-22-11-31.gh-issue-119342.BTFj4Z.rst b/Misc/NEWS.d/next/Security/2024-05-21-22-11-31.gh-issue-119342.BTFj4Z.rst deleted file mode 100644 index 04fd8faca4cf7e..00000000000000 --- a/Misc/NEWS.d/next/Security/2024-05-21-22-11-31.gh-issue-119342.BTFj4Z.rst +++ /dev/null @@ -1,5 +0,0 @@ -Fix a potential memory denial of service in the :mod:`plistlib` module. -When reading a Plist file received from untrusted source, it could cause -an arbitrary amount of memory to be allocated. -This could have led to symptoms including a :exc:`MemoryError`, swapping, out -of memory (OOM) killed processes or containers, or even system crashes. diff --git a/Misc/NEWS.d/next/Security/2024-05-23-11-47-48.gh-issue-119451.qkJe9-.rst b/Misc/NEWS.d/next/Security/2024-05-23-11-47-48.gh-issue-119451.qkJe9-.rst deleted file mode 100644 index 6d6f25cd2f8bf7..00000000000000 --- a/Misc/NEWS.d/next/Security/2024-05-23-11-47-48.gh-issue-119451.qkJe9-.rst +++ /dev/null @@ -1,5 +0,0 @@ -Fix a potential memory denial of service in the :mod:`http.client` module. -When connecting to a malicious server, it could cause -an arbitrary amount of memory to be allocated. -This could have led to symptoms including a :exc:`MemoryError`, swapping, out -of memory (OOM) killed processes or containers, or even system crashes. diff --git a/Misc/NEWS.d/next/Security/2025-11-13-22-31-56.gh-issue-42400.pqB5Kq.rst b/Misc/NEWS.d/next/Security/2025-11-13-22-31-56.gh-issue-42400.pqB5Kq.rst deleted file mode 100644 index 17dc241aef91d6..00000000000000 --- a/Misc/NEWS.d/next/Security/2025-11-13-22-31-56.gh-issue-42400.pqB5Kq.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix buffer overflow in ``_Py_wrealpath()`` for paths exceeding ``MAXPATHLEN`` bytes -by using dynamic memory allocation instead of fixed-size buffer. -Patch by Shamil Abdulaev. diff --git a/Misc/NEWS.d/next/Security/2025-12-01-09-36-45.gh-issue-142145.tcAUhg.rst b/Misc/NEWS.d/next/Security/2025-12-01-09-36-45.gh-issue-142145.tcAUhg.rst deleted file mode 100644 index 440bc7794c69ef..00000000000000 --- a/Misc/NEWS.d/next/Security/2025-12-01-09-36-45.gh-issue-142145.tcAUhg.rst +++ /dev/null @@ -1 +0,0 @@ -Remove quadratic behavior in ``xml.minidom`` node ID cache clearing. diff --git a/Misc/NEWS.d/next/Tests/2025-10-16-15-08-58.gh-issue-140210.P9vUP8.rst b/Misc/NEWS.d/next/Tests/2025-10-16-15-08-58.gh-issue-140210.P9vUP8.rst deleted file mode 100644 index f2064bfd377e69..00000000000000 --- a/Misc/NEWS.d/next/Tests/2025-10-16-15-08-58.gh-issue-140210.P9vUP8.rst +++ /dev/null @@ -1,2 +0,0 @@ -Make ``test_sysconfig.test_parse_makefile_renamed_vars`` less fragile by -clearing the environment variables before parsing the Makefile. diff --git a/Misc/NEWS.d/next/Tests/2025-10-27-15-53-47.gh-issue-140381.N5o3pa.rst b/Misc/NEWS.d/next/Tests/2025-10-27-15-53-47.gh-issue-140381.N5o3pa.rst deleted file mode 100644 index 568a2b65d7d204..00000000000000 --- a/Misc/NEWS.d/next/Tests/2025-10-27-15-53-47.gh-issue-140381.N5o3pa.rst +++ /dev/null @@ -1 +0,0 @@ -Fix flaky test_profiling tests on i686 and s390x architectures by increasing slow_fibonacci call frequency from every 5th iteration to every 2nd iteration. diff --git a/Misc/NEWS.d/next/Tools-Demos/2025-11-18-13-55-47.gh-issue-141692.tud9if.rst b/Misc/NEWS.d/next/Tools-Demos/2025-11-18-13-55-47.gh-issue-141692.tud9if.rst deleted file mode 100644 index d85c54db3646f6..00000000000000 --- a/Misc/NEWS.d/next/Tools-Demos/2025-11-18-13-55-47.gh-issue-141692.tud9if.rst +++ /dev/null @@ -1,3 +0,0 @@ -Each slice of an iOS XCframework now contains a ``lib`` folder that contains -a symlink to the libpython dylib. This allows binary modules to be compiled -for iOS using dynamic libreary linking, rather than Framework linking. diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 3ba48d5d9d3c64..3b14a21fa8428e 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -2231,11 +2231,11 @@ defdict_missing(PyObject *op, PyObject *key) value = _PyObject_CallNoArgs(factory); if (value == NULL) return value; - if (PyObject_SetItem(op, key, value) < 0) { - Py_DECREF(value); - return NULL; - } - return value; + PyObject *result = NULL; + (void)PyDict_SetDefaultRef(op, key, value, &result); + // 'result' is NULL, or a strong reference to 'value' or 'op[key]' + Py_DECREF(value); + return result; } static inline PyObject* diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 0dbfe962684e20..391fa8ea2a94ec 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -240,7 +240,7 @@ dummy_func( op(_MONITOR_RESUME, (--)) { int err = _Py_call_instrumentation( - tstate, oparg > 0, frame, this_instr); + tstate, oparg == 0 ? PY_MONITORING_EVENT_PY_START : PY_MONITORING_EVENT_PY_RESUME, frame, this_instr); ERROR_IF(err); if (frame->instr_ptr != this_instr) { /* Instrumentation has jumped */ diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 2811a2ec8ac82d..94846d718308a5 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -7196,7 +7196,7 @@ { _PyFrame_SetStackPointer(frame, stack_pointer); int err = _Py_call_instrumentation( - tstate, oparg > 0, frame, this_instr); + tstate, oparg == 0 ? PY_MONITORING_EVENT_PY_START : PY_MONITORING_EVENT_PY_RESUME, frame, this_instr); stack_pointer = _PyFrame_GetStackPointer(frame); if (err) { JUMP_TO_LABEL(error); diff --git a/README.rst b/README.rst index bc1c1df2069558..5f451c6876ccfe 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -This is Python version 3.15.0 alpha 2 +This is Python version 3.15.0 alpha 3 ===================================== .. image:: https://github.com/python/cpython/actions/workflows/build.yml/badge.svg?branch=main&event=push