py2exe socket.gaierror (10093)

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Mar 26 12:29:55 EDT 2008


En Wed, 26 Mar 2008 11:17:15 -0300, Python Programming on Win32  
<knut.urbye at gmail.com> escribió:

> The problem is running smtplib in a py2exe compiled exe file. When it
> tries to establish a socket to the mail server it fails.
>
> Just wondering someone has encountered this before, and if someone
> might be able to point me in the right direction.
>
> Unhandled exception in thread started by
> Traceback (most recent call last):
>   File "AutomationThread.pyc", line 152, in Run
>   File "mail.pyc", line 11, in sendMail
>   File "smtplib.pyc", line 244, in __init__
>   File "smtplib.pyc", line 296, in connect
> socket.gaierror: (10093, 'getaddrinfo failed')

The script can't resolve the server name. Try to do it by hand using  
nslookup or even ping (you may want to add a few print statements inside  
the script to see the exact host name it is trying to connect to, in case  
it isn't what you expect)
If you can't resolve the host name using nslookup, there is a network  
problem, not in your script. If you can resolve it, try your script  
without py2exe if possible.

-- 
Gabriel Genellina




More information about the Python-list mailing list