Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit353f8d2

Browse files
authored
[2.7]bpo-36807: When saving a file in IDLE, call flush and fsync (GH-13102) (GH-13293)
1 parent7346a16 commit353f8d2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

‎Lib/idlelib/IOBinding.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ def writefile(self, filename):
383383
try:
384384
withopen(filename,"wb")asf:
385385
f.write(chars)
386+
f.flush()
387+
os.fsync(f.fileno())
386388
returnTrue
387389
exceptIOErrorasmsg:
388390
tkMessageBox.showerror("I/O Error",str(msg),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
When saving a file, call os.fsync() so bits are flushed to e.g. USB drive.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp