reload has been removed from Python3.
Don’t compare None and integers.
hashlib.md5 expects binary as argument.
hashlib.sha1 expects bytes.