Skip to content

Commit 93ebd2f

Browse files
authored
Merge branch 'main' into fix-142461
2 parents ebb08da + 9609574 commit 93ebd2f

File tree

214 files changed

+6945
-2951
lines changed

Some content is hidden

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

214 files changed

+6945
-2951
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ jobs:
2222
- uses: actions/checkout@v4
2323
with:
2424
persist-credentials: false
25-
- uses: actions/setup-python@v5
26-
with:
27-
python-version: "3.x"
28-
- uses: pre-commit/action@v3.0.1
25+
- uses: j178/prek-action@v1

.github/zizmor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Configuration for the zizmor static analysis tool, run via pre-commit in CI
1+
# Configuration for the zizmor static analysis tool, run via prek in CI
22
# https://woodruffw.github.io/zizmor/configuration/
33
rules:
44
dangerous-triggers:

Doc/c-api/module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ A module's token -- and the *your_token* value to use in the above code -- is:
571571
of that slot;
572572
- For modules created from an ``PyModExport_*``
573573
:ref:`export hook <extension-export-hook>`: the slots array that the export
574-
hook returned (unless overriden with :c:macro:`Py_mod_token`).
574+
hook returned (unless overridden with :c:macro:`Py_mod_token`).
575575
576576
.. c:macro:: Py_mod_token
577577

Doc/library/base64.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,20 @@ Refer to the documentation of the individual functions for more information.
267267
.. versionadded:: 3.4
268268

269269

270-
.. function:: z85encode(s)
270+
.. function:: z85encode(s, pad=False)
271271

272272
Encode the :term:`bytes-like object` *s* using Z85 (as used in ZeroMQ)
273273
and return the encoded :class:`bytes`. See `Z85 specification
274274
<https://rfc.zeromq.org/spec/32/>`_ for more information.
275275

276+
If *pad* is true, the input is padded with ``b'\0'`` so its length is a
277+
multiple of 4 bytes before encoding.
278+
276279
.. versionadded:: 3.13
277280

281+
.. versionchanged:: next
282+
The *pad* parameter was added.
283+
278284

279285
.. function:: z85decode(s)
280286

Doc/library/concurrent.futures.rst

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ the bytes over a shared :mod:`socket <socket>` or
308308

309309
.. note::
310310
The executor may replace uncaught exceptions from *initializer*
311-
with :class:`~concurrent.futures.interpreter.ExecutionFailed`.
311+
with :class:`~concurrent.interpreters.ExecutionFailed`.
312312

313313
Other caveats from parent :class:`ThreadPoolExecutor` apply here.
314314

@@ -320,11 +320,11 @@ likewise serializes the return value when sending it back.
320320
When a worker's current task raises an uncaught exception, the worker
321321
always tries to preserve the exception as-is. If that is successful
322322
then it also sets the ``__cause__`` to a corresponding
323-
:class:`~concurrent.futures.interpreter.ExecutionFailed`
323+
:class:`~concurrent.interpreters.ExecutionFailed`
324324
instance, which contains a summary of the original exception.
325325
In the uncommon case that the worker is not able to preserve the
326326
original as-is then it directly preserves the corresponding
327-
:class:`~concurrent.futures.interpreter.ExecutionFailed`
327+
:class:`~concurrent.interpreters.ExecutionFailed`
328328
instance instead.
329329

330330

@@ -379,6 +379,11 @@ in a REPL or a lambda should not be expected to work.
379379
default in absence of a *mp_context* parameter. This feature is incompatible
380380
with the "fork" start method.
381381

382+
.. note::
383+
Bugs have been reported when using the *max_tasks_per_child* feature that
384+
can result in the :class:`ProcessPoolExecutor` hanging in some
385+
circumstances. Follow its eventual resolution in :gh:`115634`.
386+
382387
.. versionchanged:: 3.3
383388
When one of the worker processes terminates abruptly, a
384389
:exc:`~concurrent.futures.process.BrokenProcessPool` error is now raised.
@@ -715,15 +720,6 @@ Exception classes
715720

716721
.. versionadded:: 3.14
717722

718-
.. exception:: ExecutionFailed
719-
720-
Raised from :class:`~concurrent.futures.InterpreterPoolExecutor` when
721-
the given initializer fails or from
722-
:meth:`~concurrent.futures.Executor.submit` when there's an uncaught
723-
exception from the submitted task.
724-
725-
.. versionadded:: 3.14
726-
727723
.. currentmodule:: concurrent.futures.process
728724

729725
.. exception:: BrokenProcessPool

Doc/library/inspect.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
273273
+-----------------+-------------------+---------------------------+
274274
| | ag_running | is the generator running? |
275275
+-----------------+-------------------+---------------------------+
276+
| | ag_suspended | is the generator |
277+
| | | suspended? |
278+
+-----------------+-------------------+---------------------------+
276279
| | ag_code | code |
277280
+-----------------+-------------------+---------------------------+
278281
| coroutine | __name__ | name |
@@ -286,6 +289,9 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
286289
+-----------------+-------------------+---------------------------+
287290
| | cr_running | is the coroutine running? |
288291
+-----------------+-------------------+---------------------------+
292+
| | cr_suspended | is the coroutine |
293+
| | | suspended? |
294+
+-----------------+-------------------+---------------------------+
289295
| | cr_code | code |
290296
+-----------------+-------------------+---------------------------+
291297
| | cr_origin | where coroutine was |
@@ -319,6 +325,18 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
319325

