diff options
author | Carol Willing <carolcode@willingconsulting.com> | 2018-09-14 01:28:19 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-09-14 01:28:19 (GMT) |
commit | 4e824e96491f33c8a8462aa4970c55942064ae76 (patch) | |
tree | b5f38d2e8a4c5c72c82a3455d9d1e3c825bb4527 /Doc/library/asyncio-subprocess.rst | |
parent | 11194c877c902a6c3b769d85be887c2272e0a541 (diff) | |
download | cpython-4e824e96491f33c8a8462aa4970c55942064ae76.zip cpython-4e824e96491f33c8a8462aa4970c55942064ae76.tar.gz cpython-4e824e96491f33c8a8462aa4970c55942064ae76.tar.bz2 |
bpo-33649: Polish asyncio subprocess and sync docs (GH-9285)
Second pass for asyncio subprocess and sync docs.
https://bugs.python.org/issue33649
Diffstat (limited to 'Doc/library/asyncio-subprocess.rst')
-rw-r--r-- | Doc/library/asyncio-subprocess.rst | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst index b05c236..92c081b 100644 --- a/Doc/library/asyncio-subprocess.rst +++ b/Doc/library/asyncio-subprocess.rst @@ -62,8 +62,7 @@ Creating Subprocesses The *limit* argument sets the buffer limit for :class:`StreamReader` wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` - (if :attr:`subprocess.PIPE` is passed to *stdout* and *stderr* - arguments). + (if :attr:`subprocess.PIPE` is passed to *stdout* and *stderr* arguments). Return a :class:`~asyncio.subprocess.Process` instance. @@ -78,15 +77,14 @@ Creating Subprocesses The *limit* argument sets the buffer limit for :class:`StreamReader` wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` - (if :attr:`subprocess.PIPE` is passed to *stdout* and *stderr* - arguments). + (if :attr:`subprocess.PIPE` is passed to *stdout* and *stderr* arguments). Return a :class:`~asyncio.subprocess.Process` instance. See the documentation of :meth:`loop.subprocess_shell` for other parameters. -.. note:: +.. important:: It is the application's responsibility to ensure that all whitespace and metacharacters are quoted appropriately to avoid `shell injection @@ -98,7 +96,8 @@ Creating Subprocesses .. note:: The default event loop that asyncio is pre-configured - to use on **Windows** does not support subprocesses. + to use on **Windows** does not support subprocesses. Subprocesses are + available for Windows if the :class:`ProactorEventLoop` is used. See :ref:`Subprocess Support on Windows <asyncio-windows-subprocess>` for details. @@ -206,7 +205,7 @@ communicate with them. exception is ignored. This condition occurs when the process exits before all data are written into *stdin*. - If its desired to send data to the process' *stdin*, + If it is desired to send data to the process' *stdin*, the process needs to be created with ``stdin=PIPE``. Similarly, to get anything other than ``None`` in the result tuple, the process has to be created with ``stdout=PIPE`` and/or @@ -265,8 +264,8 @@ communicate with them. Use the :meth:`communicate` method rather than :attr:`process.stdin.write() <stdin>`, :attr:`await process.stdout.read() <stdout>` or - :attr:`await process.stderr.read <stderr>` - to avoid deadlocks due to streams pausing reading or writing + :attr:`await process.stderr.read <stderr>`. + This avoids deadlocks due to streams pausing reading or writing and blocking the child process. .. attribute:: pid |