[Python-checkins] cpython (3.4): asyncio doc: document BaseSubprocessTransport.close() method

victor.stinner python-checkins at python.org
Tue Oct 14 00:53:28 CEST 2014


https://hg.python.org/cpython/rev/764c63c3eac1
changeset:   93046:764c63c3eac1
branch:      3.4
parent:      93042:49b3829e59a3
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Oct 13 23:56:43 2014 +0200
summary:
  asyncio doc: document BaseSubprocessTransport.close() method

Modify also the get_pipe_transport() doc to mention explicitly the supported
file descriptors.

files:
  Doc/library/asyncio-protocol.rst |  19 +++++++++++++++----
  1 files changed, 15 insertions(+), 4 deletions(-)


diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
--- a/Doc/library/asyncio-protocol.rst
+++ b/Doc/library/asyncio-protocol.rst
@@ -207,10 +207,15 @@
    .. method:: get_pipe_transport(fd)
 
       Return the transport for the communication pipe corresponding to the
-      integer file descriptor *fd*.  The return value can be a readable or
-      writable streaming transport, depending on the *fd*.  If *fd* doesn't
-      correspond to a pipe belonging to this transport, :const:`None` is
-      returned.
+      integer file descriptor *fd*:
+
+      * ``0``: readable streaming transport of the standard input (*stdin*),
+        or :const:`None` if the subprocess was not created with ``stdin=PIPE``
+      * ``1``: writable streaming transport of the standard output (*stdout*),
+        or :const:`None` if the subprocess was not created with ``stdout=PIPE``
+      * ``2``: writable streaming transport of the standard error (*stderr*),
+        or :const:`None` if the subprocess was not created with ``stderr=PIPE``
+      * other *fd*: :const:`None`
 
    .. method:: get_returncode()
 
@@ -239,6 +244,12 @@
       On Windows, the Windows API function TerminateProcess() is called to
       stop the subprocess.
 
+   .. method:: close()
+
+      Ask the subprocess to stop by calling the :meth:`terminate` method if the
+      subprocess hasn't returned yet, and close transports of all pipes
+      (*stdin*, *stdout* and *stderr*).
+
 
 .. _asyncio-protocol:
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list