Skip to content

Commit 2cc0acb

Browse files
Deploy preview for PR 1231 🛫
1 parent 5aba6b0 commit 2cc0acb

586 files changed

Lines changed: 659 additions & 624 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.

pr-preview/pr-1231/_sources/library/asyncio-task.rst.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -853,17 +853,13 @@ Timeouts
853853
Wait for the *aw* :ref:`awaitable <asyncio-awaitables>`
854854
to complete with a timeout.
855855

856-
If *aw* is a coroutine it is automatically scheduled as a Task.
857-
858856
*timeout* can either be ``None`` or a float or int number of seconds
859857
to wait for. If *timeout* is ``None``, block until the future
860858
completes.
861859

862-
If a timeout occurs, it cancels the task and raises
863-
:exc:`TimeoutError`.
860+
If a timeout occurs, it cancels *aw* and raises :exc:`TimeoutError`.
864861

865-
To avoid the task :meth:`cancellation <Task.cancel>`,
866-
wrap it in :func:`shield`.
862+
To prevent *aw* from being cancelled, wrap it in :func:`shield`.
867863

868864
The function will wait until the future is actually cancelled,
869865
so the total wait time may exceed the *timeout*. If an exception
@@ -904,6 +900,10 @@ Timeouts
904900
.. versionchanged:: 3.11
905901
Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`.
906902

903+
.. versionchanged:: 3.12
904+
Implemented using :func:`asyncio.timeout`, a coroutine passed as *aw*
905+
is no longer wrapped in a :class:`Task` when *timeout* is positive.
906+
907907

908908
Waiting primitives
909909
==================

pr-preview/pr-1231/_sources/library/stdtypes.rst.txt

Lines changed: 14 additions & 14 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/Unicode16.0.0/core-spec/chapter-4/#G91002>`_.
21262126
For example:
@@ -3032,7 +3032,7 @@ replacement field. For example::
30323032
'0.333333'
30333033
>>> f'{one_third:_^+10}'
30343034
'___+1/3___'
3035-
>>> >>> f'{one_third!r:_^20}'
3035+
>>> f'{one_third!r:_^20}'
30363036
'___Fraction(1, 3)___'
30373037
>>> f'{one_third = :~>10}~'
30383038
'one_third = ~~~~~~~1/3~'
@@ -3042,12 +3042,12 @@ replacement field. For example::
30423042
Template String Literals (t-strings)
30433043
------------------------------------
30443044

3045-
An :dfn:`t-string` (formally a :dfn:`template string literal`) is
3045+
A :dfn:`t-string` (formally a :dfn:`template string literal`) is
30463046
a string literal that is prefixed with ``t`` or ``T``.
30473047

30483048
These strings follow the same syntax and evaluation rules as
30493049
:ref:`formatted string literals <stdtypes-fstrings>`,
3050-
with for the following differences:
3050+
with the following differences:
30513051

30523052
* Rather than evaluating to a ``str`` object, template string literals evaluate
30533053
to a :class:`string.templatelib.Template` object.
@@ -3074,7 +3074,7 @@ with for the following differences:
30743074
The :class:`!Interpolation` instance for the expression will be created as
30753075
normal, except that :attr:`~string.templatelib.Interpolation.conversion` will
30763076
be set to '``r``' (:func:`repr`) by default.
3077-
If an explicit conversion or format specifier are provided,
3077+
If an explicit conversion or format specifier is provided,
30783078
this will override the default behaviour.
30793079

30803080

@@ -3451,7 +3451,7 @@ objects.
34513451

34523452
.. classmethod:: fromhex(string, /)
34533453

3454-
This :class:`bytearray` class method returns bytearray object, decoding
3454+
This :class:`bytearray` class method returns a bytearray object, decoding
34553455
the given string object. The string must contain two hexadecimal digits
34563456
per byte, with ASCII whitespace being ignored.
34573457

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

43924392
If *format* requires a single argument, *values* may be a single non-tuple
43934393
object. [5]_ Otherwise, *values* must be a tuple with exactly the number of
@@ -4587,8 +4587,8 @@ copying.
45874587
:class:`!memoryview`\s are :ref:`generic <generics>` over the type of their
45884588
underlying data.
45894589

4590-
``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which
4591-
is the nested list representation of the view. If ``view.ndim = 1``,
4590+
``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which
4591+
is the nested list representation of the view. If ``view.ndim == 1``,
45924592
this is equal to the number of elements in the view.
45934593

45944594
.. versionchanged:: 3.12
@@ -4673,7 +4673,7 @@ copying.
46734673
:class:`collections.abc.Sequence`
46744674

46754675
.. versionchanged:: 3.5
4676-
memoryviews can now be indexed with tuple of integers.
4676+
memoryviews can now be indexed with a tuple of integers.
46774677

