This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.torek
Recipients chris.torek
Date 2016-01-28.04:04:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za>
In-reply-to
Content
The pty.spawn() code assumes that when the process on the slave side of the pty quits, the master side starts raising OSError when read-from or written-to.

That used to be true in FBSD, but then someone fixed (?) it, and now the master side simply returns EOF when read-from.  Furthermore, writes to the master simply disappear into the aether (this may be an OS bug, but even if the writes raised OSError, you would still have to type something in on stdin to get it copied over to get the error raised to get out of the loop).

The fix here makes an assumption that is true when using the built-in read calls: EOF on the master indicates that the slave is no longer reachable in any way and the whole thing should finish up immediately.  It might perhaps need a bit of documentation should someone want to substitute in their own read function (see enhancement request in issue22865).

I also fixed (sort of) issue17824, but only barely minimally, and put in a comment that it should really use the same mechanism as subprocess (but I think that should be a separate patch).
History
Date User Action Args
2016-01-28 04:04:21chris.toreksetrecipients: + chris.torek
2016-01-28 04:04:21chris.toreksetmessageid: <1453953861.58.0.104331734212.issue26228@psf.upfronthosting.co.za>
2016-01-28 04:04:21chris.toreklinkissue26228 messages
2016-01-28 04:04:20chris.torekcreate