summaryrefslogtreecommitdiff
path: root/Lib/idlelib/iomenu.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2019-05-13 05:31:30 -0700
committerTerry Jan Reedy <tjreedy@udel.edu>2019-05-13 08:31:29 -0400
commit4f098b35f58e911639f8e9adc393d5cf5c792e7f (patch)
treeeceb54f108b316a44ca807988ce8bd730a956773 /Lib/idlelib/iomenu.py
parent3e2afd78babe5bd270e7f3b9df8796eeabc79865 (diff)
downloadcpython-git-4f098b35f58e911639f8e9adc393d5cf5c792e7f.tar.gz
bpo-36807: When saving a file in IDLE, call flush and fsync (#13102)
Diffstat (limited to 'Lib/idlelib/iomenu.py')
-rw-r--r--Lib/idlelib/iomenu.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py
index f5bced597a..b9e813be06 100644
--- a/Lib/idlelib/iomenu.py
+++ b/Lib/idlelib/iomenu.py
@@ -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),