Skip to content

Commit 1c4a09c

Browse files
committed
Update BufferedIOBase class doc for non-blocking
1 parent 22bc9aa commit 1c4a09c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Doc/library/io.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,13 @@ I/O Base Classes
528528
It inherits from :class:`IOBase`.
529529

530530
The main difference with :class:`RawIOBase` is that methods :meth:`read`,
531-
:meth:`readinto` and :meth:`write` will try (respectively) to read as much
532-
input as requested or to consume all given output, at the expense of
533-
making perhaps more than one system call.
534-
535-
In addition, those methods can raise :exc:`BlockingIOError` if the
536-
underlying raw stream is in non-blocking mode and cannot take or give
537-
enough data; unlike their :class:`RawIOBase` counterparts, they will
538-
never return ``None``.
531+
:meth:`readinto` and :meth:`write` will try (respectively) to read
532+
as much input as requested or to emit all provided data.
533+
534+
In addition, if the underlying raw stream is in non-blocking mode, when the
535+
system returns would block :meth:`write` will raise :exc:`BlockingIOError`
536+
with :attr:`BlockingIOError.characters_written` and :meth:`read` will return
537+
data read so far or ``None`` if no data is available.
539538

540539
Besides, the :meth:`read` method does not have a default
541540
implementation that defers to :meth:`readinto`.

0 commit comments

Comments
 (0)