diff --git a/mvt/common/command.py b/mvt/common/command.py index 748803e..0771f80 100644 --- a/mvt/common/command.py +++ b/mvt/common/command.py @@ -105,8 +105,12 @@ class Command(object): file_path = os.path.join(root, file) h = hashlib.sha256() - with open(file_path, "rb") as handle: - h.update(handle.read()) + try: + with open(file_path, "rb") as handle: + h.update(handle.read()) + except PermissionError: + log.error("Failed to hash the file %s: permission denied", file_path) + continue info["hashes"].append({ "file_path": file_path,