FAQ
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

Search Discussions

  • Sean DiZazzo at Oct 18, 2009 at 5:19 am

    On Oct 16, 4:51?pm, Sean DiZazzo 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??
  • Shantanu Joshi at Oct 20, 2009 at 4:52 am

    Sean DiZazzo <half.italian at gmail.com> writes:
    On Oct 16, 4:51?pm, Sean DiZazzo 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).
  • Tim Roberts at Oct 20, 2009 at 5:23 am

    Sean DiZazzo 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, timr at probo.com
    Providenza & Boekelheide, Inc.
  • Sean DiZazzo at Oct 20, 2009 at 6:20 pm

    On Oct 19, 10:23?pm, Tim Roberts wrote:
    Sean DiZazzo 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, t... at probo.com
    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
  • Sean DiZazzo at Oct 20, 2009 at 7:04 pm

    On Oct 19, 10:23?pm, Tim Roberts wrote:
    Sean DiZazzo 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, t... at probo.com
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 16, '09 at 11:51p
activeOct 20, '09 at 7:04p
posts6
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase