Skip to content

Commit a66ea8e

Browse files
Merge branch 'main' into curses-border-box-zero
2 parents 7b59520 + 5ebd486 commit a66ea8e

183 files changed

Lines changed: 5373 additions & 2252 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Tools/cases_generator/ @markshannon
223223
Python/assemble.c @markshannon @iritkatriel
224224
Python/codegen.c @markshannon @iritkatriel
225225
Python/compile.c @markshannon @iritkatriel
226-
Python/flowgraph.c @markshannon @iritkatriel
226+
Python/flowgraph.c @markshannon @iritkatriel @eclips4
227227
Python/instruction_sequence.c @iritkatriel
228228
Python/symtable.c @JelleZijlstra @carljm
229229

Doc/about.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and now maintained as an independent project.
1010
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
1111
.. _Sphinx: https://www.sphinx-doc.org/
1212

13-
.. In the online version of these documents, you can submit comments and suggest
13+
.. In the online version of this documentation, you can submit comments and suggest
1414
changes directly on the documentation pages.
1515
1616
Development of the documentation and its toolchain is an entirely volunteer

Doc/c-api/import.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Importing Modules
146146
alternatives.
147147
148148
.. versionchanged:: 3.15
149-
``__cached__`` is no longer set.
149+
The ``__cached__`` attribute is no longer set.
150150
151151
152152
.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
@@ -170,7 +170,7 @@ Importing Modules
170170
:class:`~importlib.machinery.ModuleSpec` for alternatives.
171171
172172
.. versionchanged:: 3.15
173-
``__cached__`` no longer set.
173+
The ``__cached__`` attribute no longer set.
174174
175175
176176
.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname)

Doc/library/asyncio-task.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -843,17 +843,13 @@ Timeouts
843843
Wait for the *fut* :ref:`awaitable <asyncio-awaitables>`
844844
to complete with a timeout.
845845

846-
If *fut* is a coroutine it is automatically scheduled as a Task.
847-
848846
*timeout* can either be ``None`` or a float or int number of seconds
849847
to wait for. If *timeout* is ``None``, block until the future
850848
completes.
851849

852-
If a timeout occurs, it cancels the task and raises
853-
:exc:`TimeoutError`.
850+
If a timeout occurs, it cancels *fut* and raises :exc:`TimeoutError`.
854851

855-
To avoid the task :meth:`cancellation <Task.cancel>`,
856-
wrap it in :func:`shield`.
852+
To prevent *fut* from being cancelled, wrap it in :func:`shield`.
857853

