mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-133089: Use original timeout value for TimeoutExpired
when the func subprocess.run
is called with a timeout (GH-133103)
Signed-off-by: Manjusaka <me@manjusaka.me> Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
parent
51d2459e4d
commit
2bbcaedb75
4 changed files with 46 additions and 4 deletions
|
@ -1525,6 +1525,24 @@ handling consistency are valid for these functions.
|
|||
Notes
|
||||
-----
|
||||
|
||||
.. _subprocess-timeout-behavior:
|
||||
|
||||
Timeout Behavior
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
When using the ``timeout`` parameter in functions like :func:`run`,
|
||||
:meth:`Popen.wait`, or :meth:`Popen.communicate`,
|
||||
users should be aware of the following behaviors:
|
||||
|
||||
1. **Process Creation Delay**: The initial process creation itself cannot be interrupted
|
||||
on many platform APIs. This means that even when specifying a timeout, you are not
|
||||
guaranteed to see a timeout exception until at least after however long process
|
||||
creation takes.
|
||||
|
||||
2. **Extremely Small Timeout Values**: Setting very small timeout values (such as a few
|
||||
milliseconds) may result in almost immediate :exc:`TimeoutExpired` exceptions because
|
||||
process creation and system scheduling inherently require time.
|
||||
|
||||
.. _converting-argument-sequence:
|
||||
|
||||
Converting an argument sequence to a string on Windows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue