Skip to content

Commit

Permalink
Fix archive hash generation
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed Aug 27, 2021
1 parent 2439ded commit 8238cab
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 8238cab

Please sign in to comment.