Xavier de Gaye added the comment: TLPI (The Linux Programming Interface book) says about the pty implementation on linux, at section 5 of chapter 64:
If we close all file descriptors referring to the pseudoterminal slave, then: a) A read() from the master device fails with the error EIO. (On some other UNIX implementations, a read() returns end-of-file in this case.) and also adds this (which is slightly off topic here): b) A write() to the master device succeeds, unless the input queue of the slave device is full, in which case the write() blocks. If the slave device is subsequently reopened, these bytes can be read. UNIX implementations vary widely in their behavior for the last case. On some UNIX implementations, write() fails with the error EIO. On other implementations, write() succeeds, but the output bytes are discarded (i.e., they can’t be read if the slave is reopened). In general, these variations don’t present a problem. Normally, the process on the master side detects that the slave has been closed because a read() from the master returns end-of-file or fails. At this point, the process performs no further writes to the master. ---------- nosy: +xdegaye _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5380> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com