Merged revisions 76923,76926,77009,77082-77083,77085,77087,77121 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
................
r76923 | georg.brandl | 2009-12-20 15:24:06 +0100 (So, 20 Dez 2009) | 1 line
#7493: more review fixes.
................
r76926 | georg.brandl | 2009-12-20 15:38:23 +0100 (So, 20 Dez 2009) | 9 lines
Recorded merge of revisions 76925 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76925 | georg.brandl | 2009-12-20 15:33:20 +0100 (So, 20 Dez 2009) | 1 line
#7381: subprocess documentation and library docstring consistency fixes.
........
................
r77009 | georg.brandl | 2009-12-23 11:30:45 +0100 (Mi, 23 Dez 2009) | 1 line
#7417: add signature to open() docstring.
................
r77082 | georg.brandl | 2009-12-28 08:59:20 +0100 (Mo, 28 Dez 2009) | 1 line
#7577: fix signature info for getbufferproc.
................
r77083 | georg.brandl | 2009-12-28 09:00:47 +0100 (Mo, 28 Dez 2009) | 9 lines
Merged revisions 77081 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77081 | georg.brandl | 2009-12-28 08:59:05 +0100 (Mo, 28 Dez 2009) | 1 line
#7577: fix signature of PyBuffer_FillInfo().
........
................
r77085 | georg.brandl | 2009-12-28 09:02:38 +0100 (Mo, 28 Dez 2009) | 9 lines
Merged revisions 77084 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77084 | georg.brandl | 2009-12-28 09:01:59 +0100 (Mo, 28 Dez 2009) | 1 line
#7586: fix typo.
........
................
r77087 | georg.brandl | 2009-12-28 09:10:38 +0100 (Mo, 28 Dez 2009) | 9 lines
Recorded merge of revisions 77086 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77086 | georg.brandl | 2009-12-28 09:09:32 +0100 (Mo, 28 Dez 2009) | 1 line
#7381: consistency update, and backport avoiding ``None >= 0`` check from py3k.
........
................
r77121 | georg.brandl | 2009-12-29 22:38:35 +0100 (Di, 29 Dez 2009) | 1 line
#7590: exception classes no longer are in the "exceptions" module. Also clean up text that was written with string exceptions in mind.
................
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 72ea8c6..698e535 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -136,10 +136,9 @@
.. note::
- If specified, *env* must provide any variables required
- for the program to execute. On Windows, in order to run a
- `side-by-side assembly`_ the specified *env* **must** include a valid
- :envvar:`SystemRoot`.
+ If specified, *env* must provide any variables required for the program to
+ execute. On Windows, in order to run a `side-by-side assembly`_ the
+ specified *env* **must** include a valid :envvar:`SystemRoot`.
.. _side-by-side assembly: http://en.wikipedia.org/wiki/Side-by-Side_Assembly
@@ -188,7 +187,7 @@
The arguments are the same as for the Popen constructor. Example::
- retcode = call(["ls", "-l"])
+ >>> retcode = subprocess.call(["ls", "-l"])
.. warning::
@@ -206,7 +205,8 @@
The arguments are the same as for the Popen constructor. Example::
- check_call(["ls", "-l"])
+ >>> subprocess.check_call(["ls", "-l"])
+ 0
.. warning::
@@ -225,15 +225,15 @@
The arguments are the same as for the :class:`Popen` constructor. Example::
>>> subprocess.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``::
>>> subprocess.check_output(
- ["/bin/sh", "-c", "ls non_existent_file ; exit 0"],
- stderr=subprocess.STDOUT)
- 'ls: non_existent_file: No such file or directory\n'
+ ... ["/bin/sh", "-c", "ls non_existent_file; exit 0"],
+ ... stderr=subprocess.STDOUT)
+ b'ls: non_existent_file: No such file or directory\n'
.. versionadded:: 3.1
@@ -247,7 +247,6 @@
stripped from the output. The exit status for the command can be interpreted
according to the rules for the C function :cfunc:`wait`. Example::
- >>> import subprocess
>>> subprocess.getstatusoutput('ls /bin/ls')
(0, '/bin/ls')
>>> subprocess.getstatusoutput('cat /bin/junk')
@@ -264,7 +263,6 @@
Like :func:`getstatusoutput`, except the exit status is ignored and the return
value is a string containing the command's output. Example::
- >>> import subprocess
>>> subprocess.getoutput('ls /bin/ls')
'/bin/ls'