473,320 Members | 2,024 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

py2exe socket.gaierror (10093)

Hi,

I have encountered a problem which I can not figure out a solution
to.
Tried Googeling it, but to no help unfortunately.

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')
Thank you !
Mar 26 '08 #1
6 2942
En Wed, 26 Mar 2008 11:17:15 -0300, Python Programming on Win32
<kn********@gmail.comescribió:
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

Mar 26 '08 #2
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
Thank you for the quick reply Gabriel.

I have made sure the script works fine before I exe it.
It is when I compile the program I get this error.

I don't get how the compile changes server availability.
Thanks again,
Knut
Mar 26 '08 #3
Knut schrieb:
>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

Thank you for the quick reply Gabriel.

I have made sure the script works fine before I exe it.
It is when I compile the program I get this error.

I don't get how the compile changes server availability.
Could it be a firewall issue?

Thomas

Mar 26 '08 #4
On 26 Mar, 23:08, Thomas Heller <thel...@ctypes.orgwrote:
Knut schrieb:
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
Thank you for the quick reply Gabriel.
I have made sure the script works fine before I exe it.
It is when I compile the program I get this error.
I don't get how the compile changes server availability.

Could it be a firewall issue?

Thomas
Hi Thomas,

Thanks for the tip!

Disabled the firewall to check if this could be the problem, but no
help there either..

The mail server is on the local network, but I have also tried
connecting to internal sockets to another program I have which sniffs
a port.
This works fine, until I run it as an exe..
My quest continues..
Mar 27 '08 #5
Python Programming on Win32 wrote:
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')
In case it helps, this is the text for error 10093:

"""
WSANOTINITIALISED
10093

Successful WSAStartup not yet performed.

Either the application has not called WSAStartup or WSAStartup
failed. The application may be accessing a socket that the current
active task does not own (that is, trying to share a socket between
tasks), or WSACleanup has been called too many times.
"""

WSAStartup is called by a process which wants to use winsock,
the Windows sockets implementation and it's called by Python's
socket module at startup. I can't see anything in py2exe's
source which should make any difference to socket initialisation
so I'm at a loss.

TJG
Mar 27 '08 #6
This is frustrating.

I was working on writing a sample for my problem. I start with
dissecting my code which still gives the same error. Then I start
thinking that it might be my setup file doing the damage. And i start
it from scratch. Everything suddenly works.

Fine! i think, i will have to start over with the setup file. Buy i
give the old setup a last go, and guess what. It works.
So I am honestly utterly frustrated.. I have no idea what what the
reason for the problem, but apparently it is solved, for now.
Thanks for all you comments and help. I really appreciate it!

K
Mar 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eric Brunel | last post by:
Hi all, I just compiled Python 2.3.2 on Linux Mandrake 8.0, upgrading from Python 2.1. I have one problem that I can't figure out: when I wanted to get "the" IP address of the current host with...
6
by: Krzysztof Ksi±¿ek | last post by:
Hi! As almost totally newbe, I have written a simple script and I'm proud of it ;-) It connects to ftp server and uploads some files. Kind of backup. I've compiled it with py2exe and put it in...
0
by: Jacob Lee | last post by:
I'm getting a rather bizarre error while using the socket module. If I start out disconnected from the net and then connect while the program or interpreter session is open, I do not always gain...
2
by: spamsink42 | last post by:
this code h=httplib.HTTPConnection('euronext.com') h.request('GET', 'http://www.euronext.com/home/0,3766,1732,00.html') fails with this message File "httplib.py", line 532, in connect...
8
by: Mark Fink | last post by:
I try to port a server application to Jython. At the moment I use Jython21\Lib\socket.py Currently I do face problems with casting the string "localhost" to the desired value:...
2
by: flamesrock | last post by:
Hi, Basically, I'm trying to send a multipart form to a server using some code from aspn.. here it is: MultipartPostHandler: http://pastie.caboo.se/29833 import MultipartPostHandler, urllib2,...
2
by: John Nagle | last post by:
Here's a strange little bug. "socket.getaddrinfo" blows up if given a bad domain name containing ".." in Unicode. The same string in ASCII produces the correct "gaierror" exception. Actually,...
10
by: John Nagle | last post by:
Here are three network-related exceptions. These were caught by "except" with no exception type, because none of the more specific exceptions matched. This is what a traceback produced: 1....
8
by: half.italian | last post by:
Hi all, I'm having trouble with the socket module resolving a hostname. It seems like this is a system level problem, but I'm not even sure where to start. I can ping the smtp server by name...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.