problem with ftplib

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahultandon
    New Member
    • Feb 2008
    • 1

    problem with ftplib

    hi all,
    im trying to create an ftp connection to some ftp site
    using the followin code..but i always get an error in this line :

    import ftplib
    ftp =ftplib.FTP("ft p.cwi.nl")
    ....
    ...
    this is the error i get..:
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "H:\ActivePytho n\lib\ftplib.py ", line 107, in __init__
    self.connect(ho st)
    File "H:\ActivePytho n\lib\ftplib.py ", line 117, in connect
    for res in socket.getaddri nfo(self.host, self.port, 0, socket.SOCK_STR EAM):
    socket.gaierror : (11001, 'getaddrinfo failed')


    could some1 plz explain wht this means...why m i unable to ccnnect to it or any ftp site for that matter.

    all these sites open thru the web browser though...
    Also,
    i am able to connect to the internal ftp server created in my netwrok..
    with the same syntax, just the name of the my interenal ftp..
    PLZZ HELP...
  • jlm699
    Contributor
    • Jul 2007
    • 314

    #2
    That sounds like a DNS problem... which is particularly strange since your webbrowser can connect to that same site.

    I tried literally that exact code:
    [CODE=python]
    >>> import ftplib
    >>> ftp = ftplib.FTP("ftp .cwi.nl")
    >>> ftp.close()
    >>> ftp.connect("ft p.cwi.nl")
    '220-\n220-*************** *************** *************** *************** ***********\n22 0-* Welcome to FTP.CWI.NL *\n220-*************** *************** *************** *************** ***********\n22 0-* *\n220-* Unauthorized access prohibited and forbidden. *\n220-* All actions are logged, by continuing you agree to this policy. *\n220-* Violations will be reported to the authorities. *\n220-* *\n220-*************** *************** *************** *************** ***********\n22 0-* *\n220-* Some information to help you use our ftp site: *\n220-* For information on the use of our /incoming directory *\n220-* read the incoming.readme file. *\n220-* *\n220-* Information here is placed here by our researchers, *\n220-* meaning it can be work related or something private. *\n220-* *\n220-* In any case, SMC/CWI takes NO responsability about the *\n220-* content or effects after use of material placed here. *\n220-* *\n220-* Contact for technical questions: ftpadmin@cwi.nl *\n220-* *\n220-*************** *************** *************** *************** ***********\n22 0-\n220 '
    >>>
    [/CODE]

    Comment

    Working...