Jesse Noller <jnol...@gmail.com> added the comment: On Fri, Jun 19, 2009 at 11:55 AM, OG7<rep...@bugs.python.org> wrote: > > OG7 <ony...@users.sourceforge.net> added the comment: > > One shouldn't close the fileno after the file has been closed. The > stdlib raises an error, and the open(os.devnull) won't be reached. If no > error was thrown, it would be worse. This would be closing a fileno that > doesn't belong to sys.stdin anymore and may be used somewhere else. > > The open(os.devnull) bit is both so that no one tries to do anything > with the old stdin anymore, and to let applications attempt to read from > stdin without an IOError.
Fair enough, I was worried a bit about skipping the os.close(sys.stdin.fileno()) - the tests pass with both (because the close fixes the basic problem). I need to come up with an appropriate documentation note about the double flush issue, add in the tests I gleaned from the other bugs and commit it. I'll post the full doc/tests/code patch before doing so. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5313> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com