From a48ef26b7203e34728c6e772890e2833cda03eac Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 12 Dec 2008 21:30:00 +0000 Subject: 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. (trunk r12192) svn path=/main/branches/2.1.6/; revision=12225 --- pym/portage/dbapi/bintree.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pym') 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) -- cgit v1.2.3-1-g7c22