You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating hashes for empty files will always return None, which is not documented and different from the usual hashing algorithms as well as contradicting the SPDX standard.
Stefan: Thanks for the report!
This is intentional because there is a lot of emptiness out there! Returning None for empty files has been a design choice to avoid creating dummy checksums.
FWIW, this predates SPDX and this library is not SPDX specific .... With this said, this has not been documented correctly and should be documented. I will keep this open until we document this alright.
Generating hashes for empty files will always return
None
, which is not documented and different from the usual hashing algorithms as well as contradicting the SPDX standard.Example:
The reason seems to be that
commoncode/src/commoncode/hash.py
Line 38 in 878be61
msg is not None
, but basicallybool(msg)
, which isFalse
for empty inputs as well.Replacing the line with
(as well as replacing the same pattern in
sha1_git_hasher
) seems to fix this issue.The text was updated successfully, but these errors were encountered: