Message140525
When migrating from python 2.7.1 to 2.7.2 (or 3.2) I get unpredictable /erratic exceptions thrown on constucting smtplib.SMTP:
socket.gaierror: [Errno 11004] getaddrinfo failed
Here is the call stack:
File "**********\mail.py", line 41, in Mail
server = smtplib.SMTP(MAILSERVER)
File "c:\python27\lib\smtplib.py", line 250, in __init__
(code, msg) = self.connect(host, port)
File "c:\python27\lib\smtplib.py", line 306, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "c:\python27\lib\smtplib.py", line 284, in _get_socket
return socket.create_connection((host, port), timeout)
File "c:\python27\lib\socket.py", line 380, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 11004] getaddrinfo failed
MAILSERVER is a local address. There are no known DNS issues on our local network.
If I try to reduce the code to a small repro (e.g. sending mail in a loop or calling getaddrinfo), I cannot reproduce the problem.
This code had worked unchanged for many years and many previous python releases all the way back to 2.3.
Platform is Windows 7 x64, AMD64 build of python 2.7.2 (or 3.2).
Reverting back to 2.7.1 solves the problem. |
|
Date |
User |
Action |
Args |
2011-07-17 11:39:39 | David.Ward | set | recipients:
+ David.Ward |
2011-07-17 11:39:39 | David.Ward | set | messageid: <1310902779.89.0.705938348131.issue12578@psf.upfronthosting.co.za> |
2011-07-17 11:39:39 | David.Ward | link | issue12578 messages |
2011-07-17 11:39:38 | David.Ward | create | |
|