320326
Add ``__builtins__`` attribute to functions.
321327

328+
.. versionchanged:: 3.11
329+
330+
Add ``gi_suspended`` attribute to generators.
331+
332+
.. versionchanged:: 3.11
333+
334+
Add ``cr_suspended`` attribute to coroutines.
335+
336+
.. versionchanged:: 3.12
337+
338+
Add ``ag_suspended`` attribute to async generators.
339+
322340
.. versionchanged:: 3.14
323341

324342
Add ``f_generator`` attribute to frames.

Doc/library/linecache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The :mod:`linecache` module defines the following functions:
3131
.. index:: triple: module; search; path
3232

3333
If *filename* indicates a frozen module (starting with ``'<frozen '``), the function
34-
will attepmt to get the real file name from ``module_globals['__file__']`` if
34+
will attempt to get the real file name from ``module_globals['__file__']`` if
3535
*module_globals* is not ``None``.
3636

3737
If a file named *filename* is not found, the function first checks

Doc/library/logging.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,11 @@ the options available to you.
10111011
| exc_info | You shouldn't need to | Exception tuple (à la ``sys.exc_info``) or, |
10121012
| | format this yourself. | if no exception has occurred, ``None``. |
10131013
+----------------+-------------------------+-----------------------------------------------+
1014+
| exc_text | You shouldn't need to | Exception information formatted as a string. |
1015+
| | format this yourself. | This is set when :meth:`Formatter.format` is |
1016+
| | | invoked, or ``None`` if no exception has |
1017+
| | | occurred. |
1018+
+----------------+-------------------------+-----------------------------------------------+
10141019
| filename | ``%(filename)s`` | Filename portion of ``pathname``. |
10151020
+----------------+-------------------------+-----------------------------------------------+
10161021
| funcName | ``%(funcName)s`` | Name of function containing the logging call. |

Doc/library/mmap.rst

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
212212
Writable :term:`bytes-like object` is now accepted.
213213

214214

215-
.. method:: flush([offset[, size]])
215+
.. method:: flush([offset[, size]], *, flags=MS_SYNC)
216216

217217
Flushes changes made to the in-memory copy of a file back to disk. Without
218218
use of this call there is no guarantee that changes are written back before
@@ -221,6 +221,12 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
221221
whole extent of the mapping is flushed. *offset* must be a multiple of the
222222
:const:`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`.
223223

224+
The *flags* parameter specifies the synchronization behavior.
225+
*flags* must be one of the :ref:`MS_* constants <ms-constants>` available
226+
on the system.
227+
228+
On Windows, the *flags* parameter is ignored.
229+
224230
``None`` is returned to indicate success. An exception is raised when the
225231
call failed.
226232

@@ -235,6 +241,9 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
235241
specified alone, and the flush operation will extend from *offset*
236242
to the end of the mmap.
237243

244+
.. versionchanged:: next
245+
Added *flags* parameter to control synchronization behavior.
246+
238247

239248
.. method:: madvise(option[, start[, length]])
240249

@@ -461,3 +470,22 @@ MAP_* Constants
461470
:data:`MAP_TPRO`, :data:`MAP_TRANSLATED_ALLOW_EXECUTE`, and
462471
:data:`MAP_UNIX03` constants.
463472

473+
.. _ms-constants:
474+
475+
MS_* Constants
476+
++++++++++++++
477+
478+
.. data:: MS_SYNC
479+
MS_ASYNC
480+
MS_INVALIDATE
481+
482+
These flags control the synchronization behavior for :meth:`mmap.flush`:
483+
484+
* :data:`MS_SYNC` - Synchronous flush: writes are scheduled and the call
485+
blocks until they are physically written to storage.
486+
* :data:`MS_ASYNC` - Asynchronous flush: writes are scheduled but the call
487+
returns immediately without waiting for completion.
488+
* :data:`MS_INVALIDATE` - Invalidate cached data: invalidates other mappings
489+
of the same file so they can see the changes.
490+
491+
.. versionadded:: next

Doc/library/multiprocessing.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,11 +1693,14 @@ inherited by child processes.
16931693
value is actually a synchronized wrapper for the array.
16941694

16951695
*typecode_or_type* determines the type of the elements of the returned array:
1696-
it is either a ctypes type or a one character typecode of the kind used by
1697-
the :mod:`array` module. If *size_or_initializer* is an integer, then it
1698-
determines the length of the array, and the array will be initially zeroed.
1699-
Otherwise, *size_or_initializer* is a sequence which is used to initialize
1700-
the array and whose length determines the length of the array.
1696+
it is either a :ref:`ctypes type <ctypes-fundamental-data-types>` or a one
1697+
character typecode of the kind used by the :mod:`array` module with the
1698+
exception of ``'w'``, which is not supported. In addition, the ``'c'``
1699+
typecode is an alias for :class:`ctypes.c_char`. If *size_or_initializer*
1700+
is an integer, then it determines the length of the array, and the array
1701+
will be initially zeroed. Otherwise, *size_or_initializer* is a sequence
1702+
which is used to initialize the array and whose length determines the length
1703+
of the array.
17011704

17021705
If *lock* is ``True`` (the default) then a new lock object is created to
17031706
synchronize access to the value. If *lock* is a :class:`Lock` or

0 commit comments

Comments
 (0)