[2.7] bpo-36807: When saving a file in IDLE, call flush and fsync (GH-13102) (GH-13293)
This commit is contained in:
parent
7346a16ed5
commit
353f8d2282
|
@ -383,6 +383,8 @@ class IOBinding:
|
||||||
try:
|
try:
|
||||||
with open(filename, "wb") as f:
|
with open(filename, "wb") as f:
|
||||||
f.write(chars)
|
f.write(chars)
|
||||||
|
f.flush()
|
||||||
|
os.fsync(f.fileno())
|
||||||
return True
|
return True
|
||||||
except IOError as msg:
|
except IOError as msg:
|
||||||
tkMessageBox.showerror("I/O Error", str(msg),
|
tkMessageBox.showerror("I/O Error", str(msg),
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
When saving a file, call os.fsync() so bits are flushed to e.g. USB drive.
|
Loading…
Reference in New Issue