diff --git a/news/5846.bugfix.rst b/news/5846.bugfix.rst new file mode 100644 index 00000000..a8829f66 --- /dev/null +++ b/news/5846.bugfix.rst @@ -0,0 +1 @@ +Fix regression with ``ssh://`` vcs URLs introduced in ``2023.8.21`` whereby ssh vcs URLs are expected to have at least one ``@`` symbol. diff --git a/pipenv/utils/dependencies.py b/pipenv/utils/dependencies.py index 01455ca0..095ec399 100644 --- a/pipenv/utils/dependencies.py +++ b/pipenv/utils/dependencies.py @@ -977,7 +977,9 @@ def install_req_from_pipfile(name, pipfile): if vcs: vcs_url = _pipfile[vcs] fallback_ref = "" - if "@" in vcs_url: + if ("ssh://" in vcs_url and vcs_url.count("@") >= 2) or ( + "ssh://" not in vcs_url and "@" in vcs_url + ): vcs_url_parts = vcs_url.rsplit("@", 1) vcs_url = vcs_url_parts[0] fallback_ref = vcs_url_parts[1] diff --git a/pipenv/utils/requirements.py b/pipenv/utils/requirements.py index 8e615fe6..0168049c 100644 --- a/pipenv/utils/requirements.py +++ b/pipenv/utils/requirements.py @@ -156,7 +156,9 @@ def requirement_from_lockfile( if vcs in package_info: url = package_info[vcs] ref = package_info.get("ref", "") - if "@" in url: + if ("ssh://" in url and url.count("@") >= 2) or ( + "ssh://" not in url and "@" in url + ): url_parts = url.rsplit("@", 1) url = url_parts[0] if not ref: