From fbe0e22f981b5614e6bc624a124925e56e88b8f0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 10 Dec 2008 03:37:03 +0000 Subject: [PATCH] urlparse.urljoin() only works correctly with recognized protocols and requires the base url to have a trailing slash, so join PORTAGE_BINHOST manually. Thanks to Lance Albertson for reporting. svn path=/main/trunk/; revision=12192 --- pym/portage/dbapi/bintree.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 000624819..2b0ebd6f4 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -643,7 +643,10 @@ class binarytree(object): import urllib, urlparse rmt_idx = self._new_pkgindex() try: - f = urllib.urlopen(urlparse.urljoin(base_url, "Packages")) + # urlparse.urljoin() only works correctly with recognized + # protocols and requires the base url to have a trailing + # slash, so join manually... + f = urllib.urlopen(base_url.rstrip("/") + "/Packages") try: rmt_idx.readHeader(f) remote_timestamp = rmt_idx.header.get("TIMESTAMP", None) -- 2.26.2