Message 341490 - Python tracker (original) (raw)
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?