Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the URL quoting in _clean_link() for IPv6 addresses #6245

Merged
merged 1 commit into from
Apr 8, 2019

Commits on Apr 7, 2019

  1. Do not clean base_url

    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]>
    nicolasbock committed Apr 7, 2019
    Configuration menu
    Copy the full SHA
    913757c View commit details
    Browse the repository at this point in the history