From 4ccad7554b958c701653c41a72442cccf301e71a Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Wed, 29 Apr 2015 10:45:37 -0700 Subject: [PATCH] Fix substitution err for schemeless manifest urls Previously, we used a regex that would only remove a phony string from a url if it existed, but we recently replaced that with a slice. This change goes back to the previous behavior. Change-Id: I8baf527be01c4b49d45b903b31a1cd6315563d5b --- manifest_xml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest_xml.py b/manifest_xml.py index 8b57bf52..cfbd9efa 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -90,7 +90,8 @@ class _XmlRemote(object): # and then replacing it with the original when we are done. if manifestUrl.find(':') != manifestUrl.find('/') - 1: - url = urllib.parse.urljoin('gopher://' + manifestUrl, url)[9:] + url = urllib.parse.urljoin('gopher://' + manifestUrl, url) + url = re.sub(r'^gopher://', '', url) else: url = urllib.parse.urljoin(manifestUrl, url) return url