Skip to content

Commit d6ff1d0

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix/hacl/dynamic-linker-131298
2 parents a5d39fa + 45c447b commit d6ff1d0

File tree

88 files changed

+1230
-546
lines changed

Some content is hidden

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

88 files changed

+1230
-546
lines changed

Doc/c-api/gcsupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ the garbage collector.
277277
278278
Type of the visitor function to be passed to :c:func:`PyUnstable_GC_VisitObjects`.
279279
*arg* is the same as the *arg* passed to ``PyUnstable_GC_VisitObjects``.
280-
Return ``0`` to continue iteration, return ``1`` to stop iteration. Other return
280+
Return ``1`` to continue iteration, return ``0`` to stop iteration. Other return
281281
values are reserved for now so behavior on returning anything else is undefined.
282282
283283
.. versionadded:: 3.12

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
611611
Note that the :c:member:`~PyVarObject.ob_size` field may later be used for
612612
other purposes. For example, :py:type:`int` instances use the bits of
613613
:c:member:`~PyVarObject.ob_size` in an implementation-defined
614-
way; the underlying storage and its size should be acessed using
614+
way; the underlying storage and its size should be accessed using
615615
:c:func:`PyLong_Export`.
616616

617617
.. note::

Doc/c-api/unicode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ APIs:
622622
623623
On error, set *\*p_left* to ``NULL`` and set an exception.
624624
625-
On sucess, set *\*p_left* to a new strong reference to the result.
625+
On success, set *\*p_left* to a new strong reference to the result.
626626
627627
628628
.. c:function:: void PyUnicode_AppendAndDel(PyObject **p_left, PyObject *right)

Doc/howto/logging-cookbook.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,19 @@ which, when run, will produce:
626626
of each message with the handler's level, and only passes a message to a
627627
handler if it's appropriate to do so.
628628

629+
.. versionchanged:: next
630+
The :class:`QueueListener` can be started (and stopped) via the
631+
:keyword:`with` statement. For example:
632+
633+
.. code-block:: python
634+
635+
with QueueListener(que, handler) as listener:
636+
# The queue listener automatically starts
637+
# when the 'with' block is entered.
638+
pass
639+
# The queue listener automatically stops once
640+
# the 'with' block is exited.
641+
629642
.. _network-logging:
630643

631644
Sending and receiving logging events across a network

Doc/library/annotationlib.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,22 @@ Functions
317317
Compute the annotations dict for an object.
318318

319319
*obj* may be a callable, class, module, or other object with
320-
:attr:`~object.__annotate__` and :attr:`~object.__annotations__` attributes.
321-
Passing in an object of any other type raises :exc:`TypeError`.
320+
:attr:`~object.__annotate__` or :attr:`~object.__annotations__` attributes.
321+
Passing any other object raises :exc:`TypeError`.
322322

323323
The *format* parameter controls the format in which annotations are returned,
324324
and must be a member of the :class:`Format` enum or its integer equivalent.
325+
The different formats work as follows:
326+
327+
* VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist,
328+
the :attr:`!object.__annotate__` function is called if it exists.
329+
* FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated successfully,
330+
it is used; otherwise, the :attr:`!object.__annotate__` function is called. If it
331+
does not exist either, :attr:`!object.__annotations__` is tried again and any error
332+
from accessing it is re-raised.
333+
* STRING: If :attr:`!object.__annotate__` exists, it is called first;
334+
otherwise, :attr:`!object.__annotations__` is used and stringified
335+
using :func:`annotations_to_string`.
325336

326337
Returns a dict. :func:`!get_annotations` returns a new dict every time
327338
it's called; calling it twice on the same object will return two

Doc/library/asyncio-eventloop.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,8 @@ Allows customizing how exceptions are handled in the event loop.
14401440
* 'protocol' (optional): :ref:`Protocol <asyncio-protocol>` instance;
14411441
* 'transport' (optional): :ref:`Transport <asyncio-transport>` instance;
14421442
* 'socket' (optional): :class:`socket.socket` instance;
1443+
* 'source_traceback' (optional): Traceback of the source;
1444+
* 'handle_traceback' (optional): Traceback of the handle;
14431445
* 'asyncgen' (optional): Asynchronous generator that caused
14441446
the exception.
14451447

Doc/library/asyncio-future.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ Future Functions
5151

5252
.. important::
5353

54-
See also the :func:`create_task` function which is the
55-
preferred way for creating new Tasks.
56-
5754
Save a reference to the result of this function, to avoid
5855
a task disappearing mid-execution.
5956

57+
See also the :func:`create_task` function which is the
58+
preferred way for creating new tasks or use :class:`asyncio.TaskGroup`
59+
which keeps reference to the task internally.
60+
6061
.. versionchanged:: 3.5.1
6162
The function accepts any :term:`awaitable` object.
6263

Doc/library/asyncio-task.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,10 @@ Task Object
13811381

13821382
Request the Task to be cancelled.
13831383

1384-
This arranges for a :exc:`CancelledError` exception to be thrown
1384+
If the Task is already *done* or *cancelled*, return ``False``,
1385+
otherwise, return ``True``.
1386+
1387+
The method arranges for a :exc:`CancelledError` exception to be thrown
13851388
into the wrapped coroutine on the next cycle of the event loop.
13861389

13871390
The coroutine then has a chance to clean up or even deny the

Doc/library/audit_events.rst

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,30 @@ information on handling these events.
2323
The following events are raised internally and do not correspond to any
2424
public API of CPython:
2525

