From 1bb142941248369c38be6ab2df5dda213be20b11 Mon Sep 17 00:00:00 2001 From: n-l-i <57808975+n-l-i@users.noreply.github.com> Date: Mon, 30 Dec 2024 11:06:51 +0100 Subject: [PATCH 1/3] Specify timeout unit in subprocess docstrings --- Lib/subprocess.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 88f0230b05fbc7..82652a3deb6f8d 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -386,7 +386,8 @@ def _text_encoding(): def call(*popenargs, timeout=None, **kwargs): """Run command with arguments. Wait for command to complete or - timeout, then return the returncode attribute. + for timeout, specified in seconds, to expire. Then return the + returncode attribute. The arguments are the same as for the Popen constructor. Example: @@ -523,8 +524,8 @@ def run(*popenargs, in the returncode attribute, and output & stderr attributes if those streams were captured. - If timeout is given, and the process takes too long, a TimeoutExpired - exception will be raised. + If timeout, specified in seconds, is given and the process takes too + long, a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument From 35ef5f70360f29aaabdfef7ba9b9026e7a9898e5 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 30 Dec 2024 12:27:51 -0800 Subject: [PATCH 2/3] simplify wording Co-authored-by: Terry Jan Reedy --- Lib/subprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 82652a3deb6f8d..a4e92a129ab7ce 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -524,8 +524,8 @@ def run(*popenargs, in the returncode attribute, and output & stderr attributes if those streams were captured. - If timeout, specified in seconds, is given and the process takes too - long, a TimeoutExpired exception will be raised. + If timeout (seconds) is given and the process takes too long, + a TimeoutExpired exception will be raised. There is an optional argument "input", allowing you to pass bytes or a string to the subprocess's stdin. If you use this argument From 6713cfa01ca4058fee25c289f434657006f5d12d Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 30 Dec 2024 12:27:59 -0800 Subject: [PATCH 3/3] simplify wording Co-authored-by: Terry Jan Reedy --- Lib/subprocess.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index a4e92a129ab7ce..de88eedcf80ff9 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -386,8 +386,7 @@ def _text_encoding(): def call(*popenargs, timeout=None, **kwargs): """Run command with arguments. Wait for command to complete or - for timeout, specified in seconds, to expire. Then return the - returncode attribute. + for timeout seconds, then return the returncode attribute. The arguments are the same as for the Popen constructor. Example: