diff --git a/7369ac2ee85815d4a059c667cc415f2000df7ed5.patch b/7369ac2ee85815d4a059c667cc415f2000df7ed5.patch new file mode 100644 index 0000000000000000000000000000000000000000..57ee228e23156a94db3762837e0a71242d2625f4 --- /dev/null +++ b/7369ac2ee85815d4a059c667cc415f2000df7ed5.patch @@ -0,0 +1,119 @@ +diff --git a/news/7edb0afc-938e-457b-ae6e-0905e7443b2f.trivial.rst b/news/7edb0afc-938e-457b-ae6e-0905e7443b2f.trivial.rst +new file mode 100644 +index 0000000000..e69de29bb2 +diff --git a/src/pip/_internal/configuration.py b/src/pip/_internal/configuration.py +index 559c198c77..9d9a36e807 100644 +--- a/src/pip/_internal/configuration.py ++++ b/src/pip/_internal/configuration.py +@@ -22,7 +22,7 @@ + ConfigurationFileCouldNotBeLoaded, + ) + from pip._internal.utils import appdirs +-from pip._internal.utils.compat import WINDOWS, expanduser ++from pip._internal.utils.compat import WINDOWS + from pip._internal.utils.misc import ensure_dir, enum + from pip._internal.utils.typing import MYPY_CHECK_RUNNING + +@@ -80,7 +80,7 @@ def get_configuration_files(): + + site_config_file = os.path.join(sys.prefix, CONFIG_BASENAME) + legacy_config_file = os.path.join( +- expanduser('~'), ++ os.path.expanduser('~'), + 'pip' if WINDOWS else '.pip', + CONFIG_BASENAME, + ) +diff --git a/src/pip/_internal/utils/compat.py b/src/pip/_internal/utils/compat.py +index dc351b804b..0ae0483c81 100644 +--- a/src/pip/_internal/utils/compat.py ++++ b/src/pip/_internal/utils/compat.py +@@ -139,19 +139,6 @@ def get_path_uid(path): + return file_uid + + +-def expanduser(path): +- # type: (str) -> str +- """ +- Expand ~ and ~user constructions. +- +- Includes a workaround for https://bugs.python.org/issue14768 +- """ +- expanded = os.path.expanduser(path) +- if path.startswith('~/') and expanded.startswith('//'): +- expanded = expanded[1:] +- return expanded +- +- + # packages in the stdlib that may have installation metadata, but should not be + # considered 'installed'. this theoretically could be determined based on + # dist.location (py27:`sysconfig.get_paths()['stdlib']`, +diff --git a/src/pip/_internal/utils/misc.py b/src/pip/_internal/utils/misc.py +index 85e26a0214..65a8c13bd8 100644 +--- a/src/pip/_internal/utils/misc.py ++++ b/src/pip/_internal/utils/misc.py +@@ -28,7 +28,7 @@ + from pip import __version__ + from pip._internal.exceptions import CommandError + from pip._internal.locations import get_major_minor_version, site_packages, user_site +-from pip._internal.utils.compat import WINDOWS, expanduser, stdlib_pkgs ++from pip._internal.utils.compat import WINDOWS, stdlib_pkgs + from pip._internal.utils.typing import MYPY_CHECK_RUNNING, cast + from pip._internal.utils.virtualenv import ( + running_under_virtualenv, +@@ -302,7 +302,7 @@ def normalize_path(path, resolve_symlinks=True): + Convert a path to its canonical, case-normalized, absolute version. + + """ +- path = expanduser(path) ++ path = os.path.expanduser(path) + if resolve_symlinks: + path = os.path.realpath(path) + else: +diff --git a/tests/unit/test_collector.py b/tests/unit/test_collector.py +index 90d8f8d0fe..9fb920b32f 100644 +--- a/tests/unit/test_collector.py ++++ b/tests/unit/test_collector.py +@@ -733,7 +733,7 @@ def test_link_collector_create( + assert search_scope.index_urls == expected_index_urls + + +-@patch('pip._internal.utils.misc.expanduser') ++@patch('os.path.expanduser') + def test_link_collector_create_find_links_expansion( + mock_expanduser, tmpdir, + ): +diff --git a/tests/unit/test_compat.py b/tests/unit/test_compat.py +index c1dee67d29..655e45ab75 100644 +--- a/tests/unit/test_compat.py ++++ b/tests/unit/test_compat.py +@@ -5,12 +5,7 @@ + import pytest + + import pip._internal.utils.compat as pip_compat +-from pip._internal.utils.compat import ( +- console_to_str, +- expanduser, +- get_path_uid, +- str_to_display, +-) ++from pip._internal.utils.compat import console_to_str, get_path_uid, str_to_display + + + def test_get_path_uid(): +@@ -127,16 +122,3 @@ def check_warning(msg, *args, **kwargs): + monkeypatch.setattr(locale, 'getpreferredencoding', lambda: 'utf-8') + monkeypatch.setattr(pip_compat.logger, 'warning', check_warning) + console_to_str(some_bytes) +- +- +-@pytest.mark.parametrize("home,path,expanded", [ +- ("/Users/test", "~", "/Users/test"), +- ("/Users/test", "~/.cache", "/Users/test/.cache"), +- # Verify that we are not affected by https://bugs.python.org/issue14768 +- ("/", "~", "/"), +- ("/", "~/.cache", "/.cache"), +-]) +-def test_expanduser(home, path, expanded, monkeypatch): +- monkeypatch.setenv("HOME", home) +- monkeypatch.setenv("USERPROFILE", home) +- assert expanduser(path) == expanded diff --git a/python-pip.spec b/python-pip.spec index 3d035b59a33f24b5c58f6925acf4d9cb6a79f840..a7b8ac0bddc02a62a479a8385cab46a9212cf2de 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,7 @@ 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: 7369ac2ee85815d4a059c667cc415f2000df7ed5.patch Source10: pip-allow-older-versions.patch %description %{_description} @@ -112,6 +113,9 @@ install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir} %{python_wheeldir}/%{python_wheelname} %changelog +* 20201230035849754080 patch-tracking 20.2.2-4 +- append patch file of upstream repository from <7369ac2ee85815d4a059c667cc415f2000df7ed5> to <7369ac2ee85815d4a059c667cc415f2000df7ed5> + * Wed Nov 4 2020 wangjie -20.2.2-3 - Type:NA - ID:NA @@ -161,4 +165,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