to-mc / checksumdir

Simple package to compute a single deterministic hash of the file contents of a directory.
MIT License
94 stars 28 forks source link

Return a null digest if the file doesn't exist #11

Closed kevin-brown closed 5 years ago

kevin-brown commented 5 years ago

For cases where a symlink exists and is pointing to a file which does not exist, an error is thrown when you attempt to open that file because while the path you gave was valid, the file itself cannot be opened by the system. This changes the behaviour so instead of throwing an error, an empty hex digest is returned instead.

I can't think of another case where os.walk will give you a path back that does not exist, so I'm not too concerned about this breaking other behaviour unintentionally.