26-
+--------------------------+-------------------------------------------+
27-
| Audit event | Arguments |
28-
+==========================+===========================================+
29-
| _winapi.CreateFile | ``file_name``, ``desired_access``, |
30-
| | ``share_mode``, ``creation_disposition``, |
31-
| | ``flags_and_attributes`` |
32-
+--------------------------+-------------------------------------------+
33-
| _winapi.CreateJunction | ``src_path``, ``dst_path`` |
34-
+--------------------------+-------------------------------------------+
35-
| _winapi.CreateNamedPipe | ``name``, ``open_mode``, ``pipe_mode`` |
36-
+--------------------------+-------------------------------------------+
37-
| _winapi.CreatePipe | |
38-
+--------------------------+-------------------------------------------+
39-
| _winapi.CreateProcess | ``application_name``, ``command_line``, |
40-
| | ``current_directory`` |
41-
+--------------------------+-------------------------------------------+
42-
| _winapi.OpenProcess | ``process_id``, ``desired_access`` |
43-
+--------------------------+-------------------------------------------+
44-
| _winapi.TerminateProcess | ``handle``, ``exit_code`` |
45-
+--------------------------+-------------------------------------------+
46-
| ctypes.PyObj_FromPtr | ``obj`` |
47-
+--------------------------+-------------------------------------------+
26+
+----------------------------+-------------------------------------------+
27+
| Audit event | Arguments |
28+
+============================+===========================================+
29+
| _winapi.CreateFile | ``file_name``, ``desired_access``, |
30+
| | ``share_mode``, ``creation_disposition``, |
31+
| | ``flags_and_attributes`` |
32+
+----------------------------+-------------------------------------------+
33+
| _winapi.CreateJunction | ``src_path``, ``dst_path`` |
34+
+----------------------------+-------------------------------------------+
35+
| _winapi.CreateNamedPipe | ``name``, ``open_mode``, ``pipe_mode`` |
36+
+----------------------------+-------------------------------------------+
37+
| _winapi.CreatePipe | |
38+
+----------------------------+-------------------------------------------+
39+
| _winapi.CreateProcess | ``application_name``, ``command_line``, |
40+
| | ``current_directory`` |
41+
+----------------------------+-------------------------------------------+
42+
| _winapi.OpenProcess | ``process_id``, ``desired_access`` |
43+
+----------------------------+-------------------------------------------+
44+
| _winapi.TerminateProcess | ``handle``, ``exit_code`` |
45+
+----------------------------+-------------------------------------------+
46+
| _posixsubprocess.fork_exec | ``exec_list``, ``args``, ``env`` |
47+
+----------------------------+-------------------------------------------+
48+
| ctypes.PyObj_FromPtr | ``obj`` |
49+
+----------------------------+-------------------------------------------+
50+
51+
.. versionadded:: next
52+
The ``_posixsubprocess.fork_exec`` internal audit event.

Doc/library/codecs.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ particular, the following variants typically exist:
11071107
+-----------------+--------------------------------+--------------------------------+
11081108
| cp852 | 852, IBM852 | Central and Eastern Europe |
11091109
+-----------------+--------------------------------+--------------------------------+
1110-
| cp855 | 855, IBM855 | Bulgarian, Byelorussian, |
1110+
| cp855 | 855, IBM855 | Belarusian, Bulgarian, |
11111111
| | | Macedonian, Russian, Serbian |
11121112
+-----------------+--------------------------------+--------------------------------+
11131113
| cp856 | | Hebrew |
@@ -1155,7 +1155,7 @@ particular, the following variants typically exist:
11551155
+-----------------+--------------------------------+--------------------------------+
11561156
| cp1250 | windows-1250 | Central and Eastern Europe |
11571157
+-----------------+--------------------------------+--------------------------------+
1158-
| cp1251 | windows-1251 | Bulgarian, Byelorussian, |
1158+
| cp1251 | windows-1251 | Belarusian, Bulgarian, |
11591159
| | | Macedonian, Russian, Serbian |
11601160
+-----------------+--------------------------------+--------------------------------+
11611161
| cp1252 | windows-1252 | Western Europe |
@@ -1220,7 +1220,7 @@ particular, the following variants typically exist:
12201220
+-----------------+--------------------------------+--------------------------------+
12211221
| iso8859_4 | iso-8859-4, latin4, L4 | Baltic languages |
12221222
+-----------------+--------------------------------+--------------------------------+
1223-
| iso8859_5 | iso-8859-5, cyrillic | Bulgarian, Byelorussian, |
1223+
| iso8859_5 | iso-8859-5, cyrillic | Belarusian, Bulgarian, |
12241224
| | | Macedonian, Russian, Serbian |
12251225
+-----------------+--------------------------------+--------------------------------+
12261226
| iso8859_6 | iso-8859-6, arabic | Arabic |
@@ -1257,7 +1257,7 @@ particular, the following variants typically exist:
12571257
| | | |
12581258
| | | .. versionadded:: 3.5 |
12591259
+-----------------+--------------------------------+--------------------------------+
1260-
| mac_cyrillic | maccyrillic | Bulgarian, Byelorussian, |
1260+
| mac_cyrillic | maccyrillic | Belarusian, Bulgarian, |
12611261
| | | Macedonian, Russian, Serbian |
12621262
+-----------------+--------------------------------+--------------------------------+
12631263
| mac_greek | macgreek | Greek |

0 commit comments

Comments
 (0)