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 David.Ward
Recipients David.Ward
Date 2011-07-17.11:39:38
SpamBayes Score 3.4345238e-09
Marked as misclassified No
Message-id <1310902779.89.0.705938348131.issue12578@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-07-17 11:39:39David.Wardsetrecipients: + David.Ward
2011-07-17 11:39:39David.Wardsetmessageid: <1310902779.89.0.705938348131.issue12578@psf.upfronthosting.co.za>
2011-07-17 11:39:39David.Wardlinkissue12578 messages
2011-07-17 11:39:38David.Wardcreate