Fixed a crasher with "quickchanged" in next

Sebastian Spaeth Sebastian at
Sat Apr 21 12:39:33 BST 2012

FYI, I just pushed commit 61e754c65ef08c85aa160b407d21475174c56262
to the next branch. If a select() would throw an Error while doing the
"quick" check on an IMAP server, we would try to free the same IMAP
connection twice, leading to a weird crash:

File "offlineimap/folder/", line 97, in quickchanged
File "offlineimap/", line 118, in releaseconnection
ValueError: list.remove(x): x not in list


commit 61e754c65ef08c85aa160b407d21475174c56262
    Do not try to release IMAP connection twice
    Reported by sharat87 in,
    he would often get an unhandled Exception when trying to
    releaseconnection() a connection that was not in the pool of
    The reason this could happen is that when folder.IMAP.quickchanged()
    raises an Exception in select(), we would release the connection in the
    "except" handling, and than release the same connection in the "finally"
    clause, which led to the error. The right thing is to only release the
    connection once, of course.
    Signed-off-by: Sebastian Spaeth <Sebastian at>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <>

More information about the OfflineIMAP-project mailing list