Just thought I would post the fix here:
from string import join from array import array import sha, base64i from time import time # This fix https://mail.python.org/pipermail/python-list/2010-January/563791.html # Place the 6 lines of code below after the imports then replace every occurrence of "L" with unit32 in the py3 code for typecode in 'IL': if len(array(typecode, [0]).tostring()) == 4: uint32 = typecode break else: raise RuntimeError("Neither 'I' nor 'L' are unsigned 32-bit integers.") class CryptError(Exception): pass def _hash(str): return sha.new(str).digest() # rest of py3 code