mirror of
https://github.com/mvt-project/mvt.git
synced 2024-06-29 07:39:00 +00:00
Fixes hashing issue
This commit is contained in:
parent
801fe367ac
commit
a2cbaacfce
|
@ -161,9 +161,12 @@ def get_sha256_from_file_path(file_path: str) -> str:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
sha256_hash = hashlib.sha256()
|
sha256_hash = hashlib.sha256()
|
||||||
with open(file_path, "rb") as handle:
|
try:
|
||||||
for byte_block in iter(lambda: handle.read(4096), b""):
|
with open(file_path, "rb") as handle:
|
||||||
sha256_hash.update(byte_block)
|
for byte_block in iter(lambda: handle.read(4096), b""):
|
||||||
|
sha256_hash.update(byte_block)
|
||||||
|
except OSError:
|
||||||
|
return ""
|
||||||
|
|
||||||
return sha256_hash.hexdigest()
|
return sha256_hash.hexdigest()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user