Fix Python import sha/md5 deprecated warnings
While looking for a way to decrypt eReader files so that I can read previously purchased ebooks in PDB format on my Palm Pre, I found a python script (ereader2html.py) that purports to remove the encryption.
However, upon initial execution, I got the following error:
DeprecationWarning: the sha module is deprecated;
use the hashlib module instead
Some quick Googling later, it looks like the fix is pretty simple.
- Replace the import sha with import hashlib.
- Replace all occurrences of sha.new() with hashlib.sha1()