diff --git a/e993c2cf4ec23050d300cbe817dbf46a0cadc992.patch b/e993c2cf4ec23050d300cbe817dbf46a0cadc992.patch new file mode 100644 index 0000000000000000000000000000000000000000..a4bb1f113ec116bb2153b88030f83fdab2f5c2ca --- /dev/null +++ b/e993c2cf4ec23050d300cbe817dbf46a0cadc992.patch @@ -0,0 +1,694 @@ +diff --git a/docs/html/conf.py b/docs/html/conf.py +index 7983187e9a..9e65cbe7a1 100644 +--- a/docs/html/conf.py ++++ b/docs/html/conf.py +@@ -1,5 +1,3 @@ +-# -*- coding: utf-8 -*- +-# + # pip documentation build configuration file, created by + # sphinx-quickstart on Tue Apr 22 22:08:49 2008 + # +@@ -239,8 +237,8 @@ + ( + 'index', + 'pip.tex', +- u'pip Documentation', +- u'pip developers', ++ 'pip Documentation', ++ 'pip developers', + 'manual', + ), + ] +@@ -269,8 +267,8 @@ + ( + 'index', + 'pip', +- u'package manager for Python packages', +- u'pip developers', ++ 'package manager for Python packages', ++ 'pip developers', + 1 + ) + ] +@@ -295,11 +293,11 @@ def to_document_name(path, base_dir): + for fname in raw_subcommands: + fname_base = to_document_name(fname, man_dir) + outname = 'pip-' + fname_base.split('/')[1] +- description = u'description of {} command'.format( ++ description = 'description of {} command'.format( + outname.replace('-', ' ') + ) + +- man_pages.append((fname_base, outname, description, u'pip developers', 1)) ++ man_pages.append((fname_base, outname, description, 'pip developers', 1)) + + # -- Options for docs_feedback_sphinxext -------------------------------------- + +diff --git a/news/b5e475d5-38b6-48cc-8136-0c32d3ace838.trivial.rst b/news/b5e475d5-38b6-48cc-8136-0c32d3ace838.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/cli/progress_bars.py b/src/pip/_internal/cli/progress_bars.py +index 1e40d6d9e2..4b1bb65a46 100644 +--- a/src/pip/_internal/cli/progress_bars.py ++++ b/src/pip/_internal/cli/progress_bars.py +@@ -125,7 +125,7 @@ class BlueEmojiBar(IncrementalBar): + suffix = "%(percent)d%%" + bar_prefix = " " + bar_suffix = " " +- phases = (u"\U0001F539", u"\U0001F537", u"\U0001F535") # type: Any ++ phases = ("\U0001F539", "\U0001F537", "\U0001F535") + + + class DownloadProgressMixin(object): +diff --git a/src/pip/_internal/commands/wheel.py b/src/pip/_internal/commands/wheel.py +index f9be310960..13dad544c7 100644 +--- a/src/pip/_internal/commands/wheel.py ++++ b/src/pip/_internal/commands/wheel.py +@@ -1,5 +1,3 @@ +-# -*- coding: utf-8 -*- +- + import logging + import os + import shutil +diff --git a/src/pip/_internal/index/package_finder.py b/src/pip/_internal/index/package_finder.py +index 860eb1255c..cd76870481 100644 +--- a/src/pip/_internal/index/package_finder.py ++++ b/src/pip/_internal/index/package_finder.py +@@ -161,10 +161,7 @@ def evaluate_link(self, link): + version = None + if link.is_yanked and not self._allow_yanked: + reason = link.yanked_reason or '' +- # Mark this as a unicode string to prevent "UnicodeEncodeError: +- # 'ascii' codec can't encode character" in Python 2 when +- # the reason contains non-ascii characters. +- return (False, u'yanked for reason: {}'.format(reason)) ++ return (False, 'yanked for reason: {}'.format(reason)) + + if link.egg_fragment: + egg_info = link.egg_fragment +@@ -738,12 +735,9 @@ def _sort_links(self, links): + def _log_skipped_link(self, link, reason): + # type: (Link, str) -> None + if link not in self._logged_links: +- # Mark this as a unicode string to prevent "UnicodeEncodeError: +- # 'ascii' codec can't encode character" in Python 2 when +- # the reason contains non-ascii characters. +- # Also, put the link at the end so the reason is more visible +- # and because the link string is usually very long. +- logger.debug(u'Skipping link: %s: %s', reason, link) ++ # Put the link at the end so the reason is more visible and because ++ # the link string is usually very long. ++ logger.debug('Skipping link: %s: %s', reason, link) + self._logged_links.add(link) + + def get_install_candidate(self, link_evaluator, link): +diff --git a/src/pip/_internal/network/utils.py b/src/pip/_internal/network/utils.py +index 907b3fed49..f4ff95010f 100644 +--- a/src/pip/_internal/network/utils.py ++++ b/src/pip/_internal/network/utils.py +@@ -30,7 +30,7 @@ + + def raise_for_status(resp): + # type: (Response) -> None +- http_error_msg = u'' ++ http_error_msg = '' + if isinstance(resp.reason, bytes): + # We attempt to decode utf-8 first because some servers + # choose to localize their reason strings. If the string +@@ -44,11 +44,11 @@ def raise_for_status(resp): + reason = resp.reason + + if 400 <= resp.status_code < 500: +- http_error_msg = u'%s Client Error: %s for url: %s' % ( ++ http_error_msg = '%s Client Error: %s for url: %s' % ( + resp.status_code, reason, resp.url) + + elif 500 <= resp.status_code < 600: +- http_error_msg = u'%s Server Error: %s for url: %s' % ( ++ http_error_msg = '%s Server Error: %s for url: %s' % ( + resp.status_code, reason, resp.url) + + if http_error_msg: +diff --git a/src/pip/_internal/resolution/legacy/resolver.py b/src/pip/_internal/resolution/legacy/resolver.py +index d0fc1a7b31..b71e294ba7 100644 +--- a/src/pip/_internal/resolution/legacy/resolver.py ++++ b/src/pip/_internal/resolution/legacy/resolver.py +@@ -276,7 +276,7 @@ def _find_requirement_link(self, req): + # Mark this as a unicode string to prevent + # "UnicodeEncodeError: 'ascii' codec can't encode character" + # in Python 2 when the reason contains non-ascii characters. +- u'The candidate selected for download or install is a ' ++ 'The candidate selected for download or install is a ' + 'yanked version: {candidate}\n' + 'Reason for being yanked: {reason}' + ).format(candidate=best_candidate, reason=reason) +diff --git a/src/pip/_internal/resolution/resolvelib/resolver.py b/src/pip/_internal/resolution/resolvelib/resolver.py +index 30b860f6c4..751606f512 100644 +--- a/src/pip/_internal/resolution/resolvelib/resolver.py ++++ b/src/pip/_internal/resolution/resolvelib/resolver.py +@@ -189,14 +189,14 @@ def resolve(self, root_reqs, check_supported_wheels): + # The reason can contain non-ASCII characters, Unicode + # is required for Python 2. + msg = ( +- u'The candidate selected for download or install is a ' +- u'yanked version: {name!r} candidate (version {version} ' +- u'at {link})\nReason for being yanked: {reason}' ++ 'The candidate selected for download or install is a ' ++ 'yanked version: {name!r} candidate (version {version} ' ++ 'at {link})\nReason for being yanked: {reason}' + ).format( + name=candidate.name, + version=candidate.version, + link=link, +- reason=link.yanked_reason or u'', ++ reason=link.yanked_reason or '', + ) + logger.warning(msg) + +diff --git a/src/pip/_internal/utils/subprocess.py b/src/pip/_internal/utils/subprocess.py +index 25c9020699..7de45aed01 100644 +--- a/src/pip/_internal/utils/subprocess.py ++++ b/src/pip/_internal/utils/subprocess.py +@@ -90,7 +90,7 @@ def make_subprocess_output_error( + # Use a unicode string to avoid "UnicodeEncodeError: 'ascii' + # codec can't encode character ..." in Python 2 when a format + # argument (e.g. `output`) has a non-ascii character. +- u'Command errored out with exit status {exit_status}:\n' ++ 'Command errored out with exit status {exit_status}:\n' + ' command: {command_display}\n' + ' cwd: {cwd_display}\n' + 'Complete output ({line_count} lines):\n{output}{divider}' +diff --git a/tests/conftest.py b/tests/conftest.py +index 499c121bca..7e67a0b2aa 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -496,7 +496,7 @@ def factory(): + """ + output_path = Path(str(tmpdir_factory.mktemp("certs"))) / "cert.pem" + # Must be Text on PY2. +- cert, key = make_tls_cert(u"localhost") ++ cert, key = make_tls_cert("localhost") + with open(str(output_path), "wb") as f: + f.write(serialize_cert(cert)) + f.write(serialize_key(key)) +diff --git a/tests/functional/test_fast_deps.py b/tests/functional/test_fast_deps.py +index 655440b881..e82641986a 100644 +--- a/tests/functional/test_fast_deps.py ++++ b/tests/functional/test_fast_deps.py +@@ -54,7 +54,7 @@ def test_build_wheel_with_deps(data, script): + def test_require_hash(script, tmp_path): + reqs = tmp_path / 'requirements.txt' + reqs.write_text( +- u'idna==2.10' ++ 'idna==2.10' + ' --hash=sha256:' + 'b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0' + ' --hash=sha256:' +@@ -71,7 +71,7 @@ def test_require_hash(script, tmp_path): + @mark.network + def test_hash_mismatch(script, tmp_path): + reqs = tmp_path / 'requirements.txt' +- reqs.write_text(u'idna==2.10 --hash=sha256:irna') ++ reqs.write_text('idna==2.10 --hash=sha256:irna') + result = script.pip( + 'download', '--use-feature=fast-deps', '-r', str(reqs), + expect_error=True, +diff --git a/tests/functional/test_install_wheel.py b/tests/functional/test_install_wheel.py +index 177e86db32..9bf965625f 100644 +--- a/tests/functional/test_install_wheel.py ++++ b/tests/functional/test_install_wheel.py +@@ -1,5 +1,3 @@ +-# -*- coding: utf-8 -*- +- + import csv + import distutils + import glob +diff --git a/tests/functional/test_new_resolver_hashes.py b/tests/functional/test_new_resolver_hashes.py +index 6fa642f8b8..854b66418a 100644 +--- a/tests/functional/test_new_resolver_hashes.py ++++ b/tests/functional/test_new_resolver_hashes.py +@@ -80,7 +80,7 @@ def test_new_resolver_hash_intersect(script, requirements_template, message): + "--requirement", requirements_txt, + ) + +- assert message.format(name=u"base") in result.stdout, str(result) ++ assert message.format(name="base") in result.stdout, str(result) + + + def test_new_resolver_hash_intersect_from_constraint(script): +@@ -116,7 +116,7 @@ def test_new_resolver_hash_intersect_from_constraint(script): + message = ( + "Checked 2 links for project {name!r} against 1 hashes " + "(1 matches, 0 no digest): discarding 1 non-matches" +- ).format(name=u"base") ++ ).format(name="base") + assert message in result.stdout, str(result) + + +diff --git a/tests/functional/test_vcs_git.py b/tests/functional/test_vcs_git.py +index 8b07ae6673..d5de1a2fd7 100644 +--- a/tests/functional/test_vcs_git.py ++++ b/tests/functional/test_vcs_git.py +@@ -259,13 +259,13 @@ def test_resolve_commit_not_on_branch(script, tmp_path): + repo_path.mkdir() + script.run("git", "init", cwd=str(repo_path)) + +- repo_file.write_text(u".") ++ repo_file.write_text(".") + script.run("git", "add", "file.txt", cwd=str(repo_path)) + script.run("git", "commit", "-m", "initial commit", cwd=str(repo_path)) + script.run("git", "checkout", "-b", "abranch", cwd=str(repo_path)) + + # create a commit +- repo_file.write_text(u"..") ++ repo_file.write_text("..") + script.run("git", "commit", "-a", "-m", "commit 1", cwd=str(repo_path)) + commit = script.run( + "git", "rev-parse", "HEAD", cwd=str(repo_path) +diff --git a/tests/lib/__init__.py b/tests/lib/__init__.py +index c8a885aea7..bdf50c6f70 100644 +--- a/tests/lib/__init__.py ++++ b/tests/lib/__init__.py +@@ -306,7 +306,7 @@ def assert_installed(self, pkg_name, editable=True, with_files=None, + if not (egg_link_contents.endswith('\n.') and + egg_link_contents[:-2].endswith(pkg_dir)): + raise TestFailure(textwrap.dedent( +- u'''\ ++ '''\ + Incorrect egg_link file {egg_link_file!r} + Expected ending: {expected_ending!r} + ------- Actual contents ------- +diff --git a/tests/lib/path.py b/tests/lib/path.py +index 3bd5d319f3..a9dc29ad7a 100644 +--- a/tests/lib/path.py ++++ b/tests/lib/path.py +@@ -1,5 +1,4 @@ + # flake8: noqa +-# -*- coding: utf-8 -*- + # Author: Aziz Köksal + import glob + import os +@@ -72,7 +71,7 @@ def __radd__(self, path): + return Path(path + str(self)) + + def __repr__(self): +- return u"Path({inner})".format(inner=str.__repr__(self)) ++ return "Path({inner})".format(inner=str.__repr__(self)) + + def __hash__(self): + return str.__hash__(self) +diff --git a/tests/lib/server.py b/tests/lib/server.py +index add3fd5621..b0b802689d 100644 +--- a/tests/lib/server.py ++++ b/tests/lib/server.py +@@ -168,7 +168,7 @@ def responder(environ, start_response): + + def html5_page(text): + # type: (str) -> str +- return dedent(u""" ++ return dedent(""" + + + +diff --git a/tests/lib/wheel.py b/tests/lib/wheel.py +index b5e222fda4..2121a175ca 100644 +--- a/tests/lib/wheel.py ++++ b/tests/lib/wheel.py +@@ -240,7 +240,7 @@ def record_file_maker_wrapper( + if record_callback is not _default: + records = record_callback(records) + +- with StringIO(newline=u"") as buf: ++ with StringIO(newline="") as buf: + writer = csv23.writer(buf) + for record in records: + writer.writerow(map(ensure_text, record)) +diff --git a/tests/unit/test_appdirs.py b/tests/unit/test_appdirs.py +index e129c0c0b8..623486b289 100644 +--- a/tests/unit/test_appdirs.py ++++ b/tests/unit/test_appdirs.py +@@ -70,7 +70,7 @@ def test_user_cache_dir_unicode(self, monkeypatch): + return + + def my_get_win_folder(csidl_name): +- return u"\u00DF\u00E4\u03B1\u20AC" ++ return "\u00DF\u00E4\u03B1\u20AC" + + monkeypatch.setattr(_appdirs, "_get_win_folder", my_get_win_folder) + +diff --git a/tests/unit/test_cache.py b/tests/unit/test_cache.py +index a289fb5989..89cbb079b7 100644 +--- a/tests/unit/test_cache.py ++++ b/tests/unit/test_cache.py +@@ -47,7 +47,7 @@ def test_cache_hash(): + assert h == "72aa79d3315c181d2cc23239d7109a782de663b6f89982624d8c1e86" + h = _hash_dict({"url": "https://g.c/o/r", "subdirectory": "sd"}) + assert h == "8b13391b6791bf7f3edeabb41ea4698d21bcbdbba7f9c7dc9339750d" +- h = _hash_dict({"subdirectory": u"/\xe9e"}) ++ h = _hash_dict({"subdirectory": "/\xe9e"}) + assert h == "f83b32dfa27a426dec08c21bf006065dd003d0aac78e7fc493d9014d" + + +diff --git a/tests/unit/test_collector.py b/tests/unit/test_collector.py +index 4384812fc6..294ea721a3 100644 +--- a/tests/unit/test_collector.py ++++ b/tests/unit/test_collector.py +@@ -382,14 +382,14 @@ def test_clean_link(url, clean_url): + ('', + 'version < 1'), + # Test a yanked reason with a non-ascii character. +- (u'', +- u'curlyquote \u2018'), ++ ('', ++ 'curlyquote \u2018'), + ]) + def test_parse_links__yanked_reason(anchor_html, expected): + html = ( + # Mark this as a unicode string for Python 2 since anchor_html + # can contain non-ascii. +- u'' ++ '' + '{}' + ).format(anchor_html) + html_bytes = html.encode('utf-8') +@@ -552,7 +552,7 @@ def make_fake_html_response(url): + """ + Create a fake requests.Response object. + """ +- html = dedent(u"""\ ++ html = dedent("""\ + + + abc-1.0.tar.gz +diff --git a/tests/unit/test_compat.py b/tests/unit/test_compat.py +index 1b7a482a2a..cc024b570a 100644 +--- a/tests/unit/test_compat.py ++++ b/tests/unit/test_compat.py +@@ -1,5 +1,3 @@ +-# -*- coding: utf-8 -*- +- + import locale + import os + import sys +@@ -54,11 +52,9 @@ def test_get_path_uid_symlink_without_NOFOLLOW(tmpdir, monkeypatch): + + + @pytest.mark.parametrize('data, expected', [ +- ('abc', u'abc'), +- # Test text (unicode in Python 2) input. +- (u'abc', u'abc'), ++ ('abc', 'abc'), + # Test text input with non-ascii characters. +- (u'déf', u'déf'), ++ ('déf', 'déf'), + ]) + def test_str_to_display(data, expected): + actual = str_to_display(data) +@@ -70,13 +66,13 @@ def test_str_to_display(data, expected): + + @pytest.mark.parametrize('data, encoding, expected', [ + # Test str input with non-ascii characters. +- ('déf', 'utf-8', u'déf'), ++ ('déf', 'utf-8', 'déf'), + # Test bytes input with non-ascii characters: +- (u'déf'.encode('utf-8'), 'utf-8', u'déf'), ++ ('déf'.encode('utf-8'), 'utf-8', 'déf'), + # Test a Windows encoding. +- (u'déf'.encode('cp1252'), 'cp1252', u'déf'), ++ ('déf'.encode('cp1252'), 'cp1252', 'déf'), + # Test a Windows encoding with incompatibly encoded text. +- (u'déf'.encode('utf-8'), 'cp1252', u'déf'), ++ ('déf'.encode('utf-8'), 'cp1252', 'déf'), + ]) + def test_str_to_display__encoding(monkeypatch, data, encoding, expected): + monkeypatch.setattr(locale, 'getpreferredencoding', lambda: encoding) +@@ -90,7 +86,7 @@ def test_str_to_display__encoding(monkeypatch, data, encoding, expected): + def test_str_to_display__decode_error(monkeypatch, caplog): + monkeypatch.setattr(locale, 'getpreferredencoding', lambda: 'utf-8') + # Encode with an incompatible encoding. +- data = u'ab'.encode('utf-16') ++ data = 'ab'.encode('utf-16') + actual = str_to_display(data) + # Keep the expected value endian safe + if sys.byteorder == "little": +diff --git a/tests/unit/test_index.py b/tests/unit/test_index.py +index 2ae847ae0b..e719707ab7 100644 +--- a/tests/unit/test_index.py ++++ b/tests/unit/test_index.py +@@ -131,9 +131,9 @@ def test_evaluate_link( + ('bad metadata', False, + (False, 'yanked for reason: bad metadata')), + # Test a unicode string with a non-ascii character. +- (u'curly quote: \u2018', True, (True, '1.12')), +- (u'curly quote: \u2018', False, +- (False, u'yanked for reason: curly quote: \u2018')), ++ ('curly quote: \u2018', True, (True, '1.12')), ++ ('curly quote: \u2018', False, ++ (False, 'yanked for reason: curly quote: \u2018')), + ]) + def test_evaluate_link__allow_yanked( + self, yanked_reason, allow_yanked, expected, +diff --git a/tests/unit/test_resolution_legacy_resolver.py b/tests/unit/test_resolution_legacy_resolver.py +index 0388b42be5..c4ff649291 100644 +--- a/tests/unit/test_resolution_legacy_resolver.py ++++ b/tests/unit/test_resolution_legacy_resolver.py +@@ -245,7 +245,7 @@ def test_sort_best_candidate__all_yanked(self, caplog, monkeypatch): + # Test no reason given. + ('', ''), + # Test a unicode string with a non-ascii character. +- (u'curly quote: \u2018', u'curly quote: \u2018'), ++ ('curly quote: \u2018', 'curly quote: \u2018'), + ]) + def test_sort_best_candidate__yanked_reason( + self, caplog, monkeypatch, yanked_reason, expected_reason, +diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py +index 1996b35cb3..57434669e5 100644 +--- a/tests/unit/test_utils.py ++++ b/tests/unit/test_utils.py +@@ -1,5 +1,3 @@ +-# -*- coding: utf-8 -*- +- + """ + util tests + +@@ -419,12 +417,12 @@ def test_rmtree_retries_for_3sec(tmpdir, monkeypatch): + + if sys.byteorder == "little": + expected_byte_string = ( +- u"b'\\xff\\xfe/\\x00p\\x00a\\x00t\\x00h\\x00/" ++ "b'\\xff\\xfe/\\x00p\\x00a\\x00t\\x00h\\x00/" + "\\x00d\\x00\\xe9\\x00f\\x00'" + ) + elif sys.byteorder == "big": + expected_byte_string = ( +- u"b'\\xfe\\xff\\x00/\\x00p\\x00a\\x00t\\x00h\\" ++ "b'\\xfe\\xff\\x00/\\x00p\\x00a\\x00t\\x00h\\" + "x00/\\x00d\\x00\\xe9\\x00f'" + ) + +@@ -432,12 +430,12 @@ def test_rmtree_retries_for_3sec(tmpdir, monkeypatch): + @pytest.mark.parametrize('path, fs_encoding, expected', [ + (None, None, None), + # Test passing a text (unicode) string. +- (u'/path/déf', None, u'/path/déf'), ++ ('/path/déf', None, '/path/déf'), + # Test a bytes object with a non-ascii character. +- (u'/path/déf'.encode('utf-8'), 'utf-8', u'/path/déf'), ++ ('/path/déf'.encode('utf-8'), 'utf-8', '/path/déf'), + # Test a bytes object with a character that can't be decoded. +- (u'/path/déf'.encode('utf-8'), 'ascii', u"b'/path/d\\xc3\\xa9f'"), +- (u'/path/déf'.encode('utf-16'), 'utf-8', expected_byte_string), ++ ('/path/déf'.encode('utf-8'), 'ascii', "b'/path/d\\xc3\\xa9f'"), ++ ('/path/déf'.encode('utf-16'), 'utf-8', expected_byte_string), + ]) + def test_path_to_display(monkeypatch, path, fs_encoding, expected): + monkeypatch.setattr(sys, 'getfilesystemencoding', lambda: fs_encoding) +@@ -572,17 +570,17 @@ def test_auto_decode_utf_16_be(self): + assert auto_decode(data) == "Django==1.4.2" + + def test_auto_decode_no_bom(self): +- assert auto_decode(b'foobar') == u'foobar' ++ assert auto_decode(b'foobar') == 'foobar' + + def test_auto_decode_pep263_headers(self): +- latin1_req = u'# coding=latin1\n# Pas trop de café' ++ latin1_req = '# coding=latin1\n# Pas trop de café' + assert auto_decode(latin1_req.encode('latin1')) == latin1_req + + def test_auto_decode_no_preferred_encoding(self): + om, em = Mock(), Mock() + om.return_value = 'ascii' + em.return_value = None +- data = u'data' ++ data = 'data' + with patch('sys.getdefaultencoding', om): + with patch('locale.getpreferredencoding', em): + ret = auto_decode(data.encode(sys.getdefaultencoding())) +diff --git a/tests/unit/test_utils_subprocess.py b/tests/unit/test_utils_subprocess.py +index b0de2bf578..fd73878c1a 100644 +--- a/tests/unit/test_utils_subprocess.py ++++ b/tests/unit/test_utils_subprocess.py +@@ -1,4 +1,3 @@ +-# -*- coding: utf-8 -*- + import locale + import sys + from logging import DEBUG, ERROR, INFO, WARNING +@@ -61,7 +60,7 @@ def test_make_subprocess_output_error__non_ascii_command_arg(monkeypatch): + # Check in Python 2 that the str (bytes object) with the non-ascii + # character has the encoding we expect. (This comes from the source + # code encoding at the top of the file.) +- assert cmd_args[1].decode('utf-8') == u'déf' ++ assert cmd_args[1].decode('utf-8') == 'déf' + + # We need to monkeypatch so the encoding will be correct on Windows. + monkeypatch.setattr(locale, 'getpreferredencoding', lambda: 'utf-8') +@@ -71,13 +70,13 @@ def test_make_subprocess_output_error__non_ascii_command_arg(monkeypatch): + lines=[], + exit_status=1, + ) +- expected = dedent(u"""\ ++ expected = dedent("""\ + Command errored out with exit status 1: + command: foo 'déf' + cwd: /path/to/cwd + Complete output (0 lines): + ----------------------------------------""") +- assert actual == expected, u'actual: {}'.format(actual) ++ assert actual == expected, 'actual: {}'.format(actual) + + + @pytest.mark.skipif("sys.version_info < (3,)") +@@ -115,7 +114,7 @@ def test_make_subprocess_output_error__non_ascii_cwd_python_2( + Test a str (bytes object) cwd with a non-ascii character in Python 2. + """ + cmd_args = ['test'] +- cwd = u'/path/to/cwd/déf'.encode(encoding) ++ cwd = '/path/to/cwd/déf'.encode(encoding) + monkeypatch.setattr(sys, 'getfilesystemencoding', lambda: encoding) + actual = make_subprocess_output_error( + cmd_args=cmd_args, +@@ -123,13 +122,13 @@ def test_make_subprocess_output_error__non_ascii_cwd_python_2( + lines=[], + exit_status=1, + ) +- expected = dedent(u"""\ ++ expected = dedent("""\ + Command errored out with exit status 1: + command: test + cwd: /path/to/cwd/déf + Complete output (0 lines): + ----------------------------------------""") +- assert actual == expected, u'actual: {}'.format(actual) ++ assert actual == expected, 'actual: {}'.format(actual) + + + # This test is mainly important for checking unicode in Python 2. +@@ -137,21 +136,21 @@ def test_make_subprocess_output_error__non_ascii_line(): + """ + Test a line with a non-ascii character. + """ +- lines = [u'curly-quote: \u2018\n'] ++ lines = ['curly-quote: \u2018\n'] + actual = make_subprocess_output_error( + cmd_args=['test'], + cwd='/path/to/cwd', + lines=lines, + exit_status=1, + ) +- expected = dedent(u"""\ ++ expected = dedent("""\ + Command errored out with exit status 1: + command: test + cwd: /path/to/cwd + Complete output (1 lines): + curly-quote: \u2018 + ----------------------------------------""") +- assert actual == expected, u'actual: {}'.format(actual) ++ assert actual == expected, 'actual: {}'.format(actual) + + + class FakeSpinner(SpinnerInterface): +diff --git a/tests/unit/test_wheel.py b/tests/unit/test_wheel.py +index a97ec89da4..0f7a3c0747 100644 +--- a/tests/unit/test_wheel.py ++++ b/tests/unit/test_wheel.py +@@ -1,5 +1,3 @@ +-# -*- coding: utf-8 -*- +- + """Tests for wheel binary packages and .dist-info.""" + import csv + import logging +@@ -81,13 +79,13 @@ def test_get_legacy_build_wheel_path__multiple_names(caplog): + @pytest.mark.parametrize( + "console_scripts", + [ +- u"pip = pip._internal.main:pip", +- u"pip:pip = pip._internal.main:pip", +- u"進入點 = 套件.模組:函式", ++ "pip = pip._internal.main:pip", ++ "pip:pip = pip._internal.main:pip", ++ "進入點 = 套件.模組:函式", + ], + ) + def test_get_entrypoints(console_scripts): +- entry_points_text = u""" ++ entry_points_text = """ + [console_scripts] + {} + [section] +@@ -125,8 +123,8 @@ def test_get_entrypoints_no_entrypoints(): + + @pytest.mark.parametrize("outrows, expected", [ + ([ +- (u'', '', 'a'), +- (u'', '', ''), ++ ('', '', 'a'), ++ ('', '', ''), + ], [ + ('', '', ''), + ('', '', 'a'), +@@ -134,16 +132,16 @@ def test_get_entrypoints_no_entrypoints(): + ([ + # Include an int to check avoiding the following error: + # > TypeError: '<' not supported between instances of 'str' and 'int' +- (u'', '', 1), +- (u'', '', ''), ++ ('', '', 1), ++ ('', '', ''), + ], [ + ('', '', ''), + ('', '', '1'), + ]), + ([ + # Test the normalization correctly encode everything for csv.writer(). +- (u'😉', '', 1), +- (u'', '', ''), ++ ('😉', '', 1), ++ ('', '', ''), + ], [ + ('', '', ''), + ('😉', '', '1'), +@@ -160,7 +158,7 @@ def call_get_csv_rows_for_installed(tmpdir, text): + + # Test that an installed file appearing in RECORD has its filename + # updated in the new RECORD file. +- installed = {u'a': 'z'} ++ installed = {'a': 'z'} + changed = set() + generated = [] + lib_dir = '/lib/dir' +diff --git a/tools/automation/release/__init__.py b/tools/automation/release/__init__.py +index 042723100a..c1364cfc46 100644 +--- a/tools/automation/release/__init__.py ++++ b/tools/automation/release/__init__.py +@@ -76,8 +76,8 @@ def generate_authors(filename: str) -> None: + + # Write our authors to the AUTHORS file + with io.open(filename, "w", encoding="utf-8") as fp: +- fp.write(u"\n".join(authors)) +- fp.write(u"\n") ++ fp.write("\n".join(authors)) ++ fp.write("\n") + + + def commit_file(session: Session, filename: str, *, message: str) -> None: diff --git a/f91ba6b348c467f8c97dc959b413cc6fd13ae199.patch b/f91ba6b348c467f8c97dc959b413cc6fd13ae199.patch new file mode 100644 index 0000000000000000000000000000000000000000..0a1a701a2af8bc8a26ce5e7169ebbf5f1ef0debf --- /dev/null +++ b/f91ba6b348c467f8c97dc959b413cc6fd13ae199.patch @@ -0,0 +1,716 @@ +diff --git a/news/4ec6e91c-91d6-475c-959a-83485cafa4b2.trivial.rst b/news/4ec6e91c-91d6-475c-959a-83485cafa4b2.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/cache.py b/src/pip/_internal/cache.py +index def8dd64a1..b02c82a3c3 100644 +--- a/src/pip/_internal/cache.py ++++ b/src/pip/_internal/cache.py +@@ -46,7 +46,7 @@ class Cache(object): + + def __init__(self, cache_dir, format_control, allowed_formats): + # type: (str, FormatControl, Set[str]) -> None +- super(Cache, self).__init__() ++ super().__init__() + assert not cache_dir or os.path.isabs(cache_dir) + self.cache_dir = cache_dir or None + self.format_control = format_control +@@ -175,9 +175,7 @@ class SimpleWheelCache(Cache): + + def __init__(self, cache_dir, format_control): + # type: (str, FormatControl) -> None +- super(SimpleWheelCache, self).__init__( +- cache_dir, format_control, {"binary"} +- ) ++ super().__init__(cache_dir, format_control, {"binary"}) + + def get_path_for_link_legacy(self, link): + # type: (Link) -> str +@@ -262,9 +260,7 @@ def __init__(self, format_control): + globally_managed=True, + ) + +- super(EphemWheelCache, self).__init__( +- self._temp_dir.path, format_control +- ) ++ super().__init__(self._temp_dir.path, format_control) + + + class CacheEntry(object): +@@ -286,9 +282,7 @@ class WheelCache(Cache): + + def __init__(self, cache_dir, format_control): + # type: (str, FormatControl) -> None +- super(WheelCache, self).__init__( +- cache_dir, format_control, {'binary'} +- ) ++ super().__init__(cache_dir, format_control, {'binary'}) + self._wheel_cache = SimpleWheelCache(cache_dir, format_control) + self._ephem_cache = EphemWheelCache(format_control) + +diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py +index adfaab3ff7..6a3f383826 100644 +--- a/src/pip/_internal/cli/base_command.py ++++ b/src/pip/_internal/cli/base_command.py +@@ -52,7 +52,7 @@ class Command(CommandContextMixIn): + + def __init__(self, name, summary, isolated=False): + # type: (str, str, bool) -> None +- super(Command, self).__init__() ++ super().__init__() + parser_kw = { + 'usage': self.usage, + 'prog': '{} {}'.format(get_prog(), name), +diff --git a/src/pip/_internal/cli/command_context.py b/src/pip/_internal/cli/command_context.py +index 669c777749..7ee2d24e32 100644 +--- a/src/pip/_internal/cli/command_context.py ++++ b/src/pip/_internal/cli/command_context.py +@@ -13,7 +13,7 @@ + class CommandContextMixIn(object): + def __init__(self): + # type: () -> None +- super(CommandContextMixIn, self).__init__() ++ super().__init__() + self._in_main_context = False + self._main_context = ExitStack() + +diff --git a/src/pip/_internal/cli/parser.py b/src/pip/_internal/cli/parser.py +index e56193c3d2..ba647f3a16 100644 +--- a/src/pip/_internal/cli/parser.py ++++ b/src/pip/_internal/cli/parser.py +@@ -27,7 +27,7 @@ def __init__(self, *args, **kwargs): + kwargs['max_help_position'] = 30 + kwargs['indent_increment'] = 1 + kwargs['width'] = shutil.get_terminal_size()[0] - 2 +- optparse.IndentedHelpFormatter.__init__(self, *args, **kwargs) ++ super().__init__(*args, **kwargs) + + def format_option_strings(self, option): + return self._format_option_strings(option) +@@ -113,7 +113,7 @@ def expand_default(self, option): + if self.parser is not None: + self.parser._update_defaults(self.parser.defaults) + default_values = self.parser.defaults.get(option.dest) +- help_text = optparse.IndentedHelpFormatter.expand_default(self, option) ++ help_text = super().expand_default(option) + + if default_values and option.metavar == 'URL': + if isinstance(default_values, str): +@@ -162,7 +162,7 @@ def __init__(self, *args, **kwargs): + self.config = Configuration(isolated) + + assert self.name +- optparse.OptionParser.__init__(self, *args, **kwargs) ++ super().__init__(*args, **kwargs) + + def check_default(self, option, key, val): + try: +diff --git a/src/pip/_internal/cli/progress_bars.py b/src/pip/_internal/cli/progress_bars.py +index 4b1bb65a46..e248a1a5fa 100644 +--- a/src/pip/_internal/cli/progress_bars.py ++++ b/src/pip/_internal/cli/progress_bars.py +@@ -76,10 +76,7 @@ def __init__(self, *args, **kwargs): + Save the original SIGINT handler for later. + """ + # https://github.com/python/mypy/issues/5887 +- super(InterruptibleMixin, self).__init__( # type: ignore +- *args, +- **kwargs +- ) ++ super().__init__(*args, **kwargs) # type: ignore + + self.original_handler = signal(SIGINT, self.handle_sigint) + +@@ -99,7 +96,7 @@ def finish(self): + This should happen regardless of whether the progress display finishes + normally, or gets interrupted. + """ +- super(InterruptibleMixin, self).finish() # type: ignore ++ super().finish() # type: ignore + signal(SIGINT, self.original_handler) + + def handle_sigint(self, signum, frame): # type: ignore +@@ -133,10 +130,7 @@ class DownloadProgressMixin(object): + def __init__(self, *args, **kwargs): + # type: (List[Any], Dict[Any, Any]) -> None + # https://github.com/python/mypy/issues/5887 +- super(DownloadProgressMixin, self).__init__( # type: ignore +- *args, +- **kwargs +- ) ++ super().__init__(*args, **kwargs) # type: ignore + self.message = (" " * ( + get_indentation() + 2 + )) + self.message # type: str +@@ -185,7 +179,7 @@ def __init__(self, *args, **kwargs): + self.hide_cursor = False + + # https://github.com/python/mypy/issues/5887 +- super(WindowsMixin, self).__init__(*args, **kwargs) # type: ignore ++ super().__init__(*args, **kwargs) # type: ignore + + # Check if we are running on Windows and we have the colorama module, + # if we do then wrap our file with it. +diff --git a/src/pip/_internal/cli/req_command.py b/src/pip/_internal/cli/req_command.py +index 2adbb74119..468b3cceab 100644 +--- a/src/pip/_internal/cli/req_command.py ++++ b/src/pip/_internal/cli/req_command.py +@@ -51,7 +51,7 @@ class SessionCommandMixin(CommandContextMixIn): + """ + def __init__(self): + # type: () -> None +- super(SessionCommandMixin, self).__init__() ++ super().__init__() + self._session = None # Optional[PipSession] + + @classmethod +@@ -190,7 +190,7 @@ class RequirementCommand(IndexGroupCommand): + + def __init__(self, *args, **kw): + # type: (Any, Any) -> None +- super(RequirementCommand, self).__init__(*args, **kw) ++ super().__init__(*args, **kw) + + self.cmd_opts.add_option(cmdoptions.no_clean()) + +diff --git a/src/pip/_internal/configuration.py b/src/pip/_internal/configuration.py +index 9e83578556..a55882b463 100644 +--- a/src/pip/_internal/configuration.py ++++ b/src/pip/_internal/configuration.py +@@ -110,7 +110,7 @@ class Configuration(object): + + def __init__(self, isolated, load_only=None): + # type: (bool, Optional[Kind]) -> None +- super(Configuration, self).__init__() ++ super().__init__() + + if load_only is not None and load_only not in VALID_LOAD_ONLY: + raise ConfigurationError( +diff --git a/src/pip/_internal/distributions/base.py b/src/pip/_internal/distributions/base.py +index dc7ae96aa0..6c68a86a27 100644 +--- a/src/pip/_internal/distributions/base.py ++++ b/src/pip/_internal/distributions/base.py +@@ -28,7 +28,7 @@ class AbstractDistribution(object, metaclass=abc.ABCMeta): + """ + def __init__(self, req): + # type: (InstallRequirement) -> None +- super(AbstractDistribution, self).__init__() ++ super().__init__() + self.req = req + + @abc.abstractmethod +diff --git a/src/pip/_internal/exceptions.py b/src/pip/_internal/exceptions.py +index d8a074f5b6..7eef1414c4 100644 +--- a/src/pip/_internal/exceptions.py ++++ b/src/pip/_internal/exceptions.py +@@ -106,8 +106,7 @@ def __init__(self, error_msg, response=None, request=None): + if (self.response is not None and not self.request and + hasattr(response, 'request')): + self.request = self.response.request +- super(NetworkConnectionError, self).__init__( +- error_msg, response, request) ++ super().__init__(error_msg, response, request) + + def __str__(self): + # type: () -> str +@@ -357,7 +356,7 @@ class ConfigurationFileCouldNotBeLoaded(ConfigurationError): + + def __init__(self, reason="could not be loaded", fname=None, error=None): + # type: (str, Optional[str], Optional[configparser.Error]) -> None +- super(ConfigurationFileCouldNotBeLoaded, self).__init__(error) ++ super().__init__(error) + self.reason = reason + self.fname = fname + self.error = error +diff --git a/src/pip/_internal/index/collector.py b/src/pip/_internal/index/collector.py +index b852645fd8..2715fcf92a 100644 +--- a/src/pip/_internal/index/collector.py ++++ b/src/pip/_internal/index/collector.py +@@ -68,7 +68,7 @@ def _match_vcs_scheme(url): + class _NotHTML(Exception): + def __init__(self, content_type, request_desc): + # type: (str, str) -> None +- super(_NotHTML, self).__init__(content_type, request_desc) ++ super().__init__(content_type, request_desc) + self.content_type = content_type + self.request_desc = request_desc + +diff --git a/src/pip/_internal/models/candidate.py b/src/pip/_internal/models/candidate.py +index 0d89a8c07d..d8a8d42ebc 100644 +--- a/src/pip/_internal/models/candidate.py ++++ b/src/pip/_internal/models/candidate.py +@@ -21,7 +21,7 @@ def __init__(self, name, version, link): + self.version = parse_version(version) # type: _BaseVersion + self.link = link + +- super(InstallationCandidate, self).__init__( ++ super().__init__( + key=(self.name, self.version, self.link), + defining_class=InstallationCandidate + ) +diff --git a/src/pip/_internal/models/index.py b/src/pip/_internal/models/index.py +index 0374d7f55e..7f3285692b 100644 +--- a/src/pip/_internal/models/index.py ++++ b/src/pip/_internal/models/index.py +@@ -10,7 +10,7 @@ class PackageIndex(object): + + def __init__(self, url, file_storage_domain): + # type: (str, str) -> None +- super(PackageIndex, self).__init__() ++ super().__init__() + self.url = url + self.netloc = urllib_parse.urlsplit(url).netloc + self.simple_url = self._url_for_path('simple') +diff --git a/src/pip/_internal/models/link.py b/src/pip/_internal/models/link.py +index 194d68f84d..6a1920f84b 100644 +--- a/src/pip/_internal/models/link.py ++++ b/src/pip/_internal/models/link.py +@@ -76,7 +76,7 @@ def __init__( + self.requires_python = requires_python if requires_python else None + self.yanked_reason = yanked_reason + +- super(Link, self).__init__(key=url, defining_class=Link) ++ super().__init__(key=url, defining_class=Link) + + self.cache_link_parsing = cache_link_parsing + +diff --git a/src/pip/_internal/network/cache.py b/src/pip/_internal/network/cache.py +index d2a1b7313f..582a7d72dc 100644 +--- a/src/pip/_internal/network/cache.py ++++ b/src/pip/_internal/network/cache.py +@@ -42,7 +42,7 @@ class SafeFileCache(BaseCache): + def __init__(self, directory): + # type: (str) -> None + assert directory is not None, "Cache directory must not be None." +- super(SafeFileCache, self).__init__() ++ super().__init__() + self.directory = directory + + def _get_cache_path(self, name): +diff --git a/src/pip/_internal/network/session.py b/src/pip/_internal/network/session.py +index 5839c4d28d..43ab1e18cd 100644 +--- a/src/pip/_internal/network/session.py ++++ b/src/pip/_internal/network/session.py +@@ -211,17 +211,13 @@ def close(self): + class InsecureHTTPAdapter(HTTPAdapter): + + def cert_verify(self, conn, url, verify, cert): +- super(InsecureHTTPAdapter, self).cert_verify( +- conn=conn, url=url, verify=False, cert=cert +- ) ++ super().cert_verify(conn=conn, url=url, verify=False, cert=cert) + + + class InsecureCacheControlAdapter(CacheControlAdapter): + + def cert_verify(self, conn, url, verify, cert): +- super(InsecureCacheControlAdapter, self).cert_verify( +- conn=conn, url=url, verify=False, cert=cert +- ) ++ super().cert_verify(conn=conn, url=url, verify=False, cert=cert) + + + class PipSession(requests.Session): +@@ -238,7 +234,7 @@ def __init__(self, *args, **kwargs): + trusted_hosts = kwargs.pop("trusted_hosts", []) # type: List[str] + index_urls = kwargs.pop("index_urls", None) + +- super(PipSession, self).__init__(*args, **kwargs) ++ super().__init__(*args, **kwargs) + + # Namespace the attribute with "pip_" just in case to prevent + # possible conflicts with the base class. +@@ -425,4 +421,4 @@ def request(self, method, url, *args, **kwargs): + kwargs.setdefault("timeout", self.timeout) + + # Dispatch the actual request +- return super(PipSession, self).request(method, url, *args, **kwargs) ++ return super().request(method, url, *args, **kwargs) +diff --git a/src/pip/_internal/network/xmlrpc.py b/src/pip/_internal/network/xmlrpc.py +index d025a145a3..6dd03eb0f9 100644 +--- a/src/pip/_internal/network/xmlrpc.py ++++ b/src/pip/_internal/network/xmlrpc.py +@@ -28,7 +28,7 @@ class PipXmlrpcTransport(xmlrpc_client.Transport): + + def __init__(self, index_url, session, use_datetime=False): + # type: (str, PipSession, bool) -> None +- xmlrpc_client.Transport.__init__(self, use_datetime) ++ super().__init__(use_datetime) + index_parts = urllib_parse.urlparse(index_url) + self._scheme = index_parts.scheme + self._session = session +diff --git a/src/pip/_internal/operations/install/wheel.py b/src/pip/_internal/operations/install/wheel.py +index 6dc68089e9..e822a7f8ad 100644 +--- a/src/pip/_internal/operations/install/wheel.py ++++ b/src/pip/_internal/operations/install/wheel.py +@@ -449,7 +449,7 @@ def save(self): + class MissingCallableSuffix(InstallationError): + def __init__(self, entry_point): + # type: (str) -> None +- super(MissingCallableSuffix, self).__init__( ++ super().__init__( + "Invalid script entry point: {} - A callable " + "suffix is required. Cf https://packaging.python.org/" + "specifications/entry-points/#use-for-scripts for more " +@@ -468,7 +468,7 @@ class PipScriptMaker(ScriptMaker): + def make(self, specification, options=None): + # type: (str, Dict[str, Any]) -> List[str] + _raise_for_invalid_entrypoint(specification) +- return super(PipScriptMaker, self).make(specification, options) ++ return super().make(specification, options) + + + def _install_wheel( +diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py +index f1321709b8..1550a60d1d 100644 +--- a/src/pip/_internal/operations/prepare.py ++++ b/src/pip/_internal/operations/prepare.py +@@ -298,7 +298,7 @@ def __init__( + lazy_wheel, # type: bool + ): + # type: (...) -> None +- super(RequirementPreparer, self).__init__() ++ super().__init__() + + self.src_dir = src_dir + self.build_dir = build_dir +diff --git a/src/pip/_internal/resolution/legacy/resolver.py b/src/pip/_internal/resolution/legacy/resolver.py +index b71e294ba7..665dba128a 100644 +--- a/src/pip/_internal/resolution/legacy/resolver.py ++++ b/src/pip/_internal/resolution/legacy/resolver.py +@@ -124,7 +124,7 @@ def __init__( + py_version_info=None, # type: Optional[Tuple[int, ...]] + ): + # type: (...) -> None +- super(Resolver, self).__init__() ++ super().__init__() + assert upgrade_strategy in self._allowed_strategies + + if py_version_info is None: +diff --git a/src/pip/_internal/resolution/resolvelib/candidates.py b/src/pip/_internal/resolution/resolvelib/candidates.py +index cd1f188706..275cb5105a 100644 +--- a/src/pip/_internal/resolution/resolvelib/candidates.py ++++ b/src/pip/_internal/resolution/resolvelib/candidates.py +@@ -304,7 +304,7 @@ def __init__( + template.link is template.original_link): + ireq.original_link_is_in_wheel_cache = True + +- super(LinkCandidate, self).__init__( ++ super().__init__( + link=link, + source_link=source_link, + ireq=ireq, +@@ -332,7 +332,7 @@ def __init__( + version=None, # type: Optional[_BaseVersion] + ): + # type: (...) -> None +- super(EditableCandidate, self).__init__( ++ super().__init__( + link=link, + source_link=link, + ireq=make_install_req_from_editable(link, template), +diff --git a/src/pip/_internal/resolution/resolvelib/resolver.py b/src/pip/_internal/resolution/resolvelib/resolver.py +index 751606f512..d30d696fc4 100644 +--- a/src/pip/_internal/resolution/resolvelib/resolver.py ++++ b/src/pip/_internal/resolution/resolvelib/resolver.py +@@ -57,7 +57,7 @@ def __init__( + upgrade_strategy, # type: str + py_version_info=None, # type: Optional[Tuple[int, ...]] + ): +- super(Resolver, self).__init__() ++ super().__init__() + assert upgrade_strategy in self._allowed_strategies + + self.factory = Factory( +diff --git a/src/pip/_internal/utils/hashes.py b/src/pip/_internal/utils/hashes.py +index 30d0498f39..30a7f4a69f 100644 +--- a/src/pip/_internal/utils/hashes.py ++++ b/src/pip/_internal/utils/hashes.py +@@ -153,7 +153,7 @@ def __init__(self): + """Don't offer the ``hashes`` kwarg.""" + # Pass our favorite hash in to generate a "gotten hash". With the + # empty list, it will never match, so an error will always raise. +- super(MissingHashes, self).__init__(hashes={FAVORITE_HASH: []}) ++ super().__init__(hashes={FAVORITE_HASH: []}) + + def _raise(self, gots): + # type: (Dict[str, _Hash]) -> NoReturn +diff --git a/src/pip/_internal/utils/logging.py b/src/pip/_internal/utils/logging.py +index fd9ff6561f..9fd1d42c70 100644 +--- a/src/pip/_internal/utils/logging.py ++++ b/src/pip/_internal/utils/logging.py +@@ -110,7 +110,7 @@ def __init__(self, *args, **kwargs): + with their record's timestamp. + """ + self.add_timestamp = kwargs.pop("add_timestamp", False) +- super(IndentingFormatter, self).__init__(*args, **kwargs) ++ super().__init__(*args, **kwargs) + + def get_message_start(self, formatted, levelno): + """ +@@ -133,7 +133,7 @@ def format(self, record): + Calls the standard formatter, but will indent all of the log message + lines by our current indentation level. + """ +- formatted = super(IndentingFormatter, self).format(record) ++ formatted = super().format(record) + message_start = self.get_message_start(formatted, record.levelno) + formatted = message_start + formatted + +@@ -169,7 +169,7 @@ class ColorizedStreamHandler(logging.StreamHandler): + COLORS = [] + + def __init__(self, stream=None, no_color=None): +- logging.StreamHandler.__init__(self, stream) ++ super().__init__(stream) + self._no_color = no_color + + if WINDOWS and colorama: +@@ -228,7 +228,7 @@ def handleError(self, record): + _is_broken_pipe_error(exc_class, exc)): + raise BrokenStdoutLoggingError() + +- return super(ColorizedStreamHandler, self).handleError(record) ++ return super().handleError(record) + + + class BetterRotatingFileHandler(logging.handlers.RotatingFileHandler): +@@ -256,7 +256,7 @@ class ExcludeLoggerFilter(Filter): + def filter(self, record): + # The base Filter class allows only records from a logger (or its + # children). +- return not super(ExcludeLoggerFilter, self).filter(record) ++ return not super().filter(record) + + + def setup_logging(verbosity, no_color, user_log_file): +diff --git a/src/pip/_internal/utils/temp_dir.py b/src/pip/_internal/utils/temp_dir.py +index dc369fb685..c97edc76d6 100644 +--- a/src/pip/_internal/utils/temp_dir.py ++++ b/src/pip/_internal/utils/temp_dir.py +@@ -121,7 +121,7 @@ def __init__( + kind="temp", # type: str + globally_managed=False, # type: bool + ): +- super(TempDirectory, self).__init__() ++ super().__init__() + + if delete is _default: + if path is not None: +@@ -231,7 +231,7 @@ class AdjacentTempDirectory(TempDirectory): + def __init__(self, original, delete=None): + # type: (str, Optional[bool]) -> None + self.original = original.rstrip('/\\') +- super(AdjacentTempDirectory, self).__init__(delete=delete) ++ super().__init__(delete=delete) + + @classmethod + def _generate_names(cls, name): +diff --git a/src/pip/_internal/utils/wheel.py b/src/pip/_internal/utils/wheel.py +index 4371e64b4a..c6dc4ccb0d 100644 +--- a/src/pip/_internal/utils/wheel.py ++++ b/src/pip/_internal/utils/wheel.py +@@ -32,13 +32,13 @@ class WheelMetadata(DictMetadata): + """ + def __init__(self, metadata, wheel_name): + # type: (Dict[str, bytes], str) -> None +- super(WheelMetadata, self).__init__(metadata) ++ super().__init__(metadata) + self._wheel_name = wheel_name + + def get_metadata(self, name): + # type: (str) -> str + try: +- return super(WheelMetadata, self).get_metadata(name) ++ return super().get_metadata(name) + except UnicodeDecodeError as e: + # Augment the default error with the origin of the file. + raise UnsupportedWheel( +diff --git a/src/pip/_internal/vcs/bazaar.py b/src/pip/_internal/vcs/bazaar.py +index e1649cc726..22969c726d 100644 +--- a/src/pip/_internal/vcs/bazaar.py ++++ b/src/pip/_internal/vcs/bazaar.py +@@ -31,7 +31,7 @@ class Bazaar(VersionControl): + ) + + def __init__(self, *args, **kwargs): +- super(Bazaar, self).__init__(*args, **kwargs) ++ super().__init__(*args, **kwargs) + # This is only needed for python <2.7.5 + # Register lp but do not expose as a scheme to support bzr+lp. + if getattr(urllib_parse, 'uses_fragment', None): +@@ -82,7 +82,7 @@ def update(self, dest, url, rev_options): + def get_url_rev_and_auth(cls, url): + # type: (str) -> Tuple[str, Optional[str], AuthInfo] + # hotfix the URL scheme after removing bzr+ from bzr+ssh:// readd it +- url, rev, user_pass = super(Bazaar, cls).get_url_rev_and_auth(url) ++ url, rev, user_pass = super().get_url_rev_and_auth(url) + if url.startswith('ssh://'): + url = 'bzr+' + url + return url, rev, user_pass +diff --git a/src/pip/_internal/vcs/git.py b/src/pip/_internal/vcs/git.py +index 772a160be9..46f15fc8b4 100644 +--- a/src/pip/_internal/vcs/git.py ++++ b/src/pip/_internal/vcs/git.py +@@ -393,10 +393,10 @@ def get_url_rev_and_auth(cls, url): + if '://' not in url: + assert 'file:' not in url + url = url.replace('git+', 'git+ssh://') +- url, rev, user_pass = super(Git, cls).get_url_rev_and_auth(url) ++ url, rev, user_pass = super().get_url_rev_and_auth(url) + url = url.replace('ssh://', '') + else: +- url, rev, user_pass = super(Git, cls).get_url_rev_and_auth(url) ++ url, rev, user_pass = super().get_url_rev_and_auth(url) + + return url, rev, user_pass + +@@ -411,7 +411,7 @@ def update_submodules(cls, location): + + @classmethod + def get_repository_root(cls, location): +- loc = super(Git, cls).get_repository_root(location) ++ loc = super().get_repository_root(location) + if loc: + return loc + try: +diff --git a/src/pip/_internal/vcs/mercurial.py b/src/pip/_internal/vcs/mercurial.py +index 1dded80889..1c84266742 100644 +--- a/src/pip/_internal/vcs/mercurial.py ++++ b/src/pip/_internal/vcs/mercurial.py +@@ -134,7 +134,7 @@ def get_subdirectory(cls, location): + + @classmethod + def get_repository_root(cls, location): +- loc = super(Mercurial, cls).get_repository_root(location) ++ loc = super().get_repository_root(location) + if loc: + return loc + try: +diff --git a/src/pip/_internal/vcs/subversion.py b/src/pip/_internal/vcs/subversion.py +index dcdbbcdd54..3bb7ea0f85 100644 +--- a/src/pip/_internal/vcs/subversion.py ++++ b/src/pip/_internal/vcs/subversion.py +@@ -84,7 +84,7 @@ def get_netloc_and_auth(cls, netloc, scheme): + if scheme == 'ssh': + # The --username and --password options can't be used for + # svn+ssh URLs, so keep the auth information in the URL. +- return super(Subversion, cls).get_netloc_and_auth(netloc, scheme) ++ return super().get_netloc_and_auth(netloc, scheme) + + return split_auth_from_netloc(netloc) + +@@ -92,7 +92,7 @@ def get_netloc_and_auth(cls, netloc, scheme): + def get_url_rev_and_auth(cls, url): + # type: (str) -> Tuple[str, Optional[str], AuthInfo] + # hotfix the URL scheme after removing svn+ from svn+ssh:// readd it +- url, rev, user_pass = super(Subversion, cls).get_url_rev_and_auth(url) ++ url, rev, user_pass = super().get_url_rev_and_auth(url) + if url.startswith('ssh://'): + url = 'svn+' + url + return url, rev, user_pass +@@ -197,7 +197,7 @@ def __init__(self, use_interactive=None): + # Empty tuple: Could not parse version. + self._vcs_version = None # type: Optional[Tuple[int, ...]] + +- super(Subversion, self).__init__() ++ super().__init__() + + def call_vcs_version(self): + # type: () -> Tuple[int, ...] +diff --git a/src/pip/_internal/vcs/versioncontrol.py b/src/pip/_internal/vcs/versioncontrol.py +index 3500d1690a..35caf19157 100644 +--- a/src/pip/_internal/vcs/versioncontrol.py ++++ b/src/pip/_internal/vcs/versioncontrol.py +@@ -287,7 +287,7 @@ def __init__(self): + # systems + urllib_parse.uses_netloc.extend(self.schemes) + urllib_parse.uses_fragment.extend(self.schemes) +- super(VcsSupport, self).__init__() ++ super().__init__() + + def __iter__(self): + # type: () -> Iterator[str] +diff --git a/tests/lib/__init__.py b/tests/lib/__init__.py +index bdf50c6f70..954145b0a0 100644 +--- a/tests/lib/__init__.py ++++ b/tests/lib/__init__.py +@@ -506,7 +506,7 @@ def __init__(self, base_path, *args, **kwargs): + self.pip_expect_warning = kwargs.pop('pip_expect_warning', None) + + # Call the TestFileEnvironment __init__ +- super(PipTestEnvironment, self).__init__(base_path, *args, **kwargs) ++ super().__init__(base_path, *args, **kwargs) + + # Expand our absolute path directories into relative + for name in ["base", "venv", "bin", "lib", "site_packages", +@@ -531,7 +531,7 @@ def _ignore_file(self, fn): + if fn.endswith('__pycache__') or fn.endswith(".pyc"): + result = True + else: +- result = super(PipTestEnvironment, self)._ignore_file(fn) ++ result = super()._ignore_file(fn) + return result + + def _find_traverse(self, path, result): +@@ -542,7 +542,7 @@ def _find_traverse(self, path, result): + if not self.temp_path or path != 'tmp': + result[path] = FoundDir(self.base_path, path) + else: +- super(PipTestEnvironment, self)._find_traverse(path, result) ++ super()._find_traverse(path, result) + + def run(self, *args, **kw): + """ +@@ -620,7 +620,7 @@ def run(self, *args, **kw): + # 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) ++ result = super().run(cwd=cwd, *args, **kw) + + if expect_error and not allow_error: + if result.returncode == 0: +diff --git a/tests/lib/server.py b/tests/lib/server.py +index b0b802689d..cd3c522bfe 100644 +--- a/tests/lib/server.py ++++ b/tests/lib/server.py +@@ -56,7 +56,7 @@ def blocked_signals(): + + class _RequestHandler(WSGIRequestHandler): + def make_environ(self): +- environ = super(_RequestHandler, self).make_environ() ++ environ = super().make_environ() + + # From pallets/werkzeug#1469, will probably be in release after + # 0.16.0. +diff --git a/tests/unit/test_base_command.py b/tests/unit/test_base_command.py +index 8ba3d9e252..6d60ca0942 100644 +--- a/tests/unit/test_base_command.py ++++ b/tests/unit/test_base_command.py +@@ -27,11 +27,11 @@ def run_func(): + raise SystemExit(1) + + self.run_func = run_func +- super(FakeCommand, self).__init__(self._name, self._name) ++ super().__init__(self._name, self._name) + + def main(self, args): + args.append("--disable-pip-version-check") +- return super(FakeCommand, self).main(args) ++ return super().main(args) + + def run(self, options, args): + logging.getLogger("pip.tests").info("fake") +diff --git a/tests/unit/test_format_control.py b/tests/unit/test_format_control.py +index 0e15279818..f8498e8e5d 100644 +--- a/tests/unit/test_format_control.py ++++ b/tests/unit/test_format_control.py +@@ -8,7 +8,7 @@ + class SimpleCommand(Command): + + def __init__(self): +- super(SimpleCommand, self).__init__('fake', 'fake summary') ++ super().__init__('fake', 'fake summary') + + def add_options(self): + self.cmd_opts.add_option(cmdoptions.no_binary()) diff --git a/python-pip.spec b/python-pip.spec index 3d035b59a33f24b5c58f6925acf4d9cb6a79f840..adb6f5a3f172caaceaaab2873f7fdbcf8440215e 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -6,7 +6,7 @@ pip is the package installer for Python. You can use pip to install packages fro %global bashcompdir %(b=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null); echo ${b:-%{_sysconfdir}/bash_completion.d}) Name: python-%{srcname} Version: 20.2.2 -Release: 3 +Release: 4 Summary: A tool for installing and managing Python packages License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and (ASL 2.0 or BSD) URL: http://www.pip-installer.org @@ -16,6 +16,8 @@ Patch1: allow-stripping-given-prefix-from-wheel-RECORD-files.patch Patch2: emit-a-warning-when-running-with-root-privileges.patch Patch3: remove-existing-dist-only-if-path-conflicts.patch Patch6000: dummy-certifi.patch +Patch6001: e993c2cf4ec23050d300cbe817dbf46a0cadc992.patch +Patch6002: f91ba6b348c467f8c97dc959b413cc6fd13ae199.patch Source10: pip-allow-older-versions.patch %description %{_description} @@ -112,6 +114,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* 20201226035849754498 patch-tracking 20.2.2-4 +- append patch file of upstream repository from to + * Wed Nov 4 2020 wangjie -20.2.2-3 - Type:NA - ID:NA @@ -161,4 +166,4 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} - DESC: Synchronize a patch * Mon Sep 23 2019 openEuler Buildteam - 18.0-6 -- Package init +- Package init \ No newline at end of file