Bug 3.11.x behavioral, open file buffers not flushed til file closed.

aapost aapost at idontexist.club
Sun Mar 5 10:38:41 EST 2023


On 3/5/23 09:35, aapost wrote:
> 

Guess it could just be an annoying gotcha thing on me.

calling at least

f.flush()

in any cases where an explicit close is delayed would be the solution.

Additionally (not sure if this still applies):
flush() does not necessarily write the file’s data to disk. Use flush() 
followed by os.fsync() to ensure this behavior.


More information about the Python-list mailing list