Results 1 to 3 of 3

Thread: Python FTP issues

  1. #1
    Join Date
    Sep 2011
    Location
    South Africa
    Beans
    165
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Python FTP issues

    Hi All

    I've been playing around with PyQt lately and I wanted to use it and the module ftplib for something cool. I've been having issues with the ftplib module, I do not know why it's not working and google isn't helping

    The simplest code for instance
    Code:
    from ftplib import FTP
    f = FTP("ftp://ftp.leg.uct.ac.za/pub/")
    print(f.getwelcome())
    throws the following error

    Code:
      File "test.py", line 2, in <module>
        f = FTP("ftp://ftp.leg.uct.ac.za/pub/")
      File "/usr/lib/python3.2/ftplib.py", line 113, in __init__
        self.connect(host)
      File "/usr/lib/python3.2/ftplib.py", line 142, in connect
        self.sock = socket.create_connection((self.host, self.port), self.timeout)
      File "/usr/lib/python3.2/socket.py", line 386, in create_connection
        for res in getaddrinfo(host, port, 0, SOCK_STREAM):
    socket.gaierror: [Errno -2] Name or service not known
    What does this mean? Please help

    Regards
    3v3rgr33n

  2. #2
    Join Date
    Feb 2009
    Beans
    1,469

    Re: Python FTP issues

    Don't you think ftp:// is a little redundant? I tried without it and was able to connect to another server.

  3. #3
    Join Date
    Sep 2011
    Location
    South Africa
    Beans
    165
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Python FTP issues

    Lol Thanx, guess I was just being stupid. I removed it and it worked.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •