Commit 353f8d22 authored by Terry Jan Reedy's avatar Terry Jan Reedy Committed by GitHub

[2.7] bpo-36807: When saving a file in IDLE, call flush and fsync (GH-13102) (GH-13293)

parent 7346a16e
......@@ -383,6 +383,8 @@ class IOBinding:
try:
with open(filename, "wb") as f:
f.write(chars)
f.flush()
os.fsync(f.fileno())
return True
except IOError as msg:
tkMessageBox.showerror("I/O Error", str(msg),
......
When saving a file, call os.fsync() so bits are flushed to e.g. USB drive.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment