class_docstr: A base class providing the backwards-compatible spawn API for Pexpect.
  
  This should not be instantiated directly: use :class:`pexpect.spawn` or
  :class:`pexpect.fdpexpect.fdspawn`.
docstr: This reads data from the file descriptor.
  
  This is a simple implementation suitable for a regular file. Subclasses using ptys or pipes should override it.
  
  The timeout parameter is ignored.
docstr_tok: ["This","reads","data","from","the","file","descriptor",".","This","is","a","simple","implementation","suitable","for","a","regular","file",".","Subclasses","using","ptys","or","pipes","should","override","it",".","The","timeout","parameter","is","ignored","."]
code: def read_nonblocking(self, size=1, timeout=None):
      """This reads data from the file descriptor.
  
      This is a simple implementation suitable for a regular file. Subclasses using ptys or pipes should override it.
  
      The timeout parameter is ignored.
      """
  
      try:
          s = os.read(self.child_fd, size)
      except OSError as err:
          if err.args[0] == errno.EIO:
              # Linux-style EOF
              self.flag_eof = True
              raise EOF("End Of File (EOF). Exception style platform.")
          raise
      if s == b"":
          # BSD-style EOF
          self.flag_eof = True
          raise EOF("End Of File (EOF). Empty string style platform.")
  
      s = self._decoder.decode(s, final=False)
      self._log(s, "read")
      return s
  
imports: from io import StringIO, BytesIO
  import codecs
  import os
  import sys
  import re
  import errno
  from .exceptions import ExceptionPexpect, EOF, TIMEOUT
  from .expect import Expecter, searcher_string, searcher_re
label_desc: Use image node_id 8 for calling the SpawnBase obj's underlying member method code with example usage: obj.read_nonblocking(size, timeout) and returns: s