[Imaplib2-devel] Gmail: downloading the rest of the mails
sebastian at sspaeth.de
Thu Oct 13 07:16:02 BST 2011
On Mon, 10 Oct 2011 22:11:32 +1100, Piers Lauder <piers at janeelix.com> wrote:
> You could try tinkering with the code around the "read 0" message. Try
> making the loopcount longer, and see if that avoids the problem. At
> the moment it tries 5 times, with a 0.1 sec sleep after each read 0,
> which is 1/2 second. I guess its interesting that the read doesn't
> raise an exception for broken socket, so it might be worthwhile hanging
> around longer.
> Is this by any chance an SSL socket? If so it maybe the SSL code that
> isn't handling the socket disconnection properly, though that does
> seem unlikely.
> Anyway, I still think a "read 0" should mean EOF, so that restarting a new
> connection is the correct response.
Yes, as these are all gmail connections, they are all SSL sockets.
It could well be that gmail simply delays sending for some time, so
imaplib2 trips over the 5*0.1 sec limit. Killing the connection and
re-establishing will of course work, unless gmail considers that abusive
and locks us out.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: not available
More information about the OfflineIMAP-project