[issue13858] readline fails on nonblocking, unbuffered io.FileIO objects

Matt Joiner report at bugs.python.org
Wed Jan 25 06:13:48 CET 2012


New submission from Matt Joiner <anacrolix at gmail.com>:

_io._IOBase.readline doesn't seem to like _io.FileIO.read returning None, which occurs when it's unbuffered and nonblocking. (Modules/_io/fileio.c:745 in trunk). Can this be handled some other way?

$ python3.3
Python 3.3.0a0 (default:fb0f4fe8123e+, Jan 24 2012, 11:21:36) 
[GCC 4.6.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, io
>>> r, w = os.pipe2(os.O_NONBLOCK)
>>> f = io.open(r, 'rb', 0)
>>> f.readline()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: read() should have returned a bytes object, not 'NoneType'

----------
components: IO, Library (Lib)
messages: 151933
nosy: anacrolix
priority: normal
severity: normal
status: open
title: readline fails on nonblocking, unbuffered io.FileIO objects
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13858>
_______________________________________


More information about the Python-bugs-list mailing list