Open file in binary mode for SHA1 computation

Fixes #13.
This commit is contained in:
Łukasz Langa 2015-11-02 16:23:18 -08:00
parent 0f4ebfa4fa
commit 539c277bd8

View File

@ -48,7 +48,7 @@ IGNORED_FILE_SYSTEM_ERRORS = {errno.ENOENT, errno.EACCES}
def sha1(path, chunk_size):
digest = hashlib.sha1()
with open(path) as f:
with open(path, 'rb') as f:
d = f.read(chunk_size)
while d:
digest.update(d)