Message24383
Logged In: YES
user_id=1131890
Same problem here with Python 2.4 (#1, Jan 13 2005,
20:34:41) on SuSE Linux 9.2 (i586) and imaplib. Here is a
minimal piece of code that fails (substitute a valid IMAP
server accepting SSL connections):
=== start code snippet ===
import imaplib, socket
socket.setdefaulttimeout(10.0)
imaplib.IMAP4_SSL("imap.whatever.invalid")
=== end code snippet ===
This fails with the following traceback:
=== start traceback ===
Traceback (most recent call last):
File "./imap_bug.py", line 3, in ?
imaplib.IMAP4_SSL("imap.whatever.invalid")
File "/usr/local/lib/python2.4/imaplib.py", line 1101, in
__init__
IMAP4.__init__(self, host, port)
File "/usr/local/lib/python2.4/imaplib.py", line 181, in
__init__
self.welcome = self._get_response()
File "/usr/local/lib/python2.4/imaplib.py", line 876, in
_get_response
resp = self._get_line()
File "/usr/local/lib/python2.4/imaplib.py", line 969, in
_get_line
line = self.readline()
File "/usr/local/lib/python2.4/imaplib.py", line 1135, in
readline
char = self.sslobj.read(1)
socket.sslerror: The read operation timed out
=== end traceback ===
Remove the socket.setdefaulttimeout call and it works properly.
The problem is not due to a slow network connection or
overloaded server -- the script fails for all kinds of
timeouts (1, 10, 100 seconds), but without a timeout the
response is near-instantaneous. |
|
Date |
User |
Action |
Args |
2007-08-23 14:29:43 | admin | link | issue1153016 messages |
2007-08-23 14:29:43 | admin | create | |
|