| --- 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. |