Terry J. Reedy <[email protected]> added the comment:
The io doc says for IOBase flush()
Flush the write buffers of the stream if applicable. This does nothing for
read-only and non-blocking streams.
and for BufferedWriter flush()
Force bytes held in the buffer into the raw stream. A BlockingIOError
should be raised if the raw stream blocks.
On 3.x, open(filename, "wb"), used in writefile(), returns a BufferedWriter.
So it seems than an exception is possible, which would crash IDLE without
try-except.
Serhiy, please read the previous message(s). Do you remember if you intended
to remove the f.flush in writefile(), which Guido proposes to restore?
----------
nosy: +serhiy.storchaka
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36807>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com