--- a/Lib/subprocess.py 2009-10-12 08:45:58.000000000 +0200 +++ b/Lib/subprocess.py 2009-11-23 14:31:42.687994247 +0100 @@ -438,7 +438,7 @@ def check_output(*popenargs, **kwargs): - """Run command with arguments and return its output as a byte string. + r"""Run command with arguments and return its output as a byte string. If the exit code was non-zero it raises a CalledProcessError. The CalledProcessError object will have the return code in the returncode @@ -447,15 +447,15 @@ The arguments are the same as for the Popen constructor. Example: >>> check_output(["ls", "-l", "/dev/null"]) - 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' + b'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' The stdout argument is not allowed as it is used internally. To capture standard error in the result, use stderr=subprocess.STDOUT. >>> check_output(["/bin/sh", "-c", - "ls -l non_existent_file ; exit 0"], - stderr=subprocess.STDOUT) - 'ls: non_existent_file: No such file or directory\n' + ... "ls -l non_existent_file ; exit 0"], + ... stderr=STDOUT) + b'ls: non_existent_file: No such file or directory\n' """ if 'stdout' in kwargs: raise ValueError('stdout argument not allowed, it will be overridden.')