Skip to content
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

Properly handle capitalized hashes #214

Merged
merged 5 commits into from
Nov 24, 2020
Merged

Properly handle capitalized hashes #214

merged 5 commits into from
Nov 24, 2020

Conversation

leouieda
Copy link
Member

On Windows, users might sometimes get capitalized hashes from the system. To avoid false hash mismatches, convert stored and computed hashes to lowercase before doing comparisons. Convert hashes to lowercase when reading from the registry to make sure stored hashes are always lowercase. While we're at it, refactor the hash_matches tests to use pytest.mark.parametrize and allow the hash algorithm string to be upper or lowercase.

Fixes #193

Reminders:

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst and the base __init__.py file for the package.
  • Write detailed docstrings for all functions/classes/methods. It often helps to design better code if you write the docstrings first.
  • If adding new functionality, add an example to the docstring, gallery, and/or tutorials.
  • Add your full name, affiliation, and ORCID (optional) to the 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.

@leouieda
Copy link
Member Author

@jrleeman hopefully this fixes the problem. Would you mind taking a quick look?

@leouieda
Copy link
Member Author

Merging this in for the next release and we can add any needed fixes if they come up. This doesn’t break anything so there should be no harm (famous last words)

@leouieda leouieda merged commit a4026b4 into master Nov 24, 2020
@leouieda leouieda deleted the hash-capitalization branch November 24, 2020 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle hash capitalization
1 participant