46784678
.. versionchanged:: 3.14
46794679
memoryview is now a :term:`generic type`.
@@ -6073,7 +6073,7 @@ enables cleaner type hinting syntax compared to subscripting :class:`typing.Unio
60736073

60746074
.. note::
60756075

6076-
The ``|`` operand cannot be used at runtime to define unions where one or
6076+
The ``|`` operator cannot be used at runtime to define unions where one or
60776077
more members is a forward reference. For example, ``int | "Foo"``, where
60786078
``"Foo"`` is a reference to a class not yet defined, will fail at
60796079
runtime. For unions which include forward references, present the
@@ -6232,7 +6232,7 @@ Methods
62326232
Methods are functions that are called using the attribute notation.
62336233
There are two flavors: :ref:`built-in methods <builtin-methods>`
62346234
(such as :meth:`~list.append` on lists)
6235-
and :ref:`class instance method <instance-methods>`.
6235+
and :ref:`class instance methods <instance-methods>`.
62366236
Built-in methods are described with the types that support them.
62376237

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

pr-preview/pr-1231/_sources/library/tarfile.rst.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,10 @@ reused in custom filters:
11001100
paths (in case the name is absolute
11011101
even after stripping slashes, e.g. ``C:/foo`` on Windows).
11021102
This raises :class:`~tarfile.AbsolutePathError`.
1103+
- Normalize filenames (:attr:`TarInfo.name`) that contain ``..`` components
1104+
using :func:`os.path.normpath`.
1105+
Note that this removes internal ``..`` components, which may change the
1106+
meaning of the name if it traverses symbolic links.
11031107
- :ref:`Refuse <tarfile-extraction-refuse>` to extract files whose absolute
11041108
path (after following symlinks) would end up outside the destination.
11051109
This raises :class:`~tarfile.OutsideDestinationError`.
@@ -1108,6 +1112,10 @@ reused in custom filters:
11081112

11091113
Return the modified ``TarInfo`` member.
11101114

1115+
.. versionchanged:: next
1116+
1117+
Filenames containing ``..`` components are now normalized.
1118+
11111119
.. function:: data_filter(member, path)
11121120

11131121
Implements the ``'data'`` filter.

pr-preview/pr-1231/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ <h3>導航</h3>
356356
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
357357
<br>
358358
<br>
359-
最後更新於 8月 19, 2026 (00:15 UTC)。
359+
最後更新於 8月 20, 2026 (00:16 UTC)。
360360

361361
<a href="/bugs.html">發現 bug</a>
362362

pr-preview/pr-1231/bugs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ <h2>說明文件的錯誤<a class="headerlink" href="#documentation-bugs" title=
250250
</section>
251251
<section id="getting-started-contributing-to-python-yourself">
252252
<span id="contributing-to-python"></span><h2>開始讓自己貢獻 Python<a class="headerlink" href="#getting-started-contributing-to-python-yourself" title="連結到這個標頭"></a></h2>
253-
<p>除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。你可以在 <a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<a class="reference external" href="https://devguide.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
253+
<p>除了只是回報你所發現的錯誤之外,同樣也歡迎你提交修正它們的修補程式 (patch)。你可以在 <a class="reference external" href="https://devguide.python.org/">Python 開發者指南</a>中找到如何開始修補 Python 的更多資訊。如果你有任何問題,<a class="reference external" href="https://mail.python.org/mailman3/lists/core-mentorship.python.org/">核心導師郵寄清單</a>是一個友善的地方,你可以在那裡得到,關於 Python 修正錯誤的過程中,所有問題的答案。</p>
254254
</section>
255255
</section>
256256

@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 8月 19, 2026 (00:15 UTC)。
396+
最後更新於 8月 20, 2026 (00:16 UTC)。
397397

398398
<a href="/bugs.html">發現 bug</a>
399399

pr-preview/pr-1231/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>導航</h3>
365365
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
366366
<br>
367367
<br>
368-
最後更新於 8月 19, 2026 (00:15 UTC)。
368+
最後更新於 8月 20, 2026 (00:16 UTC)。
369369

370370
<a href="/bugs.html">發現 bug</a>
371371

pr-preview/pr-1231/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ <h3>導航</h3>
577577
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
578578
<br>
579579
<br>
580-
最後更新於 8月 19, 2026 (00:15 UTC)。
580+
最後更新於 8月 20, 2026 (00:16 UTC)。
581581

582582
<a href="/bugs.html">發現 bug</a>
583583

pr-preview/pr-1231/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>導航</h3>
514514
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
515515
<br>
516516
<br>
517-
最後更新於 8月 19, 2026 (00:15 UTC)。
517+
最後更新於 8月 20, 2026 (00:16 UTC)。
518518

519519
<a href="/bugs.html">發現 bug</a>
520520

pr-preview/pr-1231/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ <h3>導航</h3>
10011001
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
10021002
<br>
10031003
<br>
1004-
最後更新於 8月 19, 2026 (00:15 UTC)。
1004+
最後更新於 8月 20, 2026 (00:16 UTC)。
10051005

10061006
<a href="/bugs.html">發現 bug</a>
10071007

pr-preview/pr-1231/c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>導航</h3>
376376
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
377377
<br>
378378
<br>
379-
最後更新於 8月 19, 2026 (00:15 UTC)。
379+
最後更新於 8月 20, 2026 (00:16 UTC)。
380380

381381
<a href="/bugs.html">發現 bug</a>
382382

0 commit comments

Comments
 (0)