diff -r 8bb426d386a5 Doc/library/subprocess.rst --- a/Doc/library/subprocess.rst Wed Oct 12 20:18:33 2016 +0200 +++ b/Doc/library/subprocess.rst Thu Oct 13 17:02:16 2016 +0200 @@ -1162,28 +1162,29 @@ .. function:: getstatusoutput(cmd) - Return ``(status, output)`` of executing *cmd* in a shell. + Return ``(exitcode, output)`` of executing *cmd* in a shell. Execute the string *cmd* in a shell with :meth:`Popen.check_output` and - return a 2-tuple ``(status, output)``. The locale encoding is used; + return a 2-tuple ``(exitcode, output)``. The locale encoding 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:: + The exit code for the command can be interpreted as the returncode of + subprocess. Example:: >>> subprocess.getstatusoutput('ls /bin/ls') (0, '/bin/ls') >>> subprocess.getstatusoutput('cat /bin/junk') - (256, 'cat: /bin/junk: No such file or directory') + (1, 'cat: /bin/junk: No such file or directory') >>> subprocess.getstatusoutput('/bin/junk') - (256, 'sh: /bin/junk: not found') + (127, 'sh: /bin/junk: not found') Availability: POSIX & Windows .. versionchanged:: 3.3.4 Windows support added - + The function now returns (exitcode, output) instead of (status, output). + See :func:`WEXITSTATUS` for information about status. .. function:: getoutput(cmd)