From 72565b8b9d1832b3e828b251ca334ea13dec2ed4 Mon Sep 17 00:00:00 2001 From: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> Date: Mon, 2 May 2022 13:00:21 -0600 Subject: [PATCH 01/14] Making unreliability of returncode explicit in documentation. --- Doc/library/subprocess.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 1e619a51e216ac..53bf4bce5ea685 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -897,6 +897,8 @@ The following attributes are also available: A negative value ``-N`` indicates that the child was terminated by signal ``N`` (POSIX only). + Note: The value stored in returncode may be out-of-date. Use poll() to reliably find the current return code. + Windows Popen Helpers --------------------- From 8b7c0c3d4c501a3943a2551903c3763d2b16dad9 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 19:52:56 +0000 Subject: [PATCH 02/14] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst diff --git a/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst b/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst new file mode 100644 index 00000000000000..8f73326245d33d --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst @@ -0,0 +1 @@ +Here we make it explicit that the returncode attribute can be outdated and then that the returncode is most reliability found by using poll(). From c0dcc5b0cb4a184e47ca045010f5d9af44dc3bfb Mon Sep 17 00:00:00 2001 From: Joshua Jay Herman <30265+zitterbewegung@users.noreply.github.com> Date: Mon, 2 May 2022 14:24:38 -0600 Subject: [PATCH 03/14] Rewording with benjaminp and abadger1999 suggestions. --- Doc/library/subprocess.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 53bf4bce5ea685..3fd7ffc7760fe8 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -890,14 +890,14 @@ The following attributes are also available: .. attribute:: Popen.returncode - The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly - by :meth:`communicate`). A ``None`` value indicates that the process + The child return code. This attribute caches the returncode when :meth:`poll`, :meth:`wait`, or (indirectly) :meth:`communicate` was last called. To get the current one :meth:`poll` can be called to update the cache and get the current value. + + A ``None`` value indicates that the process hasn't terminated yet. A negative value ``-N`` indicates that the child was terminated by signal ``N`` (POSIX only). - Note: The value stored in returncode may be out-of-date. Use poll() to reliably find the current return code. Windows Popen Helpers From d62de13c5be22bcb90d2d0daeef626d9d782fee9 Mon Sep 17 00:00:00 2001 From: Joshua Jay Herman <30265+zitterbewegung@users.noreply.github.com> Date: Mon, 2 May 2022 14:57:38 -0600 Subject: [PATCH 04/14] Integrating rewording from benjaminp --- 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 3fd7ffc7760fe8..e9297a4acc582c 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -890,8 +890,8 @@ The following attributes are also available: .. attribute:: Popen.returncode - The child return code. This attribute caches the returncode when :meth:`poll`, :meth:`wait`, or (indirectly) :meth:`communicate` was last called. To get the current one :meth:`poll` can be called to update the cache and get the current value. - + The child return code. The child return code. Initially ``None``, :attr:`returncode` is set by :meth:`poll` and :meth:`wait` after process termination is observed. + A ``None`` value indicates that the process hasn't terminated yet. From 903ae8d002a3584b2a06091f4011ae252c25a369 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 20:59:47 +0000 Subject: [PATCH 05/14] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst diff --git a/Misc/NEWS.d/next/Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst b/Misc/NEWS.d/next/Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst new file mode 100644 index 00000000000000..8f73326245d33d --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst @@ -0,0 +1 @@ +Here we make it explicit that the returncode attribute can be outdated and then that the returncode is most reliability found by using poll(). From 4adaaabbf6ff2087c89ea7ccd9054e6810dc21ea Mon Sep 17 00:00:00 2001 From: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> Date: Thu, 13 Oct 2022 07:42:06 -0500 Subject: [PATCH 06/14] Update Doc/library/subprocess.rst Co-authored-by: Oleg Iarygin --- 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 4df35dc6036709..6529470c2b8fc1 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -894,7 +894,7 @@ The following attributes are also available: .. attribute:: Popen.returncode - The child return code. The child return code. Initially ``None``, :attr:`returncode` is set by :meth:`poll` and :meth:`wait` after process termination is observed. + The child return code. Initially ``None``, :attr:`returncode` is set by :meth:`poll` and :meth:`wait` after process termination is observed. A ``None`` value indicates that the process hasn't terminated yet. From ca4ea717040c717f0109e0a13fb302d7902bea91 Mon Sep 17 00:00:00 2001 From: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> Date: Tue, 6 Dec 2022 08:21:31 -0600 Subject: [PATCH 07/14] Updating docs for formatting issues. Wrapping to 79 characters. --- Doc/library/subprocess.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 6529470c2b8fc1..3bf46d35a9b478 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -894,7 +894,8 @@ The following attributes are also available: .. attribute:: Popen.returncode - The child return code. Initially ``None``, :attr:`returncode` is set by :meth:`poll` and :meth:`wait` after process termination is observed. + The child return code. Initially ``None``, :attr:`returncode` is set by + :meth:`poll` and :meth:`wait` after process termination is observed. A ``None`` value indicates that the process hasn't terminated yet. From f7e1548507d164a81b0415c78e7c6348622141f1 Mon Sep 17 00:00:00 2001 From: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> Date: Tue, 6 Dec 2022 08:22:43 -0600 Subject: [PATCH 08/14] Updating for formatting issues Removing newline --- Doc/library/subprocess.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 3bf46d35a9b478..eacb94e55a7835 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -904,7 +904,6 @@ The following attributes are also available: ``N`` (POSIX only). - Windows Popen Helpers --------------------- From 6357654854d9cb10fbcfa44050f1b5824946ad6c Mon Sep 17 00:00:00 2001 From: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> Date: Tue, 6 Dec 2022 08:25:55 -0600 Subject: [PATCH 09/14] Removing duplicate entry --- .../Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst b/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst index 8f73326245d33d..8b137891791fe9 100644 --- a/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst +++ b/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst @@ -1 +1 @@ -Here we make it explicit that the returncode attribute can be outdated and then that the returncode is most reliability found by using poll(). + From 708288c215ea0f460daabb90a130752b5c2148fa Mon Sep 17 00:00:00 2001 From: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> Date: Tue, 6 Dec 2022 08:26:35 -0600 Subject: [PATCH 10/14] Removing duplicate news file. --- .../Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst diff --git a/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst b/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst deleted file mode 100644 index 8b137891791fe9..00000000000000 --- a/Misc/NEWS.d/next/Documentation/2022-05-02-19-52-55.gh-issue-87452._N1t5V.rst +++ /dev/null @@ -1 +0,0 @@ - From 41a5d2205935378184a9ca354ff607e83d8512a0 Mon Sep 17 00:00:00 2001 From: Joshua Herman <30265+zitterbewegung@users.noreply.github.com> Date: Tue, 6 Dec 2022 08:42:53 -0600 Subject: [PATCH 11/14] Removing trailing whitespace --- 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 eacb94e55a7835..bbc21afe691193 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -894,9 +894,9 @@ The following attributes are also available: .. attribute:: Popen.returncode - The child return code. Initially ``None``, :attr:`returncode` is set by + The child return code. Initially ``None``, :attr:`returncode` is set by :meth:`poll` and :meth:`wait` after process termination is observed. - + A ``None`` value indicates that the process hasn't terminated yet. From a6acc970bba789dc39635ffe0597378525c27751 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 24 Apr 2023 09:30:53 -0700 Subject: [PATCH 12/14] reword the Popen.returncode text --- Doc/library/subprocess.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index bbc21afe691193..093dcdec04aef1 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -895,10 +895,11 @@ The following attributes are also available: .. attribute:: Popen.returncode The child return code. Initially ``None``, :attr:`returncode` is set by - :meth:`poll` and :meth:`wait` after process termination is observed. - - A ``None`` value indicates that the process - hasn't terminated yet. + a call to the :meth:`poll`, :meth:`wait`, or :meth:`communicate` methods + if they detect that the process has terminated. + + A ``None`` value indicates that the process hadn't yet terminated at the + time of the last method call. A negative value ``-N`` indicates that the child was terminated by signal ``N`` (POSIX only). From a4eef80c7a51ccd6cf2ee5d82d0200a7e4b67889 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 24 Apr 2023 09:31:37 -0700 Subject: [PATCH 13/14] no need for a NEWS entry on a documentation edit --- .../Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst diff --git a/Misc/NEWS.d/next/Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst b/Misc/NEWS.d/next/Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst deleted file mode 100644 index 8f73326245d33d..00000000000000 --- a/Misc/NEWS.d/next/Documentation/2022-05-02-20-59-46.gh-issue-87452._N1t5V.rst +++ /dev/null @@ -1 +0,0 @@ -Here we make it explicit that the returncode attribute can be outdated and then that the returncode is most reliability found by using poll(). From eb00171fd8231529b4d72ee48d8eb14d16ee93bf Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 24 Apr 2023 09:38:23 -0700 Subject: [PATCH 14/14] - trailingspace --- 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 7f2a22bfc5b073..53dfbf827260c9 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -922,7 +922,7 @@ Reassigning them to new values is unsupported: The child return code. Initially ``None``, :attr:`returncode` is set by a call to the :meth:`poll`, :meth:`wait`, or :meth:`communicate` methods if they detect that the process has terminated. - + A ``None`` value indicates that the process hadn't yet terminated at the time of the last method call.