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 Fritz Reese
Recipients Fritz Reese, ezio.melotti, vstinner, yac
Date 2019-10-09.21:33:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570656834.89.0.44105752454.issue24560@roundup.psfhosted.org>
In-reply-to
Content
This is still an issue on Linux in both 3.4 and 3.7 even when using io.open() as suggested by @vstinner:

>>> import io, os, fcntl
>>> r, w = os.pipe()
>>> fcntl(r, fcntl.F_SETFL, os.O_NONBLOCK)
0
>>> stream = io.open(r, 'rt')
>>> stream
<_io.TextIOWrapper name=X mode='rt' encoding='UTF-8'>
>>> stream.buffer
<_io.BufferedReader name=X>
>>> print(repr(stream.buffer.read()))
None
>>> stream.read()
Traceback (most recent call last):
  ...
  File ".../python3.7/codecs.py"..., in decode
    data = self.buffer + input
TypeError: can't concat NoneType to bytes

The error is present in at least 3.4 up to 3.7 where the underlying buffer.read() returns None which is not handled by the TextIOStream.
History
Date User Action Args
2019-10-09 21:33:54Fritz Reesesetrecipients: + Fritz Reese, vstinner, ezio.melotti, yac
2019-10-09 21:33:54Fritz Reesesetmessageid: <1570656834.89.0.44105752454.issue24560@roundup.psfhosted.org>
2019-10-09 21:33:54Fritz Reeselinkissue24560 messages
2019-10-09 21:33:54Fritz Reesecreate