[Python-Dev] Ext4 data loss

A.M. Kuchling amk at amk.ca
Tue Mar 10 23:09:15 CET 2009


On Tue, Mar 10, 2009 at 09:11:38PM +0100, Christian Heimes wrote:
> Python's file type doesn't use fsync() and be the victim of the very
> same issue, too. Should we do anything about it?

The mailbox module tries to be careful and always fsync() before
closing files, because mail messages are pretty important.  The
various *dbm modules mostly have .sync() method.  

dumbdbm.py doesn't call fsync(), AFAICT; _commit() writes stuff and
closes the file, but doesn't call fsync().

sqlite3 doesn't have a sync() or flush() call.  Does SQLite handle
this itself?

The tarfile, zipfile, and gzip/bzip2 classes don't seem to use fsync()
at all, either implicitly or by having methods for calling them.
Should they?  What about cookielib.CookieJar?

--amk


More information about the Python-Dev mailing list