This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients benjamin.peterson, doko, petere, pitrou, stutzbach
Date 2009-10-13.23:13:19
SpamBayes Score 1.63791e-12
Marked as misclassified No
Message-id <>
Please note that normally an error message is output, but of course it
doesn't display since stderr is invalid :-)

It's clearer if you close stdout instead:

$ ./python -c 'pass' >&-
Fatal Python error: Py_Initialize: can't initialize sys standard streams
OSError: [Errno 9] Bad file descriptor

If we want to allow for closed {stdin, stdout, stderr}, I'm not sure
what the semantics should be. Should sys.std{in, out, err} be None? Or a
file object which always throws an error?

Under Python 2.x, you don't get a crash but the behaviour is quite
unhelpful anyway:

$ python -c 'print 1' >&-
close failed in file object destructor:
Error in sys.excepthook:

Original exception was:
Date User Action Args
2009-10-13 23:13:22pitrousetrecipients: + pitrou, doko, benjamin.peterson, stutzbach, petere
2009-10-13 23:13:22pitrousetmessageid: <>
2009-10-13 23:13:20pitroulinkissue7111 messages
2009-10-13 23:13:19pitroucreate