@@ -145,11 +145,13 @@ class Popen(args, bufsize=-1, executable=None,
145145getstatusoutput(cmd):
146146 Return (status, output) of executing cmd in a shell.
147147
148- Execute the string 'cmd' in a shell with os.popen() and return a 2-tuple
149- (status, output). cmd is actually run as '{ cmd ; } 2>&1', so that the
150- returned output will contain output or error messages. A trailing newline
151- is stripped from the output. The exit status for the command can be
152- interpreted according to the rules for the C function wait(). Example:
148+ Execute the string 'cmd' in a shell with 'check_output' and
149+ return a 2-tuple (status, output). Universal newlines mode is used,
150+ meaning that the result with be decoded to a string.
151+
152+ A trailing newline is stripped from the output.
153+ The exit status for the command can be interpreted
154+ according to the rules for the function 'wait'. Example:
153155
154156 >>> subprocess.getstatusoutput('ls /bin/ls')
155157 (0, '/bin/ls')
@@ -684,13 +686,15 @@ def list2cmdline(seq):
684686# NB This only works (and is only relevant) for POSIX.
685687
686688def getstatusoutput (cmd ):
687- """Return (status, output) of executing cmd in a shell.
689+ """ Return (status, output) of executing cmd in a shell.
690+
691+ Execute the string 'cmd' in a shell with 'check_output' and
692+ return a 2-tuple (status, output). Universal newlines mode is used,
693+ meaning that the result with be decoded to a string.
688694
689- Execute the string 'cmd' in a shell with os.popen() and return a 2-tuple
690- (status, output). cmd is actually run as '{ cmd ; } 2>&1', so that the
691- returned output will contain output or error messages. A trailing newline
692- is stripped from the output. The exit status for the command can be
693- interpreted according to the rules for the C function wait(). Example:
695+ A trailing newline is stripped from the output.
696+ The exit status for the command can be interpreted
697+ according to the rules for the function 'wait'. Example:
694698
695699 >>> import subprocess
696700 >>> subprocess.getstatusoutput('ls /bin/ls')
0 commit comments