
report at bugs
Oct 29, 2009, 11:26 PM
Post #3 of 6
(341 views)
Permalink
|
|
[issue7240] subprocess.Popen.stdout.flush fails os OS-X 10.6.1
[In reply to]
|
|
Ned Deily <nad [at] acm> 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 <report [at] bugs> <http://bugs.python.org/issue7240> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|