urlfetcher: Fix ftp URLs with ports in them

Reported-by: int-0 <tobias.deb@gmail.com>
This commit is contained in:
Cole Robinson 2016-03-24 16:15:21 -04:00
parent d3b9fcf3de
commit c92507baea
2 changed files with 5 additions and 4 deletions

View File

@ -53,11 +53,11 @@ OLD_OPENSUSE_URL = "http://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/%
OPENSUSE_URL = "http://download.opensuse.org/distribution/%s/repo/oss/"
OLD_UBUNTU_URL = "http://old-releases.ubuntu.com/ubuntu/dists/%s/main/installer-%s"
UBUNTU_URL = "http://us.archive.ubuntu.com/ubuntu/dists/%s/main/installer-%s"
UBUNTU_URL = "http://us.archive.ubuntu.com:80/ubuntu/dists/%s/main/installer-%s"
OLD_DEBIAN_URL = "http://archive.debian.org/debian/dists/%s/main/installer-%s/"
DAILY_DEBIAN_URL = "http://d-i.debian.org/daily-images/%s/"
DEBIAN_URL = "ftp://ftp.us.debian.org/debian/dists/%s/main/installer-%s/"
DEBIAN_URL = "ftp://ftp.us.debian.org:21/debian/dists/%s/main/installer-%s/"
MAGEIA_URL = "http://distro.ibiblio.org/mageia/distrib/%s/%s"

View File

@ -218,8 +218,9 @@ class _FTPURLFetcher(_URLFetcher):
return
try:
server = urlparse.urlparse(self.location)[1]
self._ftp = ftplib.FTP(server)
parsed = urlparse.urlparse(self.location)
self._ftp = ftplib.FTP()
self._ftp.connect(parsed.hostname, parsed.port)
self._ftp.login()
except Exception, e:
raise ValueError(_("Opening URL %s failed: %s.") %