Message354298
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. |
|
Date |
User |
Action |
Args |
2019-10-09 21:33:54 | Fritz Reese | set | recipients:
+ Fritz Reese, vstinner, ezio.melotti, yac |
2019-10-09 21:33:54 | Fritz Reese | set | messageid: <1570656834.89.0.44105752454.issue24560@roundup.psfhosted.org> |
2019-10-09 21:33:54 | Fritz Reese | link | issue24560 messages |
2019-10-09 21:33:54 | Fritz Reese | create | |
|