Skip to content

Commit 59c763e

Browse files
committed
Update comments in FileIO to match current code
1 parent 61b35f7 commit 59c763e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Modules/_io/fileio.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,11 @@ _io.FileIO.readall
725725
726726
Read all data from the file, returned as bytes.
727727
728-
In non-blocking mode, returns as much as is immediately available,
729-
or None if no data is available. Return an empty bytes object at EOF.
728+
Reads until either there is an error or read() returns size 0 (indicates EOF).
729+
If the file is already at EOF returns empty bytes.
730+
731+
In non-blocking mode, returns as much data as could be read before EAGAIN. If no
732+
data is available (EAGAIN is returned before bytes are read) returns None.
730733
[clinic start generated code]*/
731734

732735
static PyObject *
@@ -846,9 +849,14 @@ _io.FileIO.read
846849
847850
Read at most size bytes, returned as bytes.
848851
849-
Only makes one system call, so less data may be returned than requested.
850-
In non-blocking mode, returns None if no data is available.
851-
Return an empty bytes object at EOF.
852+
If size is less than 0, read all bytes in the file making multiple read calls.
853+
See ``_io.FileIO.readall``.
854+
855+
Attempts to make only one system call, retrying only per PEP-475 (EINTR). This
856+
means less data may be returned than requested.
857+
858+
In non-blocking mode, returns None if no data is available. Return an empty
859+
bytes object at EOF.
852860
[clinic start generated code]*/
853861

854862
static PyObject *

0 commit comments

Comments
 (0)