#50 Fedora 31: Fix urllib3 CVEs
Closed 4 years ago by churchyard. Opened 4 years ago by churchyard.
rpms/ churchyard/python-pip f31-urllib3-cves  into  f31

file modified
+27 -2
@@ -23,7 +23,7 @@ 

  # When updating, update the bundled libraries versions bellow!

  # You can use vendor_meta.sh in the dist git repo

  Version:        19.1.1

- Release:        6%{?dist}

+ Release:        7%{?dist}

  Summary:        A tool for installing and managing Python packages

  

  # We bundle a lot of libraries with pip, which itself is under MIT license.
@@ -50,6 +50,7 @@ 

  # idna: BSD

  # urllib3: MIT

  # certifi: MPLv2.0

+ # rfc3986: ASL 2.0

  # setuptools: MIT

  # webencodings: BSD

  
@@ -109,6 +110,22 @@ 

  # https://github.com/pypa/pip/pull/6728

  Patch6:         python39.patch

  

+ 

+ # urllib3 backports

+ # CVE-2019-11324: Certification mishandle when error should be thrown

+ # This updates urllib3 to 1.24.2

+ # https://github.com/urllib3/urllib3/pull/1564

+ # https://bugzilla.redhat.com/show_bug.cgi?id=1774595

+ Patch101:       urllib3-1.24.2.patch

+ 

+ # CVE-2019-11236: CRLF injection due to not encoding the '\r\n' sequence

+ # leading to possible attack on internal service

+ # This bundles rfc3986 1.2.0

+ # https://github.com/urllib3/urllib3/pull/1487

+ # https://bugzilla.redhat.com/show_bug.cgi?id=1775363

+ Patch102:       urllib3-rfc3986.patch

+ 

+ 

  # Downstream only patch

  # Users might have local installations of pip from using

  # `pip install --user --upgrade pip` on older/newer versions.
@@ -160,7 +177,8 @@ 

  Provides: bundled(python%{1}dist(retrying)) = 1.3.3

  Provides: bundled(python%{1}dist(setuptools)) = 41.0.1

  Provides: bundled(python%{1}dist(six)) = 1.12.0

- Provides: bundled(python%{1}dist(urllib3)) = 1.24.1

+ Provides: bundled(python%{1}dist(urllib3)) = 1.24.2

+ Provides: bundled(python%{1}dist(rfc3986)) = 1.2.0

  Provides: bundled(python%{1}dist(webencodings)) = 0.5.1

  }

  
@@ -308,6 +326,9 @@ 

  %patch5 -p1

  %patch6 -p1

  

+ %patch101 -p1

+ %patch102 -p1

