Skip to content

Commit

Permalink
Resolves Issue #49 -- bad fdspawned-interact()
Browse files Browse the repository at this point in the history
tested on centos using script by @aidanhs, not that doing your own
pty.fork() is really recommended if you're going to use interact

Otherwise, tested also using traditional use of interact, though
that worked fine previously -- it still works fine, now.  With
this, the test script provided by aidnhs now exits fine.

I would be interested in a test case and a more precise use-case.
  • Loading branch information
jquast committed Jun 2, 2014
1 parent 752b17e commit 7a7529e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pexpect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,8 +1645,9 @@ def __interact_copy(self, escape_character=None,
data = self.__interact_read(self.child_fd)
except OSError as e:
# The subprocess may have closed before we get to reading it
if e.errno != errno.EIO:
raise
if e.errno == errno.EIO:
break # EOF on linux
raise
if output_filter:
data = output_filter(data)
if self.logfile is not None:
Expand Down

0 comments on commit 7a7529e

Please sign in to comment.