mirror of https://github.com/python/cpython
bpo-36807: When saving a file in IDLE, call flush and fsync (#13102)
This commit is contained in:
parent
3e2afd78ba
commit
4f098b35f5
|
@ -384,6 +384,8 @@ class IOBinding:
|
|||
try:
|
||||
with open(filename, "wb") as f:
|
||||
f.write(chars)
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
return True
|
||||
except OSError as msg:
|
||||
tkMessageBox.showerror("I/O Error", str(msg),
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
When saving a file, call os.flush() so bits are flushed to e.g. USB drive.
|
Loading…
Reference in New Issue