@@ -1636,7 +1636,13 @@ def _checkWritable(self, msg=None):
16361636 def read (self , size = None ):
16371637 """Read at most size bytes, returned as bytes.
16381638
1639- Only makes one system call, so less data may be returned than requested
1639+ If size is less than 0, read all bytes in the file making
1640+ multiple read calls. See ``_io.FileIO.readall``.
1641+
1642+ Attempts to make only one system call, retrying only per
1643+ PEP-475 (EINTR). This means less data may be returned than
1644+ requested.
1645+
16401646 In non-blocking mode, returns None if no data is available.
16411647 Return an empty bytes object at EOF.
16421648 """
@@ -1652,8 +1658,13 @@ def read(self, size=None):
16521658 def readall (self ):
16531659 """Read all data from the file, returned as bytes.
16541660
1655- In non-blocking mode, returns as much as is immediately available,
1656- or None if no data is available. Return an empty bytes object at EOF.
1661+ Reads until either there is an error or read() returns size 0
1662+ (indicates EOF). If the file is already at EOF, returns an
1663+ empty bytes object.
1664+
1665+ In non-blocking mode, returns as much data as could be read
1666+ before EAGAIN. If no data is available (EAGAIN is returned
1667+ before bytes are read) returns None.
16571668 """
16581669 self ._checkClosed ()
16591670 self ._checkReadable ()
0 commit comments