[PATCH] Re: fix hang because of infinite loop reading EOF

Ethan Glasser-Camp glasse at cs.rpi.edu
Mon Mar 7 19:31:17 GMT 2011


On 03/07/2011 10:34 AM, Sebastian Spaeth wrote:
> Again, +1 for the patch. Although, in case we except the imaplib2 IDLE
> branch, our custom read() function would be completely deleted, because
> it is not used anymore, if I remember correctly.
>
> The imaplib2 code looks a bit scary to me, so I don't want to have to modify or
> understand it too much though :-).

Funny, I was just thinking the same thing about the SSL code :)

imaplib2 interacts directly with file descriptors and doesn't use either 
IMAP4.read() or IMAP4.readline(). imaplib2's threaded design means 
there's always a reader thread blocking on the connection, and in that 
thread, if read() gets an empty string five times in a row, it raises an 
exception. So I think this problem would be solved differently if we 
merged imaplib2.

Ethan





More information about the OfflineIMAP-project mailing list