@@ -64,6 +64,12 @@ In-memory text streams are also available as :class:`StringIO` objects::
6464
6565 f = io.StringIO("some initial text data")
6666
67+ .. note ::
68+
69+ When working with a non-blocking stream, be aware that read operations on text I/O objects
70+ might raise a :exc: `BlockingIOError ` if the stream cannot perform the operation
71+ immediately.
72+
6773The text stream API is described in detail in the documentation of
6874:class: `TextIOBase `.
6975
@@ -770,6 +776,11 @@ than raw I/O does.
770776 Read and return *size * bytes, or if *size * is not given or negative, until
771777 EOF or if the read call would block in non-blocking mode.
772778
779+ .. note ::
780+
781+ When the underlying raw stream is non-blocking, a :exc: `BlockingIOError `
782+ may be raised if a read operation cannot be completed immediately.
783+
773784 .. method :: read1(size=-1, /)
774785
775786 Read and return up to *size * bytes with only one call on the raw stream.
@@ -779,6 +790,10 @@ than raw I/O does.
779790 .. versionchanged :: 3.7
780791 The *size * argument is now optional.
781792
793+ .. note ::
794+
795+ When the underlying raw stream is non-blocking, a :exc: `BlockingIOError `
796+ may be raised if a read operation cannot be completed immediately.
782797
783798.. class :: BufferedWriter(raw, buffer_size=DEFAULT_BUFFER_SIZE)
784799
@@ -1007,6 +1022,11 @@ Text I/O
10071022 .. versionchanged :: 3.10
10081023 The *encoding * argument now supports the ``"locale" `` dummy encoding name.
10091024
1025+ .. note ::
1026+
1027+ When the underlying raw stream is non-blocking, a :exc: `BlockingIOError `
1028+ may be raised if a read operation cannot be completed immediately.
1029+
10101030 :class: `TextIOWrapper ` provides these data attributes and methods in
10111031 addition to those from :class: `TextIOBase ` and :class: `IOBase `:
10121032
0 commit comments