Skip to content

Commit ec8b314

Browse files
authored
Merge branch 'main' into pyrepl-import-completion-for-attributes
2 parents 6a5877f + 04ace41 commit ec8b314

File tree

132 files changed

+5419
-2257
lines changed

Some content is hidden

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

132 files changed

+5419
-2257
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/library/compression.zstd.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Reading and writing compressed files
7373
argument is not None, a :exc:`!TypeError` will be raised.
7474

7575
When writing, the *options* argument can be a dictionary
76-
providing advanced decompression parameters; see
76+
providing advanced compression parameters; see
7777
:class:`CompressionParameter` for detailed information about supported
7878
parameters. The *level* argument is the compression level to use when
7979
writing compressed data. Only one of *level* or *options* may be non-None.
@@ -117,7 +117,7 @@ Reading and writing compressed files
117117
argument is not None, a :exc:`!TypeError` will be raised.
118118

119119
When writing, the *options* argument can be a dictionary
120-
providing advanced decompression parameters; see
120+
providing advanced compression parameters; see
121121
:class:`CompressionParameter` for detailed information about supported
122122
parameters. The *level* argument is the compression level to use when
123123
writing compressed data. Only one of *level* or *options* may be passed. The

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/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

Doc/library/profiling.sampling.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,9 @@ interesting functions that highlights:
878878

879879
Use :option:`--no-summary` to suppress both the legend and summary sections.
880880

881-
To save pstats output to a file instead of stdout::
881+
To save pstats output to a binary file instead of stdout::
882882

883-
python -m profiling.sampling run -o profile.txt script.py
883+
python -m profiling.sampling run -o profile.pstats script.py
884884

885885
The pstats format supports several options for controlling the display.
886886
The :option:`--sort` option determines the column used for ordering results::
@@ -1455,7 +1455,9 @@ Output options
14551455

14561456
.. option:: --pstats
14571457

1458-
Generate text statistics output. This is the default.
1458+
Generate pstats statistics. This is the default.
1459+
When written to stdout, the output is a text table; with :option:`-o`,
1460+
it is a binary pstats file.
14591461

14601462
.. option:: --collapsed
14611463

@@ -1486,10 +1488,18 @@ Output options
14861488
.. option:: -o <path>, --output <path>
14871489

14881490
Output file or directory path. Default behavior varies by format:
1489-
:option:`--pstats` writes to stdout, while other formats generate a file
1490-
named ``<format>_<PID>.<ext>`` (for example, ``flamegraph_12345.html``).
1491+
:option:`--pstats` prints a text table to stdout, while ``-o`` writes a
1492+
binary pstats file. Other formats generate a file named
1493+
``<format>_<PID>.<ext>`` (for example, ``flamegraph_12345.html``).
14911494
:option:`--heatmap` creates a directory named ``heatmap_<PID>``.
14921495

1496+
.. option:: --browser
1497+
1498+
Automatically open HTML output (:option:`--flamegraph` and
1499+
:option:`--heatmap`) in your default web browser after generation.
1500+
When profiling with :option:`--subprocesses`, only the main process
1501+
opens the browser; subprocess outputs are never auto-opened.
1502+
14931503

14941504
pstats display options
14951505
----------------------

Doc/library/socket.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,10 +1072,16 @@ The :mod:`socket` module also offers various network-related services:
10721072
a string representing the canonical name of the *host* if
10731073
:const:`AI_CANONNAME` is part of the *flags* argument; else *canonname*
10741074
will be empty. *sockaddr* is a tuple describing a socket address, whose
1075-
format depends on the returned *family* (a ``(address, port)`` 2-tuple for
1076-
:const:`AF_INET`, a ``(address, port, flowinfo, scope_id)`` 4-tuple for
1077-
:const:`AF_INET6`), and is meant to be passed to the :meth:`socket.connect`
1078-
method.
1075+
format depends on the returned *family* and flags Python was compiled with,
1076+
and is meant to be passed to the :meth:`socket.connect` method.
1077+
1078+
*sockaddr* can be one of the following:
1079+
1080+
* a ``(address, port)`` 2-tuple for :const:`AF_INET`
1081+
* a ``(address, port, flowinfo, scope_id)`` 4-tuple for :const:`AF_INET6` if
1082+
Python was compiled with ``--enable-ipv6`` (the default)
1083+
* a 2-tuple containing raw data for :const:`AF_INET6` if Python was
1084+
compiled with ``--disable-ipv6``
10791085

10801086
.. note::
10811087

Doc/library/textwrap.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ functions should be good enough; otherwise, you should use an instance of
102102
print(repr(s)) # prints ' hello\n world\n '
103103
print(repr(dedent(s))) # prints 'hello\n world\n'
104104

105+
.. versionchanged:: 3.14
106+
The :func:`!dedent` function now correctly normalizes blank lines containing
107+
only whitespace characters. Previously, the implementation only normalized
108+
blank lines containing tabs and spaces.
105109

106110
.. function:: indent(text, prefix, predicate=None)
107111

Doc/reference/import.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,9 +832,7 @@ entirely with a custom meta path hook.
832832

833833
If it is acceptable to only alter the behaviour of import statements
834834
without affecting other APIs that access the import system, then replacing
835-
the builtin :func:`__import__` function may be sufficient. This technique
836-
may also be employed at the module level to only alter the behaviour of
837-
import statements within that module.
835+
the builtin :func:`__import__` function may be sufficient.
838836

839837
To selectively prevent the import of some modules from a hook early on the
840838
meta path (rather than disabling the standard import system entirely),

Doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# won't suddenly cause build failures. Updating the version is fine as long
88
# as no warnings are raised by doing so.
99
# Keep this version in sync with ``Doc/conf.py``.
10-
sphinx~=9.0.0
10+
sphinx<9.0.0
1111

1212
blurb
1313

0 commit comments

Comments
 (0)