Message93946
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
Abandon
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:22 | pitrou | set | recipients:
+ pitrou, doko, benjamin.peterson, stutzbach, petere |
2009-10-13 23:13:22 | pitrou | set | messageid: <1255475602.49.0.855421564323.issue7111@psf.upfronthosting.co.za> |
2009-10-13 23:13:20 | pitrou | link | issue7111 messages |
2009-10-13 23:13:19 | pitrou | create | |
|