-
Notifications
You must be signed in to change notification settings - Fork 74
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
Move all hash checking to hash_matches #157
Conversation
Including the exception raising controlled by new parameter `strict`. This removes the need for re-calculating the new hash just so we can include it in the error message. The hash calculation can be heavy for large files so we don't want to do it twice. Also improve the error message to include the hash algorithm and suggest what went wrong.
Forgot to include in the check and had misformatted error message
I'm assuming that the |
@danshapero right, I forgot to add the extra tests to this PR. I'll add some explicit tests for this function (right now it gets tested as part of Both cases are used within |
Thanks for the review, by the way 🙂 Much appreciated |
Fixes a regression introduced in #157 where we started including the name of the temporary download file in the exception again. However, since the download is deleted in case of hash mismatch, it's also not very useful to print the name of a file that doesn't exist. Instead, I included the download URL in the exception so that a user can download for themselves and check.
Fixes a regression introduced in #157 where we started including the name of the temporary download file in the exception again. Revert back to including the name of the file in the registry.
Including the exception raising controlled by new parameter
strict
.This removes the need for re-calculating the new hash just so we can
include it in the error message. The hash calculation can be heavy
for large files so we don't want to do it twice. Also improve the error
message to include the hash algorithm and suggest what went wrong.
Working towards #152
Reminders:
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
and the base__init__.py
file for the package.AUTHORS.md
file (if you haven't already) in case you'd like to be listed as an author on the Zenodo archive of the next release.