* Fix encoding when reading README file in setup.py.
(egor <egor@sourced.tech>, #668)
+ * Preserve port and username in parsed HTTP URLs.
+ (Jelmer Vernooij)
+
0.19.7 2018-11-05
CHANGES
username = parsedurl.username
if username is not None:
kwargs['username'] = urlunquote(username)
- # TODO(jelmer): This also strips the username
- parsedurl = parsedurl._replace(netloc=parsedurl.hostname)
+ netloc = parsedurl.hostname
+ if parsedurl.port:
+ netloc = "%s:%s" % (netloc, parsedurl.port)
+ if parsedurl.username:
+ netloc = "%s@%s" % (parsedurl.username, netloc)
+ parsedurl = parsedurl._replace(netloc=netloc)
return cls(urlparse.urlunparse(parsedurl), **kwargs)
def __repr__(self):
url = 'https://github.com/jelmer/dulwich'
c, path = get_transport_and_path_from_url(url)
self.assertTrue(isinstance(c, HttpGitClient))
+ self.assertEqual('https://github.com', c.get_url(b'/'))
+ self.assertEqual('/jelmer/dulwich', path)
+
+ def test_http_port(self):
+ url = 'https://github.com:9090/jelmer/dulwich'
+ c, path = get_transport_and_path_from_url(url)
+ self.assertEqual('https://github.com:9090', c.get_url(b'/'))
+ self.assertTrue(isinstance(c, HttpGitClient))
self.assertEqual('/jelmer/dulwich', path)
def test_file(self):