Skip to content

Commit

Permalink
Merge pull request #4444 from python-poetry/1.1-fix-archive-hash-gene…
Browse files Browse the repository at this point in the history
…ration

[1.1] Fix archive hash generation
  • Loading branch information
sdispater committed Aug 27, 2021
2 parents 2439ded + 8238cab commit 8268795
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,13 @@ def _download_link(self, operation, link):
archive = self._chef.prepare(archive)

if package.files:
archive_hash = "sha256:" + FileDependency(package.name, archive).hash()
archive_hash = (
"sha256:"
+ FileDependency(
package.name,
Path(archive.path) if isinstance(archive, Link) else archive,
).hash()
)
if archive_hash not in {f["hash"] for f in package.files}:
raise RuntimeError(
"Invalid hash for {} using archive {}".format(package, archive.name)
Expand Down

0 comments on commit 8268795

Please sign in to comment.