Assertion failures

ael law_ence.dev at ntlworld.com
Wed Mar 5 14:33:25 GMT 2014


In the last few days, I have seen offlineimap failing in odd ways.

I am running  version 6.5.5 under debian testing.

One Assertion which sometimes  fails is in
/usr/local/lib/python2.7/dist-packages/offlineimap/folder/LocalStatus.py

In the  cachemessagelist method we have

file = open(self.filename, "rt")
        self.messagelist = {}
        line = file.readline().strip()
        if not line:
            # The status file is empty - should not have happened,
            # but somehow did.
            errstr = "Cache file '%s' is empty. Closing..." % self.filename
            self.ui.warn(errstr)
            file.close()
            return
        print("line =", line, "magic=", magicline)   <== debug print
        assert(line == magicline)              <=======
        for line in file.xreadlines():

Running with that extra print statement shows that most of the time
it is ok, but then it fails with what looks like a hex formatted string.
For example:

 Syncing [Gmail]/Spam: Gmail -> Maildir
('line =', 'OFFLINEIMAP LocalStatus CACHE DATA - DO NOT MODIFY - FORMAT 1', 'magic=', 'OFFLINEIMAP LocalStatus CACHE DATA - DO NOT MODIFY - FORMAT 1')
Folder INBOX [acc: ntlspam]:
 Syncing INBOX: Gmail -> Maildir
('line =', 'OFFLINEIMAP LocalStatus CACHE DATA - DO NOT MODIFY - FORMAT 1', 'magic=', 'OFFLINEIMAP LocalStatus CACHE DATA - DO NOT MODIFY - FORMAT 1')
Folder SentMail [acc: ntlspam]:
 Syncing SentMail: Gmail -> Maildir
('line =', 'OFFLINEIMAP LocalStatus CACHE DATA - DO NOT MODIFY - FORMAT 1', 'magic=', 'OFFLINEIMAP LocalStatus CACHE DATA - DO NOT MODIFY - FORMAT 1')
Folder Spam [acc: ntlspam]:
 Syncing Spam: Gmail -> Maildir
('line =', '\xd9\x80\x9e\x9c<%\x86=Q\xbf\xa2"\xe0\xd9y\xe55\xce\x9b\xd4>\x15I\xa4Sw}iu.\xec\xff\x15|\xac\\\x851\xcc$\x8fg\\bc\xe4A\xf7\x04\xa7an\x12\xa1\xbf\xc0\x03\x88\x85\xa0qeSBuf\x87bI\xae\xb4\xf7\x0f+\x9ay\xd1V\xba\x0c\x19\x83\x16\x19\x9cT\xe3n\x13\xca\xc4\xa5\x82\x90\xd7Q\xc2\xc1', 'magic=', 'OFFLINEIMAP LocalStatus CACHE DATA - DO NOT MODIFY - FORMAT 1')

--------------------------------------------------------------------

I have noticed other similar errors. I have python 2.7.6 installed.
I think that python was recently upgraded in debian testing.

Has some default format changed recently in python which might explain
this?

ael





More information about the OfflineIMAP-project mailing list