cpython: c45b124e9af4 (original) (raw)

Mercurial > cpython

changeset 89964:c45b124e9af4

(Merge 3.4) Issue #21006: asyncio doc: reorganize subprocess doc [#21006]

Victor Stinner victor.stinner@gmail.com
date Tue, 25 Mar 2014 09:40:39 +0100
parents 9f7345e23b32(current diff)dd2c7cca5980(diff)
children 1d523b48efa3
files
diffstat 2 files changed, 94 insertions(+), 84 deletions(-)[+] [-] Doc/library/asyncio-eventloop.rst 84 Doc/library/asyncio-subprocess.rst 94

line wrap: on

line diff

--- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -450,84 +450,8 @@ Resolve host name :meth:socket.getnameinfo function but non-blocking. -Running subprocesses --------------------- - -Run subprocesses asynchronously using the :mod:subprocess module. - -.. note:: -

-.. note:: -

-.. method:: BaseEventLoop.subprocess_exec(protocol_factory, *args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) -

-

-

-

-

-.. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, *, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) -

.. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe) @@ -553,8 +477,8 @@ Run subprocesses asynchronously using th .. seealso::

UNIX signals

--- a/Doc/library/asyncio-subprocess.rst +++ b/Doc/library/asyncio-subprocess.rst @@ -3,29 +3,115 @@ Subprocess ========== -Create a subprocess -------------------- +Operating system support +------------------------ + +On Windows, the default event loop uses :class:selectors.SelectSelector +which only supports sockets. The :class:ProactorEventLoop should be used to +support subprocesses. + +On Mac OS X older than 10.9 (Mavericks), :class:selectors.KqueueSelector +does not support character devices like PTY, whereas it is used by the +default event loop. The :class:SelectorEventLoop can be used with +:class:SelectSelector or :class:PollSelector to handle character +devices on Mac OS X 10.6 (Snow Leopard) and later. + + +Create a subprocess: high-level API using Process +------------------------------------------------- .. function:: create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, loop=None, limit=None, **kwds) Run the shell command cmd given as a string. Return a :class:~asyncio.subprocess.Process instance.

.. function:: create_subprocess_exec(*args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, **kwds) Create a subprocess. Return a :class:~asyncio.subprocess.Process instance.

Use the :meth:BaseEventLoop.connect_read_pipe and :meth:BaseEventLoop.connect_write_pipe methods to connect pipes. + +Create a subprocess: low-level API using subprocess.Popen +--------------------------------------------------------- + +Run subprocesses asynchronously using the :mod:subprocess module. + +.. method:: BaseEventLoop.subprocess_exec(protocol_factory, *args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) +

+

+

+

+

+.. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, *, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) +

.. seealso::

Constants