Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ftplib connection fails with multiple nics

Reply
Thread Tools

ftplib connection fails with multiple nics

 
 
Sean DiZazzo
Guest
Posts: n/a
 
      10-16-2009
Hi all,

I'm trying to connect to an ftp site from a windows machine with two
nics going to two different networks, but I keep getting the below
exception:

Traceback (most recent call last):
File "ftp.pyo", line 70, in connect
File "ftp.pyo", line 17, in __init__
File "ftplib.pyo", line 131, in connect
File "socket.pyo", line 498, in create_connection
gaierror: [Errno 10093] getaddrinfo failed

I think it is because of the two nics, because the code runs fine on
other machines. Any ideas on how to fix this?

TIA.

~Sean
 
Reply With Quote
 
 
 
 
Sean DiZazzo
Guest
Posts: n/a
 
      10-18-2009
On Oct 16, 4:51*pm, Sean DiZazzo <(E-Mail Removed)> wrote:
> Hi all,
>
> I'm trying to connect to an ftp site from a windows machine with two
> nics going to two different networks, but I keep getting the below
> exception:
>
> Traceback (most recent call last):
> * File "ftp.pyo", line 70, in connect
> * File "ftp.pyo", line 17, in __init__
> * File "ftplib.pyo", line 131, in connect
> * File "socket.pyo", line 498, in create_connection
> gaierror: [Errno 10093] getaddrinfo failed
>
> I think it is because of the two nics, because the code runs fine on
> other machines. *Any ideas on how to fix this?
>
> TIA.
>
> ~Sean


What does socket.getaddrinfo() rely on??
 
Reply With Quote
 
 
 
 
Shantanu Joshi
Guest
Posts: n/a
 
      10-20-2009
Sean DiZazzo <(E-Mail Removed)> writes:

> On Oct 16, 4:51*pm, Sean DiZazzo <(E-Mail Removed)> wrote:
>> Hi all,
>>
>> I'm trying to connect to an ftp site from a windows machine with two
>> nics going to two different networks, but I keep getting the below
>> exception:
>>
>> Traceback (most recent call last):
>> * File "ftp.pyo", line 70, in connect
>> * File "ftp.pyo", line 17, in __init__
>> * File "ftplib.pyo", line 131, in connect
>> * File "socket.pyo", line 498, in create_connection
>> gaierror: [Errno 10093] getaddrinfo failed
>>
>> I think it is because of the two nics, because the code runs fine on
>> other machines. *Any ideas on how to fix this?
>>
>> TIA.
>>
>> ~Sean

>
> What does socket.getaddrinfo() rely on??


First, check if you can ping the FTP server from your client machine.

getaddrinfo relies on either DNS, /etc/hosts, or NIS, depending on how your
system is configured (check the hosts entry in /etc/nsswitch.conf).
 
Reply With Quote
 
Sean DiZazzo
Guest
Posts: n/a
 
      10-20-2009
On Oct 19, 10:23*pm, Tim Roberts <(E-Mail Removed)> wrote:
> Sean DiZazzo <(E-Mail Removed)> wrote:
>
> >I'm trying to connect to an ftp site from a windows machine with two
> >nics going to two different networks, but I keep getting the below
> >exception:

>
> >Traceback (most recent call last):
> > *File "ftp.pyo", line 70, in connect
> > *File "ftp.pyo", line 17, in __init__
> > *File "ftplib.pyo", line 131, in connect
> > *File "socket.pyo", line 498, in create_connection
> >gaierror: [Errno 10093] getaddrinfo failed

>
> >I think it is because of the two nics, because the code runs fine on
> >other machines. *Any ideas on how to fix this?

>
> 10093 is WSANOTINITIALISED, implying that WSAStartup has not been called.
> Are you doing this in a thread? *Are these all the same version of the
> operating system?
> --
> Tim Roberts, (E-Mail Removed)
> Providenza & Boekelheide, Inc.


Yes. I'm running it a thread. It's tough to debug because the code
is wrapped up as an exe. ie. There is no local python install to test
with.

Can you elaborate on what WSANOTINITIALZED actually means? Where is
it called in the Python code? Inside socket.py? Can I force a
WSASTARTUP call in python code?

PS. Im on Windows. Thanks!

~Sean
 
Reply With Quote
 
Sean DiZazzo
Guest
Posts: n/a
 
      10-20-2009
On Oct 19, 10:23*pm, Tim Roberts <(E-Mail Removed)> wrote:
> Sean DiZazzo <(E-Mail Removed)> wrote:
>
> >I'm trying to connect to an ftp site from a windows machine with two
> >nics going to two different networks, but I keep getting the below
> >exception:

>
> >Traceback (most recent call last):
> > *File "ftp.pyo", line 70, in connect
> > *File "ftp.pyo", line 17, in __init__
> > *File "ftplib.pyo", line 131, in connect
> > *File "socket.pyo", line 498, in create_connection
> >gaierror: [Errno 10093] getaddrinfo failed

>
> >I think it is because of the two nics, because the code runs fine on
> >other machines. *Any ideas on how to fix this?

>
> 10093 is WSANOTINITIALISED, implying that WSAStartup has not been called.
> Are you doing this in a thread? *Are these all the same version of the
> operating system?
> --
> Tim Roberts, (E-Mail Removed)
> Providenza & Boekelheide, Inc.


The problem was that I was including "winsock.dll" and "ws2_32.dll" in
the py2exe package. Once I removed them, the application could
connect fine.

Thank you both for your suggestions and help.

~Sean
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ftplib: Software caused connection abort, how I solved it Mad Sweeney Python 0 06-12-2011 12:36 PM
ftplib: Software caused connection abort, how I solved it Mad Sweeney Python 0 06-12-2011 11:41 AM
Desktop w/ 3 NICs - Multiple VPN Connections - How to configure? mtangorre Computer Support 3 02-06-2008 09:11 AM
ftplib question (cannot open data connection) Laszlo Nagy Python 2 01-13-2008 10:29 AM
ftplib fails when directory name contains spaces Manu Python 1 05-27-2005 08:26 AM



Advertisments