From 260bbe545e15ea75782c540c421da6c0a67abfd5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 31 Jan 2019 20:46:48 -0500 Subject: Ensure a specified port in package_index isn't lost in the parse/unparse of the URL when auth is present. Fixes #1663. --- setuptools/package_index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools') diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 7e9517ce..ea76c005 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -1072,7 +1072,7 @@ def open_with_auth(url, opener=urllib.request.urlopen): if auth: auth = "Basic " + _encode_auth(auth) - parts = scheme, parsed.hostname, path, params, query, frag + parts = scheme, netloc, path, params, query, frag new_url = urllib.parse.urlunparse(parts) request = urllib.request.Request(new_url) request.add_header("Authorization", auth) -- cgit v1.2.3