(Not sure if my other message arrived) I am guilty of using this idiom, too.
The standard library http://www.python.org/dev/doc/devel/lib/module-sys.html#l2h-396 says: """ __stdin__ __stdout__ __stderr__ These objects contain the original values of stdin, stderr and stdout at the start of the program. They are used during finalization, and could be useful to restore the actual files to known working file objects in case they have been overwritten with a broken object. """ Notice the "during finalization" sentence. Maybe you should change the doc and explain what __stdout__ is intended for? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list