Christian Heimes added the comment: Can you try this patch, please? It has the same effect as the other patch from Neal but it doesn't loose ref counts. I've patched the dealloc function of _FileIO to keep fd 1 and fd 2 open.
Index: Modules/_fileio.c =================================================================== --- Modules/_fileio.c (Revision 58699) +++ Modules/_fileio.c (Arbeitskopie) @@ -270,7 +270,8 @@ if (self->weakreflist != NULL) PyObject_ClearWeakRefs((PyObject *) self); - if (self->fd >= 0) { + /* Don't close stdout and stderr */ + if (self->fd == 0 || self->fd > 2) { errno = internal_close(self); if (errno < 0) { #ifdef HAVE_STRERROR ---------- nosy: +tiran __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1329> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com