[New-bugs-announce] [issue34566] pipe read sometimmes returns EOF but returncode is still None

Marcel Plch report at bugs.python.org
Mon Sep 3 08:06:40 EDT 2018


New submission from Marcel Plch <mplch at redhat.com>:

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

----------
components: Library (Lib)
files: script.py
messages: 324508
nosy: Dormouse759
priority: normal
severity: normal
status: open
title: pipe read sometimmes returns EOF but returncode is still None
versions: Python 3.8
Added file: https://bugs.python.org/file47782/script.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34566>
_______________________________________


More information about the New-bugs-announce mailing list