possible fix to "TypeError: Unicode-objects must be encoded before hashing" on python3