858854
The function will wait until the future is actually cancelled,
859855
so the total wait time may exceed the *timeout*. If an exception
@@ -894,6 +890,10 @@ Timeouts
894890
.. versionchanged:: 3.11
895891
Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`.
896892

893+
.. versionchanged:: 3.12
894+
Implemented using :func:`asyncio.timeout`, a coroutine passed as *fut*
895+
is no longer wrapped in a :class:`Task` when *timeout* is positive.
896+
897897

898898
Waiting primitives
899899
==================

Doc/library/curses.panel.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ Panel objects
116116
.. method:: panel.replace(win)
117117

118118
Change the window associated with the panel to the window *win*.
119+
Raise :exc:`curses.panel.error` if *win* has been detached from its
120+
screen by :meth:`screen.close() <curses.screen.close>`.
119121

120122

121123
.. method:: panel.set_userptr(obj)

Doc/library/dataclasses.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ Module contents
262262
c = C()
263263
c.mylist += [1, 2, 3]
264264

265-
As shown above, the :const:`MISSING` value is a sentinel object used to
266-
detect if some parameters are provided by the user. This sentinel is
265+
As shown above, the :const:`MISSING` value is a :class:`sentinel` object
266+
used to detect if some parameters are provided by the user. This sentinel is
267267
used because ``None`` is a valid value for some parameters with
268268
a distinct meaning. No code should directly use the :const:`MISSING` value.
269269

@@ -528,11 +528,14 @@ Module contents
528528

529529
.. data:: MISSING
530530

531-
A sentinel value signifying a missing default or default_factory.
531+
A :class:`sentinel` object signifying a missing default or *default_factory*.
532+
533+
.. versionchanged:: 3.15
534+
:const:`!MISSING` is now a :class:`sentinel` object.
532535

533536
.. data:: KW_ONLY
534537

535-
A sentinel value used as a type annotation. Any fields after a
538+
A :class:`sentinel` object used as a type annotation. Any fields after a
536539
pseudo-field with the type of :const:`!KW_ONLY` are marked as
537540
keyword-only fields. Note that a pseudo-field of type
538541
:const:`!KW_ONLY` is otherwise completely ignored. This includes the
@@ -557,6 +560,9 @@ Module contents
557560

558561
.. versionadded:: 3.10
559562

563+
.. versionchanged:: 3.15
564+
:const:`!KW_ONLY` is now a :class:`sentinel` object.
565+
560566
.. exception:: FrozenInstanceError
561567

562568
Raised when an implicitly defined :meth:`~object.__setattr__` or

Doc/library/json.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ Encoders and Decoders
486486
+----------------------------------------+---------------+
487487
| Python | JSON |
488488
+========================================+===============+
489-
| dict | object |
489+
| dict, frozendict | object |
490490
+----------------------------------------+---------------+
491491
| list, tuple | array |
492492
+----------------------------------------+---------------+
@@ -504,6 +504,9 @@ Encoders and Decoders
504504
.. versionchanged:: 3.4
505505
Added support for int- and float-derived Enum classes.
506506

507+
.. versionchanged:: 3.15
508+
Added support for :class:`frozendict`.
509+
507510
To extend this to recognize other objects, subclass and implement a
508511
:meth:`~JSONEncoder.default` method with another method that returns a serializable object
509512
for ``o`` if possible, otherwise it should call the superclass implementation

Doc/library/runpy.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ The :mod:`!runpy` module provides two functions:
9797
:class:`~importlib.machinery.ModuleSpec` for alternatives.
9898

9999
.. versionchanged:: 3.15
100-
``__cached__`` is no longer set.
100+
The global variable ``__cached__`` is no longer set.
101101

102102
.. function:: run_path(path_name, init_globals=None, run_name=None)
103103

@@ -175,7 +175,7 @@ The :mod:`!runpy` module provides two functions:
175175
``__package__`` are deprecated.
176176

177177
.. versionchanged:: 3.15
178-
``__cached__`` is no longer set.
178+
The global variable ``__cached__`` is no longer set.
179179

180180
.. seealso::
181181

Doc/library/stdtypes.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ A hexadecimal string takes the form::
706706

707707
[sign] ['0x'] integer ['.' fraction] ['p' exponent]
708708

709-
where the optional ``sign`` may by either ``+`` or ``-``, ``integer``
709+
where the optional ``sign`` may be either ``+`` or ``-``, ``integer``
710710
and ``fraction`` are strings of hexadecimal digits, and ``exponent``
711711
is a decimal integer with an optional leading sign. Case is not
712712
significant, and there must be at least one hexadecimal digit in
@@ -1345,7 +1345,7 @@ Mutable sequence types also support the following methods:
13451345
:no-typesetting:
13461346
.. method:: sequence.pop(index=-1, /)
13471347

1348-
Retrieve the item at *index* and also removes it from *sequence*.
1348+
Retrieve the item at *index* and also remove it from *sequence*.
13491349
By default, the last item in *sequence* is removed and returned.
13501350

13511351
.. method:: bytearray.remove(value, /)
@@ -2120,7 +2120,7 @@ expression support in the :mod:`re` module).
21202120
one character, ``False`` otherwise. Alphabetic characters are those characters defined
21212121
in the Unicode character database as "Letter", i.e., those with general category
21222122
property being one of "Lm", "Lt", "Lu", "Ll", or "Lo". Note that this is different
2123-
from the `Alphabetic property defined in the section 4.10 'Letters, Alphabetic, and
2123+
from the `Alphabetic property defined in section 4.10 'Letters, Alphabetic, and
21242124
Ideographic' of the Unicode Standard
21252125
<https://www.unicode.org/versions/Unicode17.0.0/core-spec/chapter-4/#G91002>`__.
21262126
For example:
@@ -3044,7 +3044,7 @@ replacement field. For example::
30443044
'0.333333'
30453045
>>> f'{one_third:_^+10}'
30463046
'___+1/3___'
3047-
>>> >>> f'{one_third!r:_^20}'
3047+
>>> f'{one_third!r:_^20}'
30483048
'___Fraction(1, 3)___'
30493049
>>> f'{one_third = :~>10}~'
30503050
'one_third = ~~~~~~~1/3~'
@@ -3054,12 +3054,12 @@ replacement field. For example::
30543054
Template String Literals (t-strings)
30553055
------------------------------------
30563056

3057-
An :dfn:`t-string` (formally a :dfn:`template string literal`) is
3057+
A :dfn:`t-string` (formally a :dfn:`template string literal`) is
30583058
a string literal that is prefixed with ``t`` or ``T``.
30593059

30603060
These strings follow the same syntax and evaluation rules as
30613061
:ref:`formatted string literals <stdtypes-fstrings>`,
3062-
with for the following differences:
3062+
with the following differences:
30633063

