athoune/imapidle — pull request #3 by bkg (2013-08-28 08:04:08+00:00)
Title: Handle empty server response when logged off due to inactivity

I am seeing an error when idling on a gmail inbox and the server logs the user out after a period of time. From a close look at the IDLE spec, this is legitimate behavior. Specifically, the stack trace is:

Traceback (most recent call last):
File "imapidle/src/imapidle.py", line 64, in
for uid, msg in mbox.idle():
File "imapidle/src/imapidle.py", line 21, in idle
uid, message = resp[2:-2].split(' ')
ValueError: need more than 1 value to unpack

This change adds error handling for the above case. I have been able to idle on a gmail account for multiple days now.

BTW, thanks for this, it has proven to be very useful!