After the last line (print statement) in my python code, I get the following error:
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Anyone know where this might be coming from?
Update: My python code is extremely long but I will post portions that may have something to do with this error:
For one, near the beginning of the process I redirect stdout and stderr to a log file like this:
so = se = open(logfile, 'w', 0)
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
os.dup2(so.fileno(), sys.stdout.fileno())
os.dup2(se.fileno(), sys.stderr.fileno())
I do this all the time though and have never run into this error but it seems the most likely reason I'm seeing this.
stderr
) stream when you call the program? – Lomaxsys
? – Stope