From 246c8026e254f4a682e89fdae2e330b3a703c510 Mon Sep 17 00:00:00 2001 From: DonnaDia <0dvd0bvb0@gmail.com> Date: Sat, 28 Aug 2021 23:09:36 +0300 Subject: [PATCH 1/7] added an explanation --- Doc/library/subprocess.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index af5463364c44b5..67246f55585264 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1149,6 +1149,11 @@ calls these functions. code was zero then return, otherwise raise :exc:`CalledProcessError`. The :exc:`CalledProcessError` object will have the return code in the :attr:`~CalledProcessError.returncode` attribute. + .. note:: + + If .. function:: `check_call` was run unsuccessfully - it can raise only + :exc:`CalledProcessError`, however there might be other exceptions if the + command could not run at all. Code needing to capture stdout or stderr should use :func:`run` instead:: From 9cef7954795859199053c1658f56f392bcc3dd79 Mon Sep 17 00:00:00 2001 From: DonnaDia <0dvd0bvb0@gmail.com> Date: Wed, 1 Sep 2021 19:28:54 +0300 Subject: [PATCH 2/7] changed function to func --- Doc/library/subprocess.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 67246f55585264..77d55c043e23ab 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1151,7 +1151,7 @@ calls these functions. :attr:`~CalledProcessError.returncode` attribute. .. note:: - If .. function:: `check_call` was run unsuccessfully - it can raise only + If :func: `check_call` was run unsuccessfully - it can raise only :exc:`CalledProcessError`, however there might be other exceptions if the command could not run at all. From 53d2c6921be932e049f9b52abf8cb31207622fe5 Mon Sep 17 00:00:00 2001 From: DonnaDia <0dvd0bvb0@gmail.com> Date: Wed, 1 Sep 2021 19:37:45 +0300 Subject: [PATCH 3/7] changed description --- Doc/library/subprocess.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 77d55c043e23ab..bcdde6b48677b7 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1151,9 +1151,10 @@ calls these functions. :attr:`~CalledProcessError.returncode` attribute. .. note:: - If :func: `check_call` was run unsuccessfully - it can raise only - :exc:`CalledProcessError`, however there might be other exceptions if the - command could not run at all. + If :func:`check_call` was unable to start the process it will return the error + occurred. If :func: `check_call` managed to launch a program but the program + failed and returned a non-zero error code then :exc:`CalledProcessError` will be + thrown with the actual return code. Code needing to capture stdout or stderr should use :func:`run` instead:: From a1e9dbf2a3feff1a7acb432b1923eeb12faf3baa Mon Sep 17 00:00:00 2001 From: DonnaDia <0dvd0bvb0@gmail.com> Date: Wed, 1 Sep 2021 19:39:02 +0300 Subject: [PATCH 4/7] added a small correction --- Doc/library/subprocess.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index bcdde6b48677b7..eec666533f9fc4 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1152,7 +1152,7 @@ calls these functions. .. note:: If :func:`check_call` was unable to start the process it will return the error - occurred. If :func: `check_call` managed to launch a program but the program + occurred. If :func:`check_call` managed to launch a program but the program failed and returned a non-zero error code then :exc:`CalledProcessError` will be thrown with the actual return code. From 993a0281f5cfca3fb8c945aff754561a64eab40e Mon Sep 17 00:00:00 2001 From: DonnaDia <0dvd0bvb0@gmail.com> Date: Wed, 1 Sep 2021 20:53:44 +0300 Subject: [PATCH 5/7] fixed formatting --- Doc/library/subprocess.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index eec666533f9fc4..7c8d55bda7369b 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1149,12 +1149,11 @@ calls these functions. code was zero then return, otherwise raise :exc:`CalledProcessError`. The :exc:`CalledProcessError` object will have the return code in the :attr:`~CalledProcessError.returncode` attribute. - .. note:: - If :func:`check_call` was unable to start the process it will return the error - occurred. If :func:`check_call` managed to launch a program but the program - failed and returned a non-zero error code then :exc:`CalledProcessError` will be - thrown with the actual return code. + If :func:`check_call` was unable to start the process it will return the error + occurred. If :func:`check_call` managed to launch a program but the program + failed and returned a non-zero error code then :exc:`CalledProcessError` will be + thrown with the actual return code. Code needing to capture stdout or stderr should use :func:`run` instead:: From dbae86eb6f1bf0747fa0b868069f90e4b73d82be Mon Sep 17 00:00:00 2001 From: DonnaDia <0dvd0bvb0@gmail.com> Date: Wed, 1 Sep 2021 21:05:17 +0300 Subject: [PATCH 6/7] fixed the phraze --- Doc/library/subprocess.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 7c8d55bda7369b..38a408faaf06cb 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1150,8 +1150,8 @@ calls these functions. :exc:`CalledProcessError` object will have the return code in the :attr:`~CalledProcessError.returncode` attribute. - If :func:`check_call` was unable to start the process it will return the error - occurred. If :func:`check_call` managed to launch a program but the program + If :func:`check_call` was unable to start the process it will propagate the exception + that was raised. If :func:`check_call` managed to launch a program but the program failed and returned a non-zero error code then :exc:`CalledProcessError` will be thrown with the actual return code. From b24c2b75083355ef8d848471ce1441f7e438f415 Mon Sep 17 00:00:00 2001 From: DonnaDia <0dvd0bvb0@gmail.com> Date: Sun, 5 Sep 2021 20:56:02 +0300 Subject: [PATCH 7/7] rephraze added --- Doc/library/subprocess.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 38a408faaf06cb..21a96a4bd5ff5d 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -1149,11 +1149,8 @@ calls these functions. code was zero then return, otherwise raise :exc:`CalledProcessError`. The :exc:`CalledProcessError` object will have the return code in the :attr:`~CalledProcessError.returncode` attribute. - If :func:`check_call` was unable to start the process it will propagate the exception - that was raised. If :func:`check_call` managed to launch a program but the program - failed and returned a non-zero error code then :exc:`CalledProcessError` will be - thrown with the actual return code. + that was raised. Code needing to capture stdout or stderr should use :func:`run` instead::