Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
On Thu, Feb 3, 2011 at 2:44 PM, Antoine Pitrou <rep...@bugs.python.org> wrote: .. >> Do you know of places where we use fd 2 instead of sys.stderr? > > We normally don't. One reason is that buffering inside sys.stderr can > make ordering of output incorrect. There are some places in C code where > we do "fprintf(stderr, ...)" but that's for specialized debugging > (disabled in normal builds) or fatal error messages. This is the case that I had in mind. What does non-debug build do on a fatal error? Also, can we be sure that Python does not call C library functions that write to stderr behind the scenes? If vanilla Python is safe to run with closed fd 2, that may not be the case for 3rd party extensions. What is the use case for "python >&-"? Is it important enough to justify the risk of accidental data loss? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7111> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com