class_docstr: This class represents a process running in a pseudoterminal.
  
  The main constructor is the :meth:`spawn` classmethod.
docstr: Read and return at most ``size`` bytes from the pty.
  
  Can block if there is nothing to read. Raises :exc:`EOFError` if the
  terminal was closed.
  
  Unlike Pexpect's ``read_nonblocking`` method, this doesn't try to deal
  with the vagaries of EOF on platforms that do strange things, like IRIX
  or older Solaris systems. It handles the errno=EIO pattern used on
  Linux, and the empty-string return used on BSD platforms and (seemingly)
  on recent Solaris.
docstr_tok: ["Read","and","return","at","most","``","size","``","bytes","from","the","pty",".","Can","block","if","there","is","nothing","to","read",".","Raises",":","exc",":","`","EOFError","`","if","the","terminal","was","closed",".","Unlike","Pexpect","'s","``","read_nonblocking","``","method",",","this","does","n't","try","to","deal","with","the","vagaries","of","EOF","on","platforms","that","do","strange","things",",","like","IRIX","or","older","Solaris","systems",".","It","handles","the","errno=EIO","pattern","used","on","Linux",",","and","the","empty-string","return","used","on","BSD","platforms","and","(","seemingly",")","on","recent","Solaris","."]
code: def read(self, size=1024):
      """Read and return at most ``size`` bytes from the pty.
  
      Can block if there is nothing to read. Raises :exc:`EOFError` if the
      terminal was closed.
  
      Unlike Pexpect's ``read_nonblocking`` method, this doesn't try to deal
      with the vagaries of EOF on platforms that do strange things, like IRIX
      or older Solaris systems. It handles the errno=EIO pattern used on
      Linux, and the empty-string return used on BSD platforms and (seemingly)
      on recent Solaris.
      """
      try:
          s = self.fileobj.read1(size)
      except (OSError, IOError) as err:
          if err.args[0] == errno.EIO:
              # Linux-style EOF
              self.flag_eof = True
              raise EOFError(
                  "End Of File (EOF). Exception style platform."
              )
          raise
      if s == b"":
          # BSD-style EOF (also appears to work on recent Solaris (OpenIndiana))
          self.flag_eof = True
          raise EOFError(
              "End Of File (EOF). Empty string style platform."
          )
  
      return s
  
imports: import codecs
  import errno
  import fcntl
  import io
  import os
  import pty
  import resource
  import signal
  import struct
  import sys
  import termios
  import time
  from pty import STDIN_FILENO, CHILD
  from .util import which, PtyProcessError
label_desc: Use image node_id 14 for calling the PtyProcess obj's underlying member method code with example usage: obj.read(size) and returns: s