[New-bugs-announce] [issue35869] io.BufferReader.read() returns None
Steve Palmer
report at bugs.python.org
Thu Jan 31 10:21:50 EST 2019
New submission from Steve Palmer <steve at srpalmer.me.uk>:
class io.BufferedIOBase states "In addition, those methods [read(), readinto() and write()] can raise BlockingIOError if the underlying raw stream is in non-blocking mode and cannot take or give enough data; unlike their RawIOBase counterparts, they will never return None."
However, class.io.BufferedReader (inheriting from io.BufferedIOBase) *does* return None in this case. Admittedly, io.BufferedReader does says it is overriding the inherited method, but I'm surprised that change in behaviour declared for buffered objects, is reverted to the RarIOBase behaviour on a more specific class.
The attached file (a little long - sorry), simulates a slow non-blocking raw file, which it wraps in a BufferReader to test the behaviour defined in BufferedIOBase.
----------
files: read2.py
messages: 334630
nosy: steverpalmer
priority: normal
severity: normal
status: open
title: io.BufferReader.read() returns None
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48091/read2.py
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35869>
_______________________________________
More information about the New-bugs-announce
mailing list