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 Dormouse759
Recipients Dormouse759
Date 2018-09-03.12:06:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1535976400.44.0.56676864532.issue34566@psf.upfronthosting.co.za>
In-reply-to
Content
TL;DR: For reproducer, please see attached file and the end of this description for a runner script.

It seems that when pipe is being read it has a chance of returning EOF and not setting the return code.
This bug affects all (or at least a broad set of) architectures and is present in all versions. (2.7 and 3.8 were tested).
This bug is not reproducible when configured using --with-pydebug flag.
As a result, any code relying on proper setting of the returncode attribute might (and probably is going to) fail.
-----------
$ for i in $(seq 1 1000); do ./python script.py; done | grep poll | sort | uniq -c

Actual output:
630 output: '', return code: 0, pollstatus=0
370 output: '', return code: None, pollstatus=None

Expected output:
1000 output: '', return code: 0, pollstatus=0
History
Date User Action Args
2018-09-03 12:06:40Dormouse759setrecipients: + Dormouse759
2018-09-03 12:06:40Dormouse759setmessageid: <1535976400.44.0.56676864532.issue34566@psf.upfronthosting.co.za>
2018-09-03 12:06:40Dormouse759linkissue34566 messages
2018-09-03 12:06:40Dormouse759create