Message354298
| 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: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 |
|