summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-08-12 12:36:04 (GMT)
committerGitHub <noreply@github.com>2021-08-12 12:36:04 (GMT)
commit5d444434ad4e1943a88c9d3aadd300fd0f05dab7 (patch)
treed287cc76adc529e32987d5d244fe55e0eb8fdded /Doc
parent2666d702e49aa0e4975553bec2e92ca4a2dba4ea (diff)
downloadcpython-5d444434ad4e1943a88c9d3aadd300fd0f05dab7.zip
cpython-5d444434ad4e1943a88c9d3aadd300fd0f05dab7.tar.gz
cpython-5d444434ad4e1943a88c9d3aadd300fd0f05dab7.tar.bz2
bpo-26228: Fix pty EOF handling (GH-12049) (GH-27732)
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> (cherry picked from commit 81ab8db235580317edcb0e559cd4c983f70883f5) Co-authored-by: Zephyr Shannon <geoffpshannon@gmail.com>
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