Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2777)

Unified Diff: Doc/library/subprocess.rst

Issue 12044: subprocess.Popen.__exit__ doesn't wait for process end
Patch Set: Created 2 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/subprocess.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Doc/library/subprocess.rst Wed May 11 22:37:50 2011 +0800
+++ b/Doc/library/subprocess.rst Wed May 11 18:35:39 2011 +0200
@@ -219,13 +219,19 @@
*creationflags*, if given, can be :data:`CREATE_NEW_CONSOLE` or
:data:`CREATE_NEW_PROCESS_GROUP`. (Windows only)
- Popen objects are supported as context managers via the :keyword:`with` statement,
- closing any open file descriptors on exit.
+ Popen objects are supported as context managers via the :keyword:`with` statement:
+ on exit, standard file descriptors are closed, and the process is waited for.
::
with Popen(["ifconfig"], stdout=PIPE) as proc:
log.write(proc.stdout.read())
+ .. note::
+
+ In the initial implementation, the process was not automatically waited
+ for upon exit from the context manager. Code intending to be compatible
+ with Python 2.7.1 and earlier should explicitly call :meth:`Popen.wait`.
+
.. versionchanged:: 3.2
Added context manager support.
« no previous file with comments | « no previous file | Lib/subprocess.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7