parameters: (self)
return_statement: return bytes(result)
docstring: Read all data from the file, returned as bytes.
  
          In non-blocking mode, returns as much as is immediately available,
          or None if no data is available.  Return an empty bytes object at EOF.
docstring_summary: Read all data from the file, returned as bytes.
docstring_tokens: Read all data from the file returned as bytes .
function: def readall(self):
          """Read all data from the file, returned as bytes.
  
          In non-blocking mode, returns as much as is immediately available,
          or None if no data is available.  Return an empty bytes object at EOF.
          """
          self._checkClosed()
          self._checkReadable()
          bufsize = DEFAULT_BUFFER_SIZE
          try:
              pos = os.lseek(self._fd, 0, SEEK_CUR)
              end = os.fstat(self._fd).st_size
              if end >= pos:
                  bufsize = end - pos + 1
          except OSError:
              pass
  
          result = bytearray()
          while True:
              if len(result) >= bufsize:
                  bufsize = len(result)
                  bufsize += max(bufsize, DEFAULT_BUFFER_SIZE)
              n = bufsize - len(result)
              try:
                  chunk = os.read(self._fd, n)
              except BlockingIOError:
                  if result:
                      break
                  return None
              if not chunk: # reached the end of the file
                  break
              result += chunk
  
          return bytes(result)
function_tokens: def readall ( self ) : self . _checkClosed ( ) self . _checkReadable ( ) bufsize = DEFAULT_BUFFER_SIZE try : pos = os . lseek ( self . _fd , 0 , SEEK_CUR ) end = os . fstat ( self . _fd ) . st_size if end >= pos : bufsize = end - pos + 1 except OSError : pass result = bytearray ( ) while True : if len ( result ) >= bufsize : bufsize = len ( result ) bufsize += max ( bufsize , DEFAULT_BUFFER_SIZE ) n = bufsize - len ( result ) try : chunk = os . read ( self . _fd , n ) except BlockingIOError : if result : break return None if not chunk : # reached the end of the file break result += chunk return bytes ( result )