M
Michele Simionato
Maybe it is something obvious, but what is going on with this code?
import sys
myerr = file("myerr.txt", "w")
sys.stderr = myerr
try:
raise Exception, "some error"
finally:
myerr.close()
sys.stderr = sys.__stderr__
I would expect the error message to be written into "myerr.txt", instead
it is displayed on the console, on regular stderr (?) and "myerr.txt" is
empty. I guess I misunderstood something ...
Michele Simionato
import sys
myerr = file("myerr.txt", "w")
sys.stderr = myerr
try:
raise Exception, "some error"
finally:
myerr.close()
sys.stderr = sys.__stderr__
I would expect the error message to be written into "myerr.txt", instead
it is displayed on the console, on regular stderr (?) and "myerr.txt" is
empty. I guess I misunderstood something ...
Michele Simionato