closing stdin, stdout and stderr
donn at u.washington.edu
Tue Dec 27 18:40:17 CET 2005
In article <mailman.2567.1135642534.18701.python-list at python.org>,
Martijn Brouwer <e.a.m.brouwer at alumnus.utwente.nl> wrote:
> I read this one, which was the reason that I tried os.close instead of
> sys.stdXXX.close(). But I would like to know why it does not close a
> file discriptor is I call its close method().
They're special. I suppose because of internal dependencies - last
chance exception handler etc. - they are created without a close
function, internally, so close() has no effect. I don't know if it
really makes any sense, since anyway one may close the file descriptors
directly as you did.
Donn Cave, donn at u.washington.edu
More information about the Python-list