You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When migrating from python 2.7 runtime to python 3 (3.8 for me) will will fail to load anything from redis with the following exception (once revealed):
Traceback (most recent call last):
File "/opt/willbot/will/backends/encryption/aes.py", line 57, in decrypt_from_b64
return pickle.loads(binascii.a2b_base64(decrypted_data.decode('utf8')))
File "/opt/pyenv/lib/python3.8/site-packages/dill/_dill.py", line 283, in loads
return load(file, ignore, **kwds)
File "/opt/pyenv/lib/python3.8/site-packages/dill/_dill.py", line 278, in load
return Unpickler(file, ignore=ignore, **kwds).load()
File "/opt/pyenv/lib/python3.8/site-packages/dill/_dill.py", line 481, in load
obj = StockUnpickler.load(self)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)
The fix is to explicitly tell pickle what encoding to use:
When migrating from python 2.7 runtime to python 3 (3.8 for me) will will fail to load anything from redis with the following exception (once revealed):
The fix is to explicitly tell pickle what encoding to use:
Reference: https://stackoverflow.com/a/28218598
The text was updated successfully, but these errors were encountered: