Skip to content

Bug: 404 error while calculating hashes with 2023.8.28 #5894

@matejsp

Description

@matejsp

Issue description

when upgrading from pipenv 2023.7.3 to 2023.8.28. First there is very verbose logging for INFO:pipenv.patched.pip._internal.operations.prepare. In another bug.

For some repostories (like nexus) that used to return md5 instead of sha256, pipenv downloads the file and calculates the hash.
It seems that automatic calculation of hash in case md5 is used in nexus it uses incorrect url.

INFO:pipenv.patched.pip._internal.operations.prepare:Collecting wcmatch==8.3 (from semgrep==0.78.0->-r /var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pipenv-jgl0rhw4-requirements/pipenv-an17je3b-constraints.txt (line 19))
INFO:pipenv.patched.pip._internal.network.download:Using cached https://nexus.company.net/repository/pypi-blessed/packages/wcmatch/8.3/wcmatch-8.3-py3-none-any.whl (42 kB)

Downloading file wcmatch-8.3-py3-none-any.whl to obtain hash...
HTTP error 404 while getting https://u:p@nexus.company.net/packages/wcmatch/8.3/wcmatch-8.3-py3-none-any.whl#md5=8d2acdbf5586e2175b9f88d16e599ac8
Downloading file wcmatch-8.3.tar.gz to obtain hash...
HTTP error 404 while getting https://u:p@nexus.company.net/packages/wcmatch/8.3/wcmatch-8.3.tar.gz#md5=d3e45a9f6853ebbb4d64c60d279de2f8
Downloading file wcmatch-8.3.tar.gz to obtain hash...
Downloading file wcmatch-8.3-py3-none-any.whl to obtain hash...

When resolving downloading hashes part of url is missing. But it works when downloading original whl or tar.gz.

[[source]]
name = "nexus"
url = "https://u:p@nexus.company.net/repository/pypi-blessed/simple"
verify_ssl = true

Expected result

It should download from correct url and calculate the hash.

Actual result

It fetches from wrongly build url and gets 404 from the nexus.

Steps to replicate

It seems that this behaviour works for https://pypi.python.org/simple because /simple is at root.
However for https://u:p@nexus.company.net/repository/pypi-blessed/simple it does not.

Pipfile:
[[source]]
name = "nexus"
url = "https://u:p@nexus.company.net/repository/pypi-blessed/simple"
verify_ssl = true


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: RegressionThis issue is a regression of a previous behavior.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions