[3.7] bpo-36807: When saving a file in IDLE, call flush and fsync (GH… · python/cpython@68a11b6 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit 68a11b6

miss-islingtonterryjreedy

authored and

committed

File tree

2 files changed

lines changed

2 files changed

lines changed

Lines changed: 2 additions & 0 deletions

Original file line number Diff line number Diff line change
@@ -384,6 +384,8 @@ def writefile(self, filename):
384 384 try:
385 385 with open(filename, "wb") as f:
386 386 f.write(chars)
387 +f.flush()
388 +os.fsync(f.fileno())
387 389 return True
388 390 except OSError as msg:
389 391 tkMessageBox.showerror("I/O Error", str(msg),

Lines changed: 1 addition & 0 deletions

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 +When saving a file, call os.fsync() so bits are flushed to e.g. USB drive.