> >> def file_to_hash(path, m=None):
> >> if m is None:
> >> m = hashlib.md5()

> The first call will give you the correct checksum, the second: not. As the
> default md5 instance remembers the state from the previous function call
> you'll get the checksum of both files combined.

Ouch. That was it.

Python sucks. m = md5() looks like an initial assignment, not a
special magic storage mode. Principle of least surprise fail, and
principle of most helpful default behavior fail.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to