Serhiy Storchaka <storchaka+cpyt...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue36807>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to