From 4fb833176e9af7eaba801fdad14c3f3f174c4316 Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Fri, 15 Jan 2010 23:03:32 +0100 Subject: [PATCH] When creating a dotlock, register it slightly earlier for cleanup This closes a very unlikely window where we could create a dotlock file, but then encounter an error and fail to clean up the dotlock. --- archivemail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivemail.py b/archivemail.py index 6658746..4adf6b1 100755 --- a/archivemail.py +++ b/archivemail.py @@ -398,11 +398,11 @@ class LockableMboxMixin: raise LockUnavailable("Dotlock for '%s' unavailable" % self.mbox_file_name) else: raise + _stale.dotlock_files.append(lock_name) finally: os.close(plfd) os.unlink(prelock_name) vprint("acquired lockfile '%s'" % lock_name) - _stale.dotlock_files.append(lock_name) def _dotlock_unlock(self): """Delete the dotlock file for the 'mbox' mailbox."""