nicolas33/offlineimap — pull request #7 by sharat87 (2012-01-13 14:47:56+00:00)
Title: Fix connection lock not being released in case of a harmless error.

First of all, I don't know when or how this occurs, but when it does, offlineimap does not sync mail any more.

I see the following stack trace printed over and over again (everytime it tries to sync mail)

ERROR: ERROR in syncfolder for sskcal folder drafts: Traceback (most recent call last):
File "/home/sharat/lawn/mail/offlineimap/offlineimap/accounts.py", line 362, in syncfolder
and not remotefolder.quickchanged(statusfolder):
File "/home/sharat/lawn/mail/offlineimap/offlineimap/folder/IMAP.py", line 97, in quickchanged
self.imapserver.releaseconnection(imapobj)
File "/home/sharat/lawn/mail/offlineimap/offlineimap/imapserver.py", line 118, in releaseconnection
self.assignedconnections.remove(connection)
ValueError: list.remove(x): x not in list

list.remove(x): x not in list

After going through the code in this part, I can tell that this is a harmless error, and if the exception were handled gracefully, I think offlineimap would continue syncing happily.

It is hard for me realise that offlineimap is not syncing my mail anymore, and then I find this and restart offlineimap and it syncs perfectly fine. Of course, you'll know better, if there is something I'm missing or there would be a better solution, please do so.

Thank you very much.