[issue36807] IDLE doesn't call os.fsync()

Serhiy Storchaka report at bugs.python.org
Mon May 6 04:06:40 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

f.flush() was removed because it is redundant if followed by f.close(). f.close() calls f.flush() internally. f.close() is now called implicitly in __exit__() when exit from the with statement.

Guido restores f.flush() because he needs to flush the buffer of the buffered stream before calling os.fsync(f.fileno()). And f.fileno() can be used only for not closed file. So this change looks reasonable to me.

I do not know what are the troubles with Adafruit's
Circuit Playground Express. I think that flushing the OS filesystem cache is the work of the OS itself, and lingering the data in the OS-wide cache should not affect userspace. But maybe there are specific circumstences, for example if IDLE and the consumer of Python source files are ran on different machines.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36807>
_______________________________________


More information about the Python-bugs-list mailing list