Ticket #49 (closed defect: fixed)

Opened 4 months ago

Last modified 5 days ago

Work around imaplib SSL bug

Reported by: menno Owned by: menno
Priority: major Milestone: 0.6.1
Version: Keywords:
Cc:

Description

Details from Mark:

In short, there is a bug in imaplib when dealing with ssl connections
which terminate early - the SSL readline() method in imaplib gets into
a loop reading empty strings from the socket and appending them to a
list, chewing lots of memory and causing some consternation :)

The bug seems to be  http://bugs.python.org/issue5949 and it has been
fixed in various versions, although I hit it in 2.6.3.

It was fixed in 2.6 in:
 http://svn.python.org/view/python/branches/release26-maint/Lib/imaplib.py?r1=76761&r2=76760&pathrev=76761

But note that it has not been back-ported to 2.5 or earlier.

The bug report above includes a patch to imaplib's readline. It should
be possible to monkeypatch in the fixed version if a buggy imaplib
version is detected.

Change History

Changed 8 weeks ago by menno

  • owner set to menno
  • status changed from new to accepted

I have a working test case for this and have confirmed that just patching readline is sufficient to workaround the problem.

The problem was fixed in 2.6.5 rc2 and 2.7 alpha 2.
It hasn't been fixed in the 2.5 series or earlier.

Need to test that the patched readline works in all versions of Python.

Changed 5 days ago by menno

  • status changed from accepted to closed
  • resolution set to fixed

Fixed in r164

Note: See TracTickets for help on using tickets.