[Python-checkins] cpython (merge 3.3 -> default): Issue #10197: Indicate availability of subprocess.get[status]output on Windows

tim.golden python-checkins at python.org
Sun Nov 3 19:28:15 CET 2013


http://hg.python.org/cpython/rev/effad2bda4cb
changeset:   86892:effad2bda4cb
parent:      86888:e3180c58a78c
parent:      86891:2924a63aab73
user:        Tim Golden <mail at timgolden.me.uk>
date:        Sun Nov 03 18:25:51 2013 +0000
summary:
  Issue #10197: Indicate availability of subprocess.get[status]output on Windows and add a note about the effects of universal newlines

files:
  Doc/library/subprocess.rst |  16 ++++++++++------
  1 files changed, 10 insertions(+), 6 deletions(-)


diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -1058,10 +1058,12 @@
 
    Return ``(status, output)`` of executing *cmd* in a shell.
 
-   Execute the string *cmd* in a shell with :func:`os.popen` and return a 2-tuple
-   ``(status, output)``.  *cmd* is actually run as ``{ cmd ; } 2>&1``, so that the
-   returned output will contain output or error messages.  A trailing newline is
-   stripped from the output.  The exit status for the command can be interpreted
+   Execute the string *cmd* in a shell with :class:`Popen` and return a 2-tuple
+   ``(status, output)`` via :func:`Popen.communicate`. Universal newlines mode
+   is used; see the notes on :ref:`frequently-used-arguments` for more details.
+
+   A trailing newline is stripped from the output.
+   The exit status for the command can be interpreted
    according to the rules for the C function :c:func:`wait`.  Example::
 
       >>> subprocess.getstatusoutput('ls /bin/ls')
@@ -1071,7 +1073,8 @@
       >>> subprocess.getstatusoutput('/bin/junk')
       (256, 'sh: /bin/junk: not found')
 
-   Availability: UNIX.
+   .. versionchanged:: 3.3
+      Availability: Unix & Windows
 
 
 .. function:: getoutput(cmd)
@@ -1084,7 +1087,8 @@
       >>> subprocess.getoutput('ls /bin/ls')
       '/bin/ls'
 
-   Availability: UNIX.
+   .. versionchanged:: 3.3
+      Availability: Unix & Windows
 
 
 Notes

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list