30643064
* Rather than evaluating to a ``str`` object, template string literals evaluate
30653065
to a :class:`string.templatelib.Template` object.
@@ -3086,7 +3086,7 @@ with for the following differences:
30863086
The :class:`!Interpolation` instance for the expression will be created as
30873087
normal, except that :attr:`~string.templatelib.Interpolation.conversion` will
30883088
be set to '``r``' (:func:`repr`) by default.
3089-
If an explicit conversion or format specifier are provided,
3089+
If an explicit conversion or format specifier is provided,
30903090
this will override the default behaviour.
30913091

30923092

@@ -3463,7 +3463,7 @@ objects.
34633463

34643464
.. classmethod:: fromhex(string, /)
34653465

3466-
This :class:`bytearray` class method returns bytearray object, decoding
3466+
This :class:`bytearray` class method returns a bytearray object, decoding
34673467
the given string object. The string must contain two hexadecimal digits
34683468
per byte, with ASCII whitespace being ignored.
34693469

@@ -4427,7 +4427,7 @@ the ``%`` operator (modulo).
44274427
This is also known as the bytes *formatting* or *interpolation* operator.
44284428
Given ``format % values`` (where *format* is a bytes object), ``%`` conversion
44294429
specifications in *format* are replaced with zero or more elements of *values*.
4430-
The effect is similar to using the :c:func:`sprintf` in the C language.
4430+
The effect is similar to using the :c:func:`sprintf` function in the C language.
44314431

44324432
If *format* requires a single argument, *values* may be a single non-tuple
44334433
object. [5]_ Otherwise, *values* must be a tuple with exactly the number of
@@ -4628,7 +4628,7 @@ copying.
46284628
underlying data.
46294629

46304630
``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which
4631-
is the nested list representation of the view. If ``view.ndim = 1``,
4631+
is the nested list representation of the view. If ``view.ndim == 1``,
46324632
this is equal to the number of elements in the view.
46334633

46344634
.. versionchanged:: 3.12
@@ -4713,7 +4713,7 @@ copying.
47134713
:class:`collections.abc.Sequence`
47144714

47154715
.. versionchanged:: 3.5
4716-
memoryviews can now be indexed with tuple of integers.
4716+
memoryviews can now be indexed with a tuple of integers.
47174717

47184718
.. versionchanged:: 3.14
47194719
memoryview is now a :term:`generic type`.
@@ -6182,7 +6182,7 @@ enables cleaner type hinting syntax compared to subscripting :class:`typing.Unio
61826182

61836183
.. note::
61846184

6185-
The ``|`` operand cannot be used at runtime to define unions where one or
6185+
The ``|`` operator cannot be used at runtime to define unions where one or
61866186
more members is a forward reference. For example, ``int | "Foo"``, where
61876187
``"Foo"`` is a reference to a class not yet defined, will fail at
61886188
runtime. For unions which include forward references, present the
@@ -6341,7 +6341,7 @@ Methods
63416341
Methods are functions that are called using the attribute notation.
63426342
There are two flavors: :ref:`built-in methods <builtin-methods>`
63436343
(such as :meth:`~list.append` on lists)
6344-
and :ref:`class instance method <instance-methods>`.
6344+
and :ref:`class instance methods <instance-methods>`.
63456345
Built-in methods are described with the types that support them.
63466346

63476347
If you access a method (a function defined in a class namespace) through an

Doc/library/tarfile.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,10 @@ reused in custom filters:
11121112
paths (in case the name is absolute
11131113
even after stripping slashes, e.g. ``C:/foo`` on Windows).
11141114
This raises :class:`~tarfile.AbsolutePathError`.
1115+
- Normalize filenames (:attr:`TarInfo.name`) that contain ``..`` components
1116+
using :func:`os.path.normpath`.
1117+
Note that this removes internal ``..`` components, which may change the
1118+
meaning of the name if it traverses symbolic links.
11151119
- :ref:`Refuse <tarfile-extraction-refuse>` to extract files whose absolute
11161120
path (after following symlinks) would end up outside the destination.
11171121
This raises :class:`~tarfile.OutsideDestinationError`.
@@ -1120,6 +1124,10 @@ reused in custom filters:
11201124

11211125
Return the modified ``TarInfo`` member.
11221126

1127+
.. versionchanged:: next
1128+
1129+
Filenames containing ``..`` components are now normalized.
1130+
11231131
.. function:: data_filter(member, path)
11241132

11251133
Implements the ``'data'`` filter.

0 commit comments

Comments
 (0)