urlfetcher: Fix ftp URLs with ports in them
Reported-by: int-0 <tobias.deb@gmail.com>
This commit is contained in:
parent
d3b9fcf3de
commit
c92507baea
|
@ -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"
|
||||
|
||||
|
|
|
@ -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.") %
|
||||
|
|
Loading…
Reference in New Issue