This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rtucker
Recipients kevinwatters, rmore, rtucker
Date 2009-08-17.13:09:29
SpamBayes Score 1.2764237e-08
Marked as misclassified No
Message-id <1250514573.0.0.55263907954.issue5949@psf.upfronthosting.co.za>
In-reply-to
Content
I can reproduce this problem with Python 2.6.  It manifests itself as a
lengthy iteration through an IMAP SSL mailbox locking up after a long
while and the interpreter consuming all available system memory.

I suspect this to be the combination of doom:

imaplib.py:
   1166         def readline(self):
   1167             """Read line from remote."""
   1168             line = []
   1169             while 1:
   1170                 char = self.sslobj.read(1)
   1171                 line.append(char)
   1172                 if char == "\n": return ''.join(line)

ssl.py:
    130     def read(self, len=1024):
    131 
    132         """Read up to LEN bytes and return them.
    133         Return zero-length string on EOF."""
    134 
    135         try:
    136             return self._sslobj.read(len)
    137         except SSLError, x:
    138             if x.args[0] == SSL_ERROR_EOF and
self.suppress_ragged_eofs:
    139                 return ''
    140             else:
    141                 raise

After setting suppress_ragged_eofs=False, I now get:

ssl.SSLError: [Errno 8] _ssl.c:1325: EOF occurred in violation of protocol

... instead of an explosion.  This I can trap and handle much more
easily than an infinite loop appending '' to a list on each iteration :-)

I can reliably reproduce this against my gmail mailbox, although it does
take some number of hours.  I am not sure if this would be an imaplib
bug or a ssl bug; I'd think ssl, because it is Not the Python Way to
bury an exception like this.
History
Date User Action Args
2009-08-17 13:09:33rtuckersetrecipients: + rtucker, kevinwatters, rmore
2009-08-17 13:09:33rtuckersetmessageid: <1250514573.0.0.55263907954.issue5949@psf.upfronthosting.co.za>
2009-08-17 13:09:30rtuckerlinkissue5949 messages
2009-08-17 13:09:29rtuckercreate