code: def read(self, size=1024):
          
          data = self.fileobj.recv(size)
          if not data:
              self.flag_eof = True
              raise EOFError('Pty is closed')
  
          return self.decoder.decode(data, final=False)
docs: Read and return at most ``size`` characters from the pty.
  
          Can block if there is nothing to read. Raises :exc:`EOFError` if the
          terminal was closed.