[python-win32] sys.stdout.closed missing with win32trace
Michael Foord
fuzzyman at voidspace.org.uk
Sun Nov 4 11:21:01 CET 2007
TK Soh wrote:
> It looks like the "closed" attribute for sys.stderr and sys.stdout are
> missing when win32trace is in effect. Any way to work around this?
>
I have no idea about win32traceutil, but the sys module provides
sys.__stdout__ and sys.__stderr__ so that even when modules replace the
streams with custom objects you can still access the originals. This may
or may not be helpful...
Michael Foord
http://www.manning.com/foord
> python script:
> --------------------------
> import win32traceutil
> import sys
> if not sys.stdout.closed:
> print "stdout is opened"
> --------------------------
>
> Trace collector output:
> --------------------------
> Traceback (most recent call last):
> File "try.py", line 3, in <module>
> if not sys.stdout.closed:
> AttributeError: 'PyTraceObject' object has no attribute 'closed'
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>
More information about the python-win32
mailing list