Redirection of Python output fails
Brought to you by:
bozho
I'm having the same problem of bug #370, trying to output Python output to a file will fail with
c:\test.py >a.txt
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
a.txt is created, but nothing is written to it.
If I do the same via cmd, the "hello world" is written to the file with no problems.
Windows 7, Python 2.7, console v2.00.148
Thanks!
I can verify that I am seeing the same issue, using Python 2.6 with the same OS & Console version.
Interestingly, there is no problem when running this in either Console or cmd:
python -c "print('Hello World')" |more
However, write that same minimal program to a file 'test.py', and running "test.py |more" will work correctly in cmd but will produce that error in Console.
Last edit: Sidlon 2014-03-21