Merged revisions 67571,67574-67576,67579-67581,67583,67591,67597,67608,67631 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r67571 | georg.brandl | 2008-12-05 10:13:45 +0100 (Fri, 05 Dec 2008) | 2 lines
Use markup.
........
r67574 | georg.brandl | 2008-12-05 10:25:32 +0100 (Fri, 05 Dec 2008) | 2 lines
#4441 followup: Add link to open() docs for Windows.
........
r67575 | georg.brandl | 2008-12-05 12:34:51 +0100 (Fri, 05 Dec 2008) | 2 lines
#4544: add `dedent` to textwrap.__all__.
........
r67576 | georg.brandl | 2008-12-05 13:09:41 +0100 (Fri, 05 Dec 2008) | 2 lines
#4529: fix parser's validation for try-except-finally statements.
........
r67579 | georg.brandl | 2008-12-05 16:29:39 +0100 (Fri, 05 Dec 2008) | 2 lines
#4517: add "special method" glossary entry and clarify when __getattribute__ is bypassed.
........
r67580 | georg.brandl | 2008-12-05 16:32:29 +0100 (Fri, 05 Dec 2008) | 2 lines
#4478: document that copyfile() can raise Error.
........
r67581 | georg.brandl | 2008-12-05 16:42:03 +0100 (Fri, 05 Dec 2008) | 2 lines
#3171: document that *slice are removed in 3k.
........
r67583 | georg.brandl | 2008-12-05 16:52:20 +0100 (Fri, 05 Dec 2008) | 4 lines
Move __import__ to the bottom of the functions list.
It doesn't make sense for such a fundamental document to have
the most obscure function listed at the top.
........
r67591 | georg.brandl | 2008-12-05 19:00:06 +0100 (Fri, 05 Dec 2008) | 2 lines
Followup to #4511: add link from decorator glossary entry to definition.
........
r67597 | georg.brandl | 2008-12-05 20:03:19 +0100 (Fri, 05 Dec 2008) | 2 lines
Remove confusing sentence part.
........
r67608 | georg.brandl | 2008-12-06 12:57:12 +0100 (Sat, 06 Dec 2008) | 2 lines
Follow-up to #4488: document PIPE and STDOUT properly.
........
r67631 | georg.brandl | 2008-12-07 12:54:07 +0100 (Sun, 07 Dec 2008) | 2 lines
Add link to the favicon to the docs.
........
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index dae582c..cea8b72 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -73,13 +73,13 @@
specified by the :envvar:`COMSPEC` environment variable.
*stdin*, *stdout* and *stderr* specify the executed programs' standard input,
- standard output and standard error file handles, respectively. Valid values are
- ``PIPE``, an existing file descriptor (a positive integer), an existing file
- object, and ``None``. ``PIPE`` indicates that a new pipe to the child should be
- created. With ``None``, no redirection will occur; the child's file handles
- will be inherited from the parent. Additionally, *stderr* can be ``STDOUT``,
- which indicates that the stderr data from the applications should be captured
- into the same file handle as for stdout.
+ standard output and standard error file handles, respectively. Valid values
+ are :data:`PIPE`, an existing file descriptor (a positive integer), an
+ existing file object, and ``None``. :data:`PIPE` indicates that a new pipe
+ to the child should be created. With ``None``, no redirection will occur;
+ the child's file handles will be inherited from the parent. Additionally,
+ *stderr* can be :data:`STDOUT`, which indicates that the stderr data from the
+ applications should be captured into the same file handle as for stdout.
If *preexec_fn* is set to a callable object, this object will be called in the
child process just before the child is executed. (Unix only)
@@ -119,6 +119,20 @@
of the main window and priority for the new process. (Windows only)
+.. data:: PIPE
+
+ Special value that can be used as the *stdin*, *stdout* or *stderr* argument
+ to :class:`Popen` and indicates that a pipe to the standard stream should be
+ opened.
+
+
+.. data:: STDOUT
+
+ Special value that can be used as the *stderr* argument to :class:`Popen` and
+ indicates that standard error should go into the same handle as standard
+ output.
+
+
Convenience Functions
^^^^^^^^^^^^^^^^^^^^^
@@ -261,20 +275,21 @@
.. attribute:: Popen.stdin
- If the *stdin* argument is ``PIPE``, this attribute is a file object that
- provides input to the child process. Otherwise, it is ``None``.
+ If the *stdin* argument was :data:`PIPE`, this attribute is a file object
+ that provides input to the child process. Otherwise, it is ``None``.
.. attribute:: Popen.stdout
- If the *stdout* argument is ``PIPE``, this attribute is a file object that
- provides output from the child process. Otherwise, it is ``None``.
+ If the *stdout* argument was :data:`PIPE`, this attribute is a file object
+ that provides output from the child process. Otherwise, it is ``None``.
.. attribute:: Popen.stderr
- If the *stderr* argument is ``PIPE``, this attribute is file object that
- provides error output from the child process. Otherwise, it is ``None``.
+ If the *stderr* argument was :data:`PIPE`, this attribute is a file object
+ that provides error output from the child process. Otherwise, it is
+ ``None``.
.. attribute:: Popen.pid
@@ -454,15 +469,15 @@
stdin=PIPE, stdout=PIPE, close_fds=True)
(child_stdout, child_stdin) = (p.stdout, p.stdin)
-The popen2.Popen3 and popen2.Popen4 basically works as subprocess.Popen, except
-that:
+:class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as
+:class:`subprocess.Popen`, except that:
-* subprocess.Popen raises an exception if the execution fails
+* :class:`Popen` raises an exception if the execution fails.
* the *capturestderr* argument is replaced with the *stderr* argument.
-* stdin=PIPE and stdout=PIPE must be specified.
+* ``stdin=PIPE`` and ``stdout=PIPE`` must be specified.
* popen2 closes all file descriptors by default, but you have to specify
- close_fds=True with subprocess.Popen.
+ ``close_fds=True`` with :class:`Popen`.