Can't Ctrl+C abort offlineimap if -1 option given

Ethan Glasser-Camp glasse at
Thu Mar 24 10:18:19 GMT 2011

On 03/23/2011 11:06 AM, Sebastian Spaeth wrote:
> Could do that, but then it seems like imaplib2 is not shutting down
> their reader/writer threads properly when it receives a logout(). At
> least there is still some IMAP activity going on, even after a logout()
> finished. So that would require investigation in any case.

OK, so here's what I'm seeing about -1 and Ctrl-C.

1. Ctrl-C does NOT interrupt a folder sync.  This is in no way related 
to imaplib2 (exists in v6.3.2).  I think this is due to the wait on a 
semaphore in threadutil, since (as we've seen) you can choose no wakeups 
or to receive signals but you can't have both.  I haven't been able to 
fix this yet.

2. Ctrl-C AFTER the folder sync causes offlineimap to go into a hang.  I 
think this is fixed by the attached patch.  This ensures that 
holdordropconnections() is called, even in the "exceptional" case of 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Always-logout-on-imaplib2-objects-even-during-except.patch
Type: text/x-patch
Size: 958 bytes
Desc: not available
URL: <>

More information about the OfflineIMAP-project mailing list