+ 

  # this goes together with patch4

  rm src/pip/_vendor/certifi/*.pem

  sed -i '/\.pem$/d' src/pip.egg-info/SOURCES.txt
@@ -529,6 +550,10 @@ 

  %endif

  

  %changelog

+ * Thu Jan 02 2020 Miro Hrončok <mhroncok@redhat.com> - 19.1.1-7

+ - Fix urllib3 CVE-2019-11324 (#1774595)

+ - Fix urllib3 CVE-2019-11236 (#1775363)

+ 

  * Mon Nov 25 2019 Miro Hrončok <mhroncok@redhat.com> - 19.1.1-6

  - Make python-pip-wheel work with Python 3.9

  

file added
+101
@@ -0,0 +1,101 @@ 

+ From 420420456f6367d051744ddcebcd548d251bbb3e Mon Sep 17 00:00:00 2001

+ From: Seth Michael Larson <sethmichaellarson@gmail.com>

+ Date: Wed, 17 Apr 2019 12:46:22 -0500

+ Subject: [PATCH] urllib3: Release 1.24.2 (#1564)

+ 

+ * Don't load system certificates by default when any other ``ca_certs``, ``ca_certs_dir`` or ``ssl_context`` parameters are specified.

+ * Remove Authorization header regardless of case when redirecting to cross-site. (Issue #1510)

+ * Add support for IPv6 addresses in subjectAltName section of certificates. (Issue #1269)

+ ---

+  src/pip/_vendor/urllib3/__init__.py          | 2 +-

+  src/pip/_vendor/urllib3/contrib/pyopenssl.py | 3 +++

+  src/pip/_vendor/urllib3/poolmanager.py       | 7 +++++--

+  src/pip/_vendor/urllib3/util/retry.py        | 3 ++-

+  src/pip/_vendor/urllib3/util/ssl_.py         | 5 ++++-

+  5 files changed, 15 insertions(+), 5 deletions(-)

+ 

+ diff --git a/src/pip/_vendor/urllib3/__init__.py b/src/pip/_vendor/urllib3/__init__.py

+ index 148a9c3..6191546 100644

+ --- a/src/pip/_vendor/urllib3/__init__.py

+ +++ b/src/pip/_vendor/urllib3/__init__.py

+ @@ -27,7 +27,7 @@ from logging import NullHandler

+  

+  __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'

+  __license__ = 'MIT'

+ -__version__ = '1.24.1'

+ +__version__ = '1.24.2'

+  

+  __all__ = (

+      'HTTPConnectionPool',

+ diff --git a/src/pip/_vendor/urllib3/contrib/pyopenssl.py b/src/pip/_vendor/urllib3/contrib/pyopenssl.py

+ index 363667c..fb05afa 100644

+ --- a/src/pip/_vendor/urllib3/contrib/pyopenssl.py

+ +++ b/src/pip/_vendor/urllib3/contrib/pyopenssl.py

+ @@ -184,6 +184,9 @@ def _dnsname_to_stdlib(name):

+          except idna.core.IDNAError:

+              return None

+  

+ +    if ':' in name:

+ +        return name

+ +

+      name = idna_encode(name)

+      if name is None:

+          return None

+ diff --git a/src/pip/_vendor/urllib3/poolmanager.py b/src/pip/_vendor/urllib3/poolmanager.py

+ index fe5491c..32bd973 100644

+ --- a/src/pip/_vendor/urllib3/poolmanager.py

+ +++ b/src/pip/_vendor/urllib3/poolmanager.py

+ @@ -7,6 +7,7 @@ from ._collections import RecentlyUsedContainer

+  from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool

+  from .connectionpool import port_by_scheme

+  from .exceptions import LocationValueError, MaxRetryError, ProxySchemeUnknown

+ +from .packages import six

+  from .packages.six.moves.urllib.parse import urljoin

+  from .request import RequestMethods

+  from .util.url import parse_url

+ @@ -342,8 +343,10 @@ class PoolManager(RequestMethods):

+          # conn.is_same_host() which may use socket.gethostbyname() in the future.

+          if (retries.remove_headers_on_redirect

+                  and not conn.is_same_host(redirect_location)):

+ -            for header in retries.remove_headers_on_redirect:

+ -                kw['headers'].pop(header, None)

+ +            headers = list(six.iterkeys(kw['headers']))

+ +            for header in headers:

+ +                if header.lower() in retries.remove_headers_on_redirect:

+ +                    kw['headers'].pop(header, None)

+  

+          try:

+              retries = retries.increment(method, url, response=response, _pool=conn)

+ diff --git a/src/pip/_vendor/urllib3/util/retry.py b/src/pip/_vendor/urllib3/util/retry.py

+ index e7d0abd..02429ee 100644

+ --- a/src/pip/_vendor/urllib3/util/retry.py

+ +++ b/src/pip/_vendor/urllib3/util/retry.py

+ @@ -179,7 +179,8 @@ class Retry(object):

+          self.raise_on_status = raise_on_status

+          self.history = history or tuple()

+          self.respect_retry_after_header = respect_retry_after_header

+ -        self.remove_headers_on_redirect = remove_headers_on_redirect

+ +        self.remove_headers_on_redirect = frozenset([

+ +            h.lower() for h in remove_headers_on_redirect])

+  

+      def new(self, **kw):

+          params = dict(

+ diff --git a/src/pip/_vendor/urllib3/util/ssl_.py b/src/pip/_vendor/urllib3/util/ssl_.py

+ index dfc553f..d96e893 100644

+ --- a/src/pip/_vendor/urllib3/util/ssl_.py

+ +++ b/src/pip/_vendor/urllib3/util/ssl_.py

+ @@ -327,7 +327,10 @@ def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,

+              if e.errno == errno.ENOENT:

+                  raise SSLError(e)

+              raise

+ -    elif getattr(context, 'load_default_certs', None) is not None:

+ +

+ +    # Don't load system certs unless there were no CA certs or

+ +    # SSLContext object specified manually.

+ +    elif ssl_context is None and hasattr(context, 'load_default_certs'):

+          # try to load OS default certs; works well on Windows (require Python3.4+)

+          context.load_default_certs()

+  

+ -- 

+ 2.24.1

+ 

file added
+2704
The added file is too large to be shown here, see it at: urllib3-rfc3986.patch
  • CVE-2019-11324 (#1774595)
  • CVE-2019-11236 (#1775363)

Note that I have some test failures on the same patch on Fedora 30 with Python 2 only, here the test is skipped (missing virtualenv). Investigating.

When I install older python2-virtualenv and run a scratchbuild, I get the failures here as well:

=================================== FAILURES ===================================
_____________________ test_pep518_allows_missing_requires ______________________

script = <tests.lib.PipTestEnvironment object at 0x7fb647035610>
data = <tests.lib.TestData object at 0x7fb646d29710>
common_wheels = Path('/builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels')

    def test_pep518_allows_missing_requires(script, data, common_wheels):
        result = script.pip(
            'install', '-f', common_wheels,
            data.src.join("pep518_missing_requires"),
>           expect_stderr=True
        )

tests/functional/test_install.py:93: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/lib/__init__.py:483: in pip
    return self.run(exe, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.lib.PipTestEnvironment object at 0x7fb647035610>
args = ('python', '-m', 'pip', 'install', '-f', Path('/builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels'), ...)
kw = {'expect_stderr': True}
cwd = Path('/tmp/pytest-of-mockbuild/pytest-0/test_pep518_allows_missing_req0/workspace/scratch')
run_from = None, allow_stderr_error = None, allow_stderr_warning = True

    def run(self, *args, **kw):
        """
        :param allow_stderr_warning: whether a logged warning (or
            deprecation message) is allowed in stderr.
        :param allow_stderr_error: whether a logged error is allowed in
            stderr.  Passing True for this argument implies
            `allow_stderr_warning` since warnings are weaker than errors.
        :param expect_stderr: whether to allow warnings in stderr (equivalent
            to `allow_stderr_warning`).  This argument is an abbreviated
            version of `allow_stderr_warning` and is also kept for backwards
            compatibility.
        """
        if self.verbose:
            print('>> running %s %s' % (args, kw))
        cwd = kw.pop('cwd', None)
        run_from = kw.pop('run_from', None)
        assert not cwd or not run_from, "Don't use run_from; it's going away"
        cwd = cwd or run_from or self.cwd
        if sys.platform == 'win32':
            # Partial fix for ScriptTest.run using `shell=True` on Windows.
            args = [str(a).replace('^', '^^').replace('&', '^&') for a in args]

        # Remove `allow_stderr_error` and `allow_stderr_warning` before
        # calling run() because PipTestEnvironment doesn't support them.
        allow_stderr_error = kw.pop('allow_stderr_error', None)
        allow_stderr_warning = kw.pop('allow_stderr_warning', None)

        if kw.get('expect_error'):
            # Then default to allowing logged errors.
            if allow_stderr_error is not None and not allow_stderr_error:
                raise RuntimeError(
                    'cannot pass allow_stderr_error=False with '
                    'expect_error=True'
                )
            allow_stderr_error = True
        elif kw.get('expect_stderr'):
            # Then default to allowing logged warnings.
            if allow_stderr_warning is not None and not allow_stderr_warning:
                raise RuntimeError(
                    'cannot pass allow_stderr_warning=False with '
                    'expect_stderr=True'
                )
            allow_stderr_warning = True

        # Pass expect_stderr=True to allow any stderr.  We do this because
        # we do our checking of stderr further on in check_stderr().
        kw['expect_stderr'] = True
>       result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw)
E       AssertionError: Script returned code: 1

tests/lib/__init__.py:466: AssertionError
----------------------------- Captured stdout call -----------------------------
Script result: python -m pip install -f /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels /tmp/pytest-of-mockbuild/pytest-0/test_pep518_allows_missing_req0/data/src/pep518_missing_requires
  return code: 1
-- stderr: --------------------
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  ERROR: Complete output from command /tmp/pytest-of-mockbuild/pytest-0/test_pep518_allows_missing_req0/workspace/venv/bin/python /builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pytest-of-mockbuild/pytest-0/test_pep518_allows_missing_req0/workspace/tmp/pip-build-env-XyzHgP/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --find-links /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels -- 'setuptools>=40.8.0' wheel:
  DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  Looking in links: /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels
  Collecting setuptools>=40.8.0
  ERROR: Exception:
  Traceback (most recent call last):
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 178, in main
      status = self.run(options, args)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 379, in run
      resolver.resolve(requirement_set)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/resolve.py", line 131, in resolve
      self._resolve_one(requirement_set, req)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/resolve.py", line 296, in _resolve_one
      abstract_dist = self._get_abstract_dist_for(req_to_install)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/resolve.py", line 244, in _get_abstract_dist_for
      self.require_hashes
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 282, in prepare_linked_requirement
      req.populate_link(finder, upgrade_allowed, require_hashes)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 198, in populate_link
      self.link = finder.find_requirement(self, upgrade)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 766, in find_requirement
      candidates = self.find_candidates(req.name, req.specifier)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 752, in find_candidates
      self.find_all_candidates(project_name),
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 716, in find_all_candidates
      for page in self._get_pages(url_locations, project_name):
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 846, in _get_pages
      page = _get_html_page(location, session=self.session)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 231, in _get_html_page
      resp = _get_html_response(url, session=session)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 179, in _get_html_response
      "Cache-Control": "max-age=0",
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 546, in get
      return self.request('GET', url, **kwargs)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/download.py", line 439, in request
      return super(PipSession, self).request(method, url, *args, **kwargs)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 519, in request
      prep = self.prepare_request(req)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 462, in prepare_request
      hooks=merge_hooks(request.hooks, self.hooks),
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.py", line 313, in prepare
      self.prepare_url(url, params)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.py", line 396, in prepare_url
      if not unicode_is_ascii(host):
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/_internal_utils.py", line 37, in unicode_is_ascii
      assert isinstance(u_string, str)
  AssertionError
  ----------------------------------------
ERROR: Command "/tmp/pytest-of-mockbuild/pytest-0/test_pep518_allows_missing_req0/workspace/venv/bin/python /builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pytest-of-mockbuild/pytest-0/test_pep518_allows_missing_req0/workspace/tmp/pip-build-env-XyzHgP/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --find-links /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels -- 'setuptools>=40.8.0' wheel" failed with error code 2 in None

-- stdout: --------------------
Looking in links: /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels
Processing /tmp/pytest-of-mockbuild/pytest-0/test_pep518_allows_missing_req0/data/src/pep518_missing_requires
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'

__________________________ test_pep518_with_user_pip ___________________________

script = <tests.lib.PipTestEnvironment object at 0x7fb646779fd0>
pip_src = Path('/tmp/pytest-of-mockbuild/pytest-0/pip_src0/pip_src')
data = <tests.lib.TestData object at 0x7fb646779150>
common_wheels = Path('/builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels')

    def test_pep518_with_user_pip(script, pip_src, data, common_wheels):
        """
        Check that build dependencies are installed into the build
        environment without using build isolation for the pip invocation.

        To ensure that we're not using build isolation when installing
        the build dependencies, we install a user copy of pip in the
        non-isolated environment, and break pip in the system site-packages,
        so that isolated uses of pip will fail.
        """
        script.pip("install", "--ignore-installed",
>                  "-f", common_wheels, "--user", pip_src)

tests/functional/test_install.py:116: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/lib/__init__.py:483: in pip
    return self.run(exe, *args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.lib.PipTestEnvironment object at 0x7fb646779fd0>
args = ('python', '-m', 'pip', 'install', '--ignore-installed', '-f', ...)
kw = {'expect_stderr': True}
cwd = Path('/tmp/pytest-of-mockbuild/pytest-0/test_pep518_with_user_pip0/workspace/scratch')
run_from = None, allow_stderr_error = None, allow_stderr_warning = True

    def run(self, *args, **kw):
        """
        :param allow_stderr_warning: whether a logged warning (or
            deprecation message) is allowed in stderr.
        :param allow_stderr_error: whether a logged error is allowed in
            stderr.  Passing True for this argument implies
            `allow_stderr_warning` since warnings are weaker than errors.
        :param expect_stderr: whether to allow warnings in stderr (equivalent
            to `allow_stderr_warning`).  This argument is an abbreviated
            version of `allow_stderr_warning` and is also kept for backwards
            compatibility.
        """
        if self.verbose:
            print('>> running %s %s' % (args, kw))
        cwd = kw.pop('cwd', None)
        run_from = kw.pop('run_from', None)
        assert not cwd or not run_from, "Don't use run_from; it's going away"
        cwd = cwd or run_from or self.cwd
        if sys.platform == 'win32':
            # Partial fix for ScriptTest.run using `shell=True` on Windows.
            args = [str(a).replace('^', '^^').replace('&', '^&') for a in args]

        # Remove `allow_stderr_error` and `allow_stderr_warning` before
        # calling run() because PipTestEnvironment doesn't support them.
        allow_stderr_error = kw.pop('allow_stderr_error', None)
        allow_stderr_warning = kw.pop('allow_stderr_warning', None)

        if kw.get('expect_error'):
            # Then default to allowing logged errors.
            if allow_stderr_error is not None and not allow_stderr_error:
                raise RuntimeError(
                    'cannot pass allow_stderr_error=False with '
                    'expect_error=True'
                )
            allow_stderr_error = True
        elif kw.get('expect_stderr'):
            # Then default to allowing logged warnings.
            if allow_stderr_warning is not None and not allow_stderr_warning:
                raise RuntimeError(
                    'cannot pass allow_stderr_warning=False with '
                    'expect_stderr=True'
                )
            allow_stderr_warning = True

        # Pass expect_stderr=True to allow any stderr.  We do this because
        # we do our checking of stderr further on in check_stderr().
        kw['expect_stderr'] = True
>       result = super(PipTestEnvironment, self).run(cwd=cwd, *args, **kw)
E       AssertionError: Script returned code: 1

tests/lib/__init__.py:466: AssertionError
----------------------------- Captured stdout call -----------------------------
Script result: python -m pip install --ignore-installed -f /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels --user /tmp/pytest-of-mockbuild/pytest-0/pip_src0/pip_src
  return code: 1
-- stderr: --------------------
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  ERROR: Complete output from command /tmp/pytest-of-mockbuild/pytest-0/test_pep518_with_user_pip0/workspace/venv/bin/python /builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pytest-of-mockbuild/pytest-0/test_pep518_with_user_pip0/workspace/tmp/pip-build-env-Pqwvu4/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --find-links /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels -- setuptools wheel:
  DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  Looking in links: /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels
  Collecting setuptools
  ERROR: Exception:
  Traceback (most recent call last):
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 178, in main
      status = self.run(options, args)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 379, in run
      resolver.resolve(requirement_set)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/resolve.py", line 131, in resolve
      self._resolve_one(requirement_set, req)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/resolve.py", line 296, in _resolve_one
      abstract_dist = self._get_abstract_dist_for(req_to_install)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/resolve.py", line 244, in _get_abstract_dist_for
      self.require_hashes
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 282, in prepare_linked_requirement
      req.populate_link(finder, upgrade_allowed, require_hashes)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/req/req_install.py", line 198, in populate_link
      self.link = finder.find_requirement(self, upgrade)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 766, in find_requirement
      candidates = self.find_candidates(req.name, req.specifier)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 752, in find_candidates
      self.find_all_candidates(project_name),
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 716, in find_all_candidates
      for page in self._get_pages(url_locations, project_name):
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 846, in _get_pages
      page = _get_html_page(location, session=self.session)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 231, in _get_html_page
      resp = _get_html_response(url, session=session)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/index.py", line 179, in _get_html_response
      "Cache-Control": "max-age=0",
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 546, in get
      return self.request('GET', url, **kwargs)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_internal/download.py", line 439, in request
      return super(PipSession, self).request(method, url, *args, **kwargs)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 519, in request
      prep = self.prepare_request(req)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 462, in prepare_request
      hooks=merge_hooks(request.hooks, self.hooks),
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.py", line 313, in prepare
      self.prepare_url(url, params)
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/models.py", line 396, in prepare_url
      if not unicode_is_ascii(host):
    File "/builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip/_vendor/requests/_internal_utils.py", line 37, in unicode_is_ascii
      assert isinstance(u_string, str)
  AssertionError
  ----------------------------------------
ERROR: Command "/tmp/pytest-of-mockbuild/pytest-0/test_pep518_with_user_pip0/workspace/venv/bin/python /builddir/build/BUILDROOT/python-pip-19.1.1-7.fc31.x86_64/usr/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pytest-of-mockbuild/pytest-0/test_pep518_with_user_pip0/workspace/tmp/pip-build-env-Pqwvu4/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --find-links /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels -- setuptools wheel" failed with error code 2 in None

-- stdout: --------------------
Looking in links: /builddir/build/BUILD/pip-19.1.1/tests/data/common_wheels
Processing /tmp/pytest-of-mockbuild/pytest-0/pip_src0/pip_src
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'

=========================== short test summary info ============================
SKIPPED [1] tests/functional/test_freeze.py:367: Mercurial is not available
SKIPPED [1] tests/functional/test_configuration.py:19: Can't modify underlying file for any mode
XFAIL tests/functional/test_freeze.py::test_freeze_exclude_editable
FAILED tests/functional/test_install.py::test_pep518_allows_missing_requires
FAILED tests/functional/test_install.py::test_pep518_with_user_pip
== 2 failed, 72 passed, 2 skipped, 126 deselected, 1 xfailed in 90.49 seconds ==

The failures were not present before.

Pull-Request has been closed by churchyard

4 years ago