When the `base_url` is a `[]` protected IPv6 address, the
`_clean_link()` function converts `[` to `%5B` and `]` to `%5D`, which
renders the `base_url` invalid. For example:
```
Starting new HTTP connection (1): fd00:0:0:236::100:8181
http://fd00:0:0:236::100:8181 "GET /os-releases/19.0.0.0b1/opensuse_leap-42.3-x86_64/requirements_absolute_requirements.txt HTTP/1.1" 200 None
Setting setuptools==40.6.3 (from -c http://[fd00:0:0:236::100]:8181/os-releases/19.0.0.0b1/opensuse_leap-42.3-x86_64/requirements_absolute_requirements.txt (line 204)) extras to: ()
Looking in indexes: http://[fd00:0:0:236::100]:8181/simple
Collecting setuptools==40.6.3 (from -c http://[fd00:0:0:236::100]:8181/os-releases/19.0.0.0b1/opensuse_leap-42.3-x86_64/requirements_absolute_requirements.txt (line 204))
1 location(s) to search for versions of setuptools:
* http://[fd00:0:0:236::100]:8181/simple/setuptools/
Getting page http://[fd00:0:0:236::100]:8181/simple/setuptools/
http://fd00:0:0:236::100:8181 "GET /simple/setuptools/ HTTP/1.1" 200 376
Analyzing links from page http://[fd00:0:0:236::100]:8181/simple/setuptools/
_package_versions: link = http://%5bfd00:0:0:236::100%5d:8181/packages/opensuse_leap-42.3-x86_64/setuptools/setuptools-40.6.3-py2.py3-none-any.whl#md5=389d3cd088d7afec3a1133b1d8e15df0 (from http://[fd00:0:0:
236::100]:8181/simple/setuptools/)
_link_package_versions: link = http://%5bfd00:0:0:236::100%5d:8181/packages/opensuse_leap-42.3-x86_64/setuptools/setuptools-40.6.3-py2.py3-none-any.whl#md5=389d3cd088d7afec3a1133b1d8e15df0 (from http://[fd00
:0:0:236::100]:8181/simple/setuptools/)
Found link http://%5bfd00:0:0:236::100%5d:8181/packages/opensuse_leap-42.3-x86_64/setuptools/setuptools-40.6.3-py2.py3-none-any.whl#md5=389d3cd088d7afec3a1133b1d8e15df0 (from http://[fd00:0:0:236::100]:8181/
simple/setuptools/), version: 40.6.3
Using version 40.6.3 (newest of versions: 40.6.3)
Could not install packages due to an EnvironmentError.
InvalidURL: Failed to parse: %5bfd00:0:0:236::100%5d:8181
```
This change uses the vendored `urllib` library to split the host part
off of the url before URL quoting only the path part.
Fixes: pypa#6285
Signed-off-by: Nicolas Bock <[email protected]>