summaryrefslogtreecommitdiffstats
path: root/Doc/library/subprocess.rst
diff options
context:
space:
mode:
authorTim Golden <mail@timgolden.me.uk>2013-11-03 18:25:51 (GMT)
committerTim Golden <mail@timgolden.me.uk>2013-11-03 18:25:51 (GMT)
commit29641383716cb11ad7df18aaaa11586dd2495c70 (patch)
tree100ee023c8b0c41ab8540b6dce4ea12fd345740c /Doc/library/subprocess.rst
parentaf734963d1148d09b10ec893f6948769b5474535 (diff)
parent3a2abb5800af18f45056a8e8ad97fff9490a138c (diff)
downloadcpython-29641383716cb11ad7df18aaaa11586dd2495c70.zip
cpython-29641383716cb11ad7df18aaaa11586dd2495c70.tar.gz
cpython-29641383716cb11ad7df18aaaa11586dd2495c70.tar.bz2
Issue #10197: Indicate availability of subprocess.get[status]output on Windows and add a note about the effects of universal newlines
Diffstat (limited to 'Doc/library/subprocess.rst')
-rw-r--r--Doc/library/subprocess.rst16
1 files changed, 10 insertions, 6 deletions
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 208edd5..96a0033 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -1058,10 +1058,12 @@ handling consistency are valid for these functions.
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 @@ handling consistency are valid for these functions.
>>> 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 @@ handling consistency are valid for these functions.
>>> subprocess.getoutput('ls /bin/ls')
'/bin/ls'
- Availability: UNIX.
+ .. versionchanged:: 3.3
+ Availability: Unix & Windows
Notes