diff options
author | Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> | 2023-04-28 00:30:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 00:30:26 (GMT) |
commit | 67d140dba72dc2cb661d55878384464de46719e7 (patch) | |
tree | f9459ce8747f0910eb8e62c9c175801378e3175f /Doc | |
parent | 424a785a07049924603228b153f746cfe3a983a2 (diff) | |
download | cpython-67d140dba72dc2cb661d55878384464de46719e7.zip cpython-67d140dba72dc2cb661d55878384464de46719e7.tar.gz cpython-67d140dba72dc2cb661d55878384464de46719e7.tar.bz2 |
gh-83925: Make asyncio.subprocess communicate similar to non-asyncio (#18650)
subprocess's communicate(None) closes stdin of the child process, after
sending no (extra) data. Make asyncio variant do the same.
This fixes issues with processes that waits for EOF on stdin before
continuing.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/asyncio-subprocess.rst | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst index 4274638..b7c83aa 100644 --- a/Doc/library/asyncio-subprocess.rst +++ b/Doc/library/asyncio-subprocess.rst @@ -207,8 +207,9 @@ their completion. Interact with process: 1. send data to *stdin* (if *input* is not ``None``); - 2. read data from *stdout* and *stderr*, until EOF is reached; - 3. wait for process to terminate. + 2. closes *stdin*; + 3. read data from *stdout* and *stderr*, until EOF is reached; + 4. wait for process to terminate. The optional *input* argument is the data (:class:`bytes` object) that will be sent to the child process. @@ -229,6 +230,10 @@ their completion. Note, that the data read is buffered in memory, so do not use this method if the data size is large or unlimited. + .. versionchanged:: 3.12 + + *stdin* gets closed when `input=None` too. + .. method:: send_signal(signal) Sends the signal *signal* to the child process. |