]> code.delx.au - offlineimap/blobdiff - offlineimap/folder/LocalStatus.py
Ignore empty LocalStatus files
[offlineimap] / offlineimap / folder / LocalStatus.py
index bace7df9e8b77881c8c50273828c9fcc9ce50bac..8ba5bb88c3f8cea9c92a9b7901eef4614a5e26da 100644 (file)
@@ -1,5 +1,5 @@
 # Local status cache virtual folder
-# Copyright (C) 2002 - 2007 John Goerzen
+# Copyright (C) 2002 - 2008 John Goerzen
 # <jgoerzen@complete.org>
 #
 #    This program is free software; you can redistribute it and/or modify
@@ -67,6 +67,11 @@ class LocalStatusFolder(BaseFolder):
         file = open(self.filename, "rt")
         self.messagelist = {}
         line = file.readline().strip()
+        if not line and not line.read()
+            # The status file is empty - should not have happened,
+            # but somehow did.
+            file.close()
+            return
         assert(line == magicline)
         for line in file.xreadlines():
             line = line.strip()