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

Bugfix: don't unquote file URL #4514

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/4089.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug that percent encoded characters will be unquoted incorrectly in the file URL.
8 changes: 4 additions & 4 deletions pipenv/vendor/requirementslib/models/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ def from_pipfile(cls, name, pipfile):
if link_info:
link = link_info.link
if link.url_without_fragment:
uri = unquote(link.url_without_fragment)
uri = link.url_without_fragment
extras = () # type: Optional[Tuple[STRING_TYPE, ...]]
if "extras" in pipfile:
extras = tuple(pipfile["extras"]) # type: ignore
Expand All @@ -1821,10 +1821,10 @@ def from_pipfile(cls, name, pipfile):
else:
if name:
line_name = "{0}{1}".format(name, extras_string)
line = "{0}#egg={1}".format(unquote(link.url_without_fragment), line_name)
line = "{0}#egg={1}".format(link.url_without_fragment, line_name)
else:
if link:
line = unquote(link.url)
line = link.url
elif uri and isinstance(uri, six.string_types):
line = uri
else:
Expand All @@ -1847,7 +1847,7 @@ def line_part(self):
link_url = None # type: Optional[STRING_TYPE]
seed = None # type: Optional[STRING_TYPE]
if self.link is not None:
link_url = unquote(self.link.url_without_fragment)
link_url = self.link.url_without_fragment
is_vcs = getattr(self.link, "is_vcs", not self.link.is_artifact)
if self._uri_scheme and self._uri_scheme == "path":
# We may need any one of these for passing to pip
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/requirementslib/models/setup_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from packaging.markers import Marker
from pip_shims.utils import call_function_with_correct_args
from six.moves import configparser
from six.moves.urllib.parse import unquote, urlparse, urlunparse
from six.moves.urllib.parse import urlparse, urlunparse
from vistir.compat import FileNotFoundError, Iterable, Mapping, Path, finalize, lru_cache
from vistir.contextmanagers import cd, temp_path
from vistir.misc import run
Expand Down Expand Up @@ -1893,7 +1893,7 @@ def from_ireq(cls, ireq, subdir=None, finder=None, session=None):
session = cmd._build_session(options)
finder = cmd._build_package_finder(options, session)
tempdir_manager = stack.enter_context(pip_shims.shims.global_tempdir_manager())
vcs, uri = split_vcs_method_from_uri(unquote(ireq.link.url_without_fragment))
vcs, uri = split_vcs_method_from_uri(ireq.link.url_without_fragment)
parsed = urlparse(uri)
if "file" in parsed.scheme:
url_path = parsed.path
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ requests==2.23.0
idna==2.9
urllib3==1.25.9
certifi==2020.4.5.1
requirementslib==1.5.14
requirementslib==1.5.15
attrs==19.3.0
distlib==0.3.0
packaging==20.3
Expand Down