-
Notifications
You must be signed in to change notification settings - Fork 7
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
Enforce hash checks #172
Enforce hash checks #172
Conversation
…last chunk of the data with sha256
Have you tested this? Even locally with a few files? I'm asking because the logic where we retrieve the last part of the file might be prone to errors. |
Yes I tested locally with local files, also very small ones and get same results. |
@@ -188,7 +202,7 @@ def download_via_name(self, name: str) -> None: | |||
os.makedirs(os.path.dirname(output),exist_ok=True) | |||
LOGGER.info(f"Creating Folder {os.path.dirname(output)}") | |||
|
|||
if Path(output).is_file() and self.calculate_partial_file_hash(output) == HASH_DICT.get(name): | |||
if Path(output).is_file() and self.calculate_partial_file_hash(output) == HASH_DICT[name]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is intentional. when a new file is meant to be downloaded but not yet in the hash_dict, you get a key_error, indicating you should update the dict with the new hash
No description provided.