decoding tweak for python 3