Skip to content

Commit 59bd2a1

Browse files
committed
Update to include behavior around None
BufferedReader at least just forwards `None` from the underlying stream. 1. `BufferedReader.read(size=10)` `raw.read(size=10)` returns None 2. `BufferedReader.read()` without size, raw implements `readall()` which returns None 3. `BufferedReader.read()` without size, raw doesn't have readall so uses a loop that calls `raw.read()` which returns None.
1 parent b6d319b commit 59bd2a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/io.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,9 @@ I/O Base Classes
584584
most streams this is to EOF, but for non-blocking streams more data may
585585
become available.
586586

587-
A :exc:`BlockingIOError` is raised if the underlying raw stream is in
588-
non blocking-mode, and has no data available at the moment.
587+
The standard library :class:`io.BufferedReader` returns ``None`` if
588+
reading would block and no data is available. Other implementations may
589+
return ``None`` or raise :exc:`BlockingIOError`.
589590

590591
.. method:: read1(size=-1, /)
591592

0 commit comments

Comments
 (0)