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 martin.panter
Recipients Dormouse759, martin.panter, vstinner
Date 2018-09-04.00:49:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1536022180.94.0.56676864532.issue34566@psf.upfronthosting.co.za>
In-reply-to
Content
The "grep" process may be closing its end of the pipe before it exits. Or if Grep leaves the pipe open when it exits, the OS may close the pipe before it makes the child exit status available. Either way, I suspect "p.stdout.read()" returns an empty string indicating the pipe is closed, but "p.poll()" returns None because the exit status is not yet ready. Even if it is the OS closing the pipe after the child exits, I doubt there is any guarantee about when that happens relative to the child's exit status becoming available.

The "poll" method does not wait for the child to exit. Normally you use the "wait" method in this situation. I suspect this is a bug in the application, not in Python.
History
Date User Action Args
2018-09-04 00:49:41martin.pantersetrecipients: + martin.panter, vstinner, Dormouse759
2018-09-04 00:49:40martin.pantersetmessageid: <1536022180.94.0.56676864532.issue34566@psf.upfronthosting.co.za>
2018-09-04 00:49:40martin.panterlinkissue34566 messages
2018-09-04 00:49:40martin.pantercreate