Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify StreamCapturer for subprocess testing #4456

Merged
merged 2 commits into from Oct 30, 2013

Conversation

takluyver
Copy link
Member

Rather than using a transient pipe for each subprocess started, the StreamCapturer now makes a single pipe, and subprocesses redirect their output to it.

So long as this works on Windows (I've done brief testing, and os.pipe() seems to be functional), this will hopefully make this much more robust. The recent failures in ShiningPanda on IPython.parallel have been caused by StreamCapturer.

Rather than using a transient pipe for each subprocess started, the
StreamCapturer now makes a single pipe, and subprocesses redirect their
output to it.

So long as this works on Windows (I've done brief testing, and os.pipe()
seems to be functional), this will hopefully make this much more robust.
The recent failures in ShiningPanda on IPython.parallel have been caused
by StreamCapturer.
with self.streams_lock:
self.streams.append(fd)
self.stream_added.set()
ready = select([self.readfd], [], [], 1)[0]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rats, I've just realised this isn't going to work on Windows: "An operation was attempted on something that is not a socket"

select() on Windows only works with sockets, not regular file
descriptors.
@takluyver
Copy link
Member Author

OK, the new approach should be Windows-safe

@minrk
Copy link
Member

minrk commented Oct 30, 2013

Looks good. Just double check that there aren't Windows issues, then 👍 to merge.

takluyver added a commit that referenced this pull request Oct 30, 2013
Simplify StreamCapturer for subprocess testing
@takluyver takluyver merged commit 42b3342 into ipython:master Oct 30, 2013
@takluyver takluyver deleted the stream-capturer-simplify branch November 18, 2013 18:47
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Simplify StreamCapturer for subprocess testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants