[IPython-User] Manually Recreating sys.stderr
Wed Feb 5 09:24:32 CST 2014
(some third-party module, Yelp's mrjob, is messing up with the sys.stderr
every time I run it, so I want to give that module new sys.stderr every
time I run it)
What if I do something like:
my_session = sys.stderr.session
my_pub_socket = sys.stderr.pub_socket
my_name = sys.stderr.name
import IPython.kernel.zmq.iostream as myStream
myStdErr = myStream.OutStream(session = my_session, pub_socket =
my_pub_socket, name = my_name)
sys.stderr = myStdErr
The question is:
What will happen with the stderr that I am replacing? Will it potentially
create memory leaks? Do I have to .close() it?
Thank you all.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User