From 0c270e5dcf880bdc4247162735f88daf09fbb27a Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 21 May 2020 08:49:55 +0100 Subject: [PATCH 1/3] bpo-40707: Document that Popen.communicate sets the returncode attribute. --- 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 5988bd35e72b123..2deb6eafd88f260 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -738,10 +738,11 @@ Instances of the :class:`Popen` class have the following methods: .. method:: Popen.communicate(input=None, timeout=None) Interact with process: Send data to stdin. Read data from stdout and stderr, - until end-of-file is reached. Wait for process to terminate. The optional - *input* argument should be data to be sent to the child process, or - ``None``, if no data should be sent to the child. If streams were opened in - text mode, *input* must be a string. Otherwise, it must be bytes. + until end-of-file is reached. Wait for process to terminate. Set + :attr:`~Popen.returncode` attribute. The optional *input* argument should be + data to be sent to the child process, or ``None``, if no data should be sent + to the child. If streams were opened in text mode, *input* must be a string. + Otherwise, it must be bytes. :meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``. The data will be strings if streams were opened in text mode; otherwise, From 0b07045a9e68ccae491f65227a34f3ba1a6b8759 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 21 May 2020 12:54:57 +0100 Subject: [PATCH 2/3] Update Doc/library/subprocess.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rémi Lapeyre --- 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 2deb6eafd88f260..71688d4465f28dc 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -738,7 +738,7 @@ Instances of the :class:`Popen` class have the following methods: .. method:: Popen.communicate(input=None, timeout=None) Interact with process: Send data to stdin. Read data from stdout and stderr, - until end-of-file is reached. Wait for process to terminate. Set + until end-of-file is reached. Wait for process to terminate and set :attr:`~Popen.returncode` attribute. The optional *input* argument should be data to be sent to the child process, or ``None``, if no data should be sent to the child. If streams were opened in text mode, *input* must be a string. From 67200965bc99f3fe1b3c2569274d95721557e23b Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Tue, 23 Jun 2020 21:28:20 -0400 Subject: [PATCH 3/3] Update Doc/library/subprocess.rst --- 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 71688d4465f28dc..e37cc980e975750 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -738,7 +738,7 @@ Instances of the :class:`Popen` class have the following methods: .. method:: Popen.communicate(input=None, timeout=None) Interact with process: Send data to stdin. Read data from stdout and stderr, - until end-of-file is reached. Wait for process to terminate and set + until end-of-file is reached. Wait for process to terminate and set the :attr:`~Popen.returncode` attribute. The optional *input* argument should be data to be sent to the child process, or ``None``, if no data should be sent to the child. If streams were opened in text mode, *input* must be a string.