diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-07-17 10:48:33 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-07-17 10:48:33 (GMT) |
commit | 0d35741b167b6c7fdd201944c0e57379b1f246fd (patch) | |
tree | 5aa00cc3059a2ae98498960b791f4be9eb58cb75 /Doc | |
parent | 68f411670ec2145e783ea657c9d54a0a14815048 (diff) | |
parent | cc996b57890a251cef83101d5cfcbc58179cba5f (diff) | |
download | cpython-0d35741b167b6c7fdd201944c0e57379b1f246fd.zip cpython-0d35741b167b6c7fdd201944c0e57379b1f246fd.tar.gz cpython-0d35741b167b6c7fdd201944c0e57379b1f246fd.tar.bz2 |
(Merge 3.4) asyncio, tulip issue 190: Process.communicate() must ignore
BrokenPipeError
If you want to handle the BrokenPipeError, you can easily reimplement
communicate().
Add also a unit test to ensure that stdin.write() + stdin.drain() raises
BrokenPipeError.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-subprocess.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst index cba3aae..f0ffbf0 100644 --- a/Doc/library/asyncio-subprocess.rst +++ b/Doc/library/asyncio-subprocess.rst @@ -191,6 +191,10 @@ Process process, or ``None``, if no data should be sent to the child. The type of *input* must be bytes. + If a :exc:`BrokenPipeError` is raised when writing *input* into stdin, + the exception is ignored. It occurs when the process exits before all + data are written into stdin. + :meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``. Note that if you want to send data to the process's stdin, you need to @@ -205,6 +209,9 @@ Process This method is a :ref:`coroutine <coroutine>`. + .. versionchanged:: 3.4.2 + The method now ignores :exc:`BrokenPipeError`. + .. method:: kill() Kills the child. On Posix OSs the function sends :py:data:`SIGKILL` to |