Ned Deily <n...@acm.org> added the comment: Philip is correct:
>>> p.stdout.flush() Traceback (most recent call last): File "<stdin>", line 1, in <module> IOError: [Errno 9] Bad file descriptor >>> p.stdout <open file '<fdopen>', mode 'rb' at 0x100527470> You'll get the same error on OS X (at least as far back as Python 2.3.5 on OS X 10.4) if you try to flush a disk read-only file: >>> f = open('a.txt', 'rb') >>> f.flush() Traceback (most recent call last): File "<stdin>", line 1, in ? IOError: [Errno 9] Bad file descriptor Note, both the OS X and Linux 2.6 fflush(3) man pages clearly state that EBADF can be returned if the stream is not open for writing but there seems to be a difference in behavior between the two OS's. As this doesn't seem to be a new issue and can easily be avoided (don't flush a read-only file), I suggest closing the issue. ---------- assignee: -> ronaldoussoren components: +Macintosh nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7240> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com