[issue7111] core dump when stderr is moved

Daniel Stutzbach report at bugs.python.org
Wed Oct 14 02:11:13 CEST 2009


Daniel Stutzbach <daniel at stutzbachenterprises.com> added the comment:

Is it even possible to portably test the validity of a file descriptor
without trying to write/read it?

When I first saw this bug, my gut feeling was "well, don't do that
then!"  However, I then recalled that Windows GUI applications have no
stdin, stdout, or stderr.  

Python 2 will raise IOError: Bad File Descriptor when the user tries to
write to stdout or stderr (more accurately, it raises the exception when
trying to flush data to the file descriptor).  

I just tested pythonw.exe.  If I set sys.stderr by hand to a file, then
write to sys.stdout, 2.6 will correctly write the exception to the file.
 3.1 exits silently.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7111>
_______________________________________


More information about the Python-bugs-list mailing list