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

BUG: kernel dies if user sets sys.stderr or sys.stdout to a file object #2925

Closed
ghost opened this issue Feb 12, 2013 · 1 comment · Fixed by #2926
Closed

BUG: kernel dies if user sets sys.stderr or sys.stdout to a file object #2925

ghost opened this issue Feb 12, 2013 · 1 comment · Fixed by #2926
Milestone

Comments

@ghost
Copy link

ghost commented Feb 12, 2013

If the user redirects the streams to a file for example,
the kernel would raise an exception because file
objects do not have set_parent defined, unlike ipython's
OutStream.

steps to reproduce:

In [2]: sys.stderr=open("/tmp/o","wb")
@minrk
Copy link
Member

minrk commented Feb 12, 2013

I guess we should trap it, so user redirects of stdout/stderr do not survive outside a cell.

@minrk minrk closed this as completed in 465f43c Feb 13, 2013
minrk added a commit that referenced this issue Mar 5, 2013
…nt() #2925

If the user redirects the streams to a file for example,
the kernel would raise an exception because file
objects do not have set_parent defined, unlike ipython's
OutStream.
This happens even if the user does this in a spawned thread.

closes #2925
minrk added a commit that referenced this issue Mar 20, 2013
…nt() #2925

If the user redirects the streams to a file for example,
the kernel would raise an exception because file
objects do not have set_parent defined, unlike ipython's
OutStream.
This happens even if the user does this in a spawned thread.

closes #2925
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
If the user redirects the streams to a file for example,
the kernel would raise an exception because file
objects do not have set_parent defined, unlike ipython's
OutStream.
This happens even if the user does this in a spawned thread.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Don't die if stderr/stdout do not support set_parent()

If the user redirects the streams to a file for example,
the kernel would raise an exception because file
objects do not have set_parent defined, unlike ipython's
OutStream.
This happens even if the user does this in a spawned thread.

closes ipython#2925
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant