summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorZephyr Shannon <geoffpshannon@gmail.com>2021-08-11 22:21:46 (GMT)
committerGitHub <noreply@github.com>2021-08-11 22:21:46 (GMT)
commit81ab8db235580317edcb0e559cd4c983f70883f5 (patch)
tree77894e660eba54cfe86044fa73b04fef02845d84 /Doc
parent64a7812c170f5d46ef16a1517afddc7cd92c5240 (diff)
downloadcpython-81ab8db235580317edcb0e559cd4c983f70883f5.zip
cpython-81ab8db235580317edcb0e559cd4c983f70883f5.tar.gz
cpython-81ab8db235580317edcb0e559cd4c983f70883f5.tar.bz2
bpo-26228: Fix pty EOF handling (GH-12049)
On non-Linux POSIX platforms, like FreeBSD or macOS, the FD used to read a forked PTY may signal its exit not by raising an error but by sending empty data to the read syscall. This case wasn't handled, leading to hanging `pty.spawn` calls. Co-authored-by: Reilly Tucker Siemens <reilly@tuckersiemens.com> Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/pty.rst6
1 files changed, 1 insertions, 5 deletions
diff --git a/Doc/library/pty.rst b/Doc/library/pty.rst
index 73d4f10..4b49d24 100644
--- a/Doc/library/pty.rst
+++ b/Doc/library/pty.rst
@@ -50,7 +50,7 @@ The :mod:`pty` module defines the following functions:
The functions *master_read* and *stdin_read* are passed a file descriptor
which they should read from, and they should always return a byte string. In
order to force spawn to return before the child process exits an
- :exc:`OSError` should be thrown.
+ empty byte array should be returned to signal end of file.
The default implementation for both functions will read and return up to 1024
bytes each time the function is called. The *master_read* callback is passed
@@ -65,10 +65,6 @@ The :mod:`pty` module defines the following functions:
process will quit without any input, *spawn* will then loop forever. If
*master_read* signals EOF the same behavior results (on linux at least).
- If both callbacks signal EOF then *spawn* will probably never return, unless
- *select* throws an error on your platform when passed three empty lists. This
- is a bug, documented in `issue 26228 <https://bugs.python.org/issue26228>`_.
-
Return the exit status value from :func:`os.waitpid` on the child process.
:func:`waitstatus_to_exitcode` can be used to convert the exit status into