diff --git a/offlineimap/head/debian/changelog b/offlineimap/head/debian/changelog index e14a1c8..cfc376c 100644 --- a/offlineimap/head/debian/changelog +++ b/offlineimap/head/debian/changelog @@ -5,6 +5,7 @@ offlineimap (3.99.2) unstable; urgency=low 50 debug messages, whether or not debugging was enabled for this session. This way, even unexpected and non-repeatable errors stand a chance of getting a more detailed log. + * Handle uidvalidity file in an atomic fashion. CLoses: #165600. -- John Goerzen Tue, 15 Oct 2002 12:35:42 -0500 diff --git a/offlineimap/head/offlineimap/folder/Maildir.py b/offlineimap/head/offlineimap/folder/Maildir.py index 29c0db1..c45d59e 100644 --- a/offlineimap/head/offlineimap/folder/Maildir.py +++ b/offlineimap/head/offlineimap/folder/Maildir.py @@ -62,9 +62,10 @@ class MaildirFolder(BaseFolder): return self.uidvalidity def saveuidvalidity(self, newval): - file = open(self.uidfilename, "wt") + file = open(self.uidfilename + ".tmp", "wt") file.write("%d\n" % newval) file.close() + os.rename(self.uidfilename + ".tmp", self.uidfilename) self.uidvalidity = newval def isuidvalidityok(self, remotefolder):