◐ Shell
clean mode source ↗

bpo-26228: Fix pty EOF handling by RadicalZephyr · Pull Request #12049 · python/cpython

eamanu

When both file descriptors gracefully report an error. This presents
custom implementations of *master_read* and *stdin_read* that
accidentally or intentionally return an empty byte string from
blocking the terminal.

Co-Authored-By: Reilly Tucker Siemens <reilly@tuckersiemens.com>

@ambv ambv mentioned this pull request

Aug 11, 2021

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Aug 11, 2021
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 81ab8db)

Co-authored-by: Zephyr Shannon <geoffpshannon@gmail.com>

ambv pushed a commit that referenced this pull request

Aug 12, 2021
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 81ab8db)

Co-authored-by: Zephyr Shannon <geoffpshannon@gmail.com>