[New-bugs-announce] [issue46790] Normalize handling of negative timeouts in subprocess.py

Jeremy Kloth report at bugs.python.org
Fri Feb 18 12:26:30 EST 2022


New submission from Jeremy Kloth <jeremy.kloth+python-tracker at gmail.com>:

As a follow on to bpo-46716, the various timeout parameters currently deal with negative values differently in POSIX and Windows.

On POSIX, a negative value is treated the same as 0; check completion and raise TimeoutExpired is still running.

On Windows, the negative value is treated as unsigned and ultimately waits for ~49 days.

While the Windows behavior is obviously wrong and will be fixed internally as part of bpo-46716, that still leaves what to do with timeouts coming from user-space.  The current documentation just states that after `timeout` seconds TimeoutExpired is raised.  A liberal reading of the documentation could lead one to believe any value <=0 would suffice for an "active" check (the POSIX behavior).

OR, the documentation could be amended and negative values are now invalid and apply range checking in the user-facing functions.

----------
components: Library (Lib)
messages: 413496
nosy: jkloth
priority: normal
severity: normal
status: open
title: Normalize handling of negative timeouts in subprocess.py
versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46790>
_______________________________________


More information about the New-bugs-announce mailing list