Skip to content

Commit

Permalink
fix sha1sum for filenames with escaped characters
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Jun 7, 2018
1 parent e8d712f commit 3e2cd3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bundlewrap/utils/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ def sha1(self):
result = self.node.run("sha1 -q -- {}".format(quote(self.path)))
else:
result = self.node.run("sha1sum -- {}".format(quote(self.path)))
return force_text(result.stdout).strip().split()[0]
# sha1sum adds a leading backslash to hashes of files whose name
# contains backslash-escaped characters – we must lstrip() that
return force_text(result.stdout).strip().lstrip("\\").split()[0]

@cached_property
def sha256(self):
Expand Down

0 comments on commit 3e2cd3c

Please sign in to comment.