Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix for text file issue (#4) #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion filehash/filehash.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def verify_checksums(self, checksum_filename):
with open(checksum_filename, mode="r") as checksum_list:
for line in checksum_list:
expected_hash, filename = line.strip().split(" ", 1)
if filename.startswith("*"):
if filename.startswith("*") or filename.startswith(" "):
filename = filename[1:]
actual_hash = self.hash_file(filename)
result.append(VerifyHashResult(filename, expected_hash == actual_hash))
Expand Down
2 changes: 1 addition & 1 deletion testdata/hashes.md5
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
72f5d9e3a5fa2f2e591487ae02489388 *lorem_ipsum.txt
72f5d9e3a5fa2f2e591487ae02489388 lorem_ipsum.txt
860f55178330e675fb0d55ac1f2c27b2 *lorem_ipsum.zip
2 changes: 1 addition & 1 deletion testdata/hashes.sha1
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
f7ef3b7afaf1518032da1b832436ef3bbfd4e6f0 *lorem_ipsum.txt
f7ef3b7afaf1518032da1b832436ef3bbfd4e6f0 lorem_ipsum.txt
03da86258449317e8834a54cf8c4d5b41e7c7128 *lorem_ipsum.zip
2 changes: 1 addition & 1 deletion testdata/hashes.sha256
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
52ee30e57cc262b84ff73377223818825583b8120394ef54e9b4cd7dbec57d18 *lorem_ipsum.txt
52ee30e57cc262b84ff73377223818825583b8120394ef54e9b4cd7dbec57d18 lorem_ipsum.txt
8acac0dc358b981aef0dcecc6e6d8f4f1fb98968d61e613b430b2389d9d385e5 *lorem_ipsum.zip
2 changes: 1 addition & 1 deletion testdata/hashes.sha512
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dfc4e13af6e57b4982bdac595e83804dcb2d126204baa290f19015982d13e822a07efa1f0e63a8078e10f219c69d26caf4f21a50e3dd5bdf09bea73dfe224e43 *lorem_ipsum.txt
dfc4e13af6e57b4982bdac595e83804dcb2d126204baa290f19015982d13e822a07efa1f0e63a8078e10f219c69d26caf4f21a50e3dd5bdf09bea73dfe224e43 lorem_ipsum.txt
edd841dd0ed5bb09fd21054de3aebbbd44d779beaa0289d63bfb64f0eaaa85c73993d5cbc0d0d1dfcc263d7bd8d43bdafe2bcc398cc8453823e50f0d90a3b0ff *lorem_ipsum.zip