Message91663
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. |
|
Date |
User |
Action |
Args |
2009-08-17 13:09:33 | rtucker | set | recipients:
+ rtucker, kevinwatters, rmore |
2009-08-17 13:09:33 | rtucker | set | messageid: <1250514573.0.0.55263907954.issue5949@psf.upfronthosting.co.za> |
2009-08-17 13:09:30 | rtucker | link | issue5949 messages |
2009-08-17 13:09:29 | rtucker | create | |
|