summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2019-05-13 12:31:30 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2019-05-13 12:31:29 (GMT)
commit4f098b35f58e911639f8e9adc393d5cf5c792e7f (patch)
treeeceb54f108b316a44ca807988ce8bd730a956773 /Lib/idlelib
parent3e2afd78babe5bd270e7f3b9df8796eeabc79865 (diff)
downloadcpython-4f098b35f58e911639f8e9adc393d5cf5c792e7f.zip
cpython-4f098b35f58e911639f8e9adc393d5cf5c792e7f.tar.gz
cpython-4f098b35f58e911639f8e9adc393d5cf5c792e7f.tar.bz2
bpo-36807: When saving a file in IDLE, call flush and fsync (#13102)
Diffstat (limited to 'Lib/idlelib')
-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 f5bced5..b9e813b 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),