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 I use 'get' method to get a serialized string from redis :
val = await redis_connection.get(key)
File "/usr/local/lib/python3.6/site-packages/asyncio_redis/protocol.py", line 678, in wrapper
result = yield from post_process(protocol_self, result)
File "/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/coroutines.py", line 210, in coro
res = func(*args, **kw)
File "/usr/local/lib/python3.6/site-packages/asyncio_redis/protocol.py", line 406, in bytes_to_native_or_none
return protocol.decode_to_native(result)
File "/usr/local/lib/python3.6/site-packages/asyncio_redis/encoders.py", line 69, in decode_to_native
return data.decode(self.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
the serialized string like this :
127.0.0.1:6379> get "oe-session:e1759fc0587fbb933b0cf2422a397b73f2fa6d01"
"\x80\x04\x95M\x00\x00\x00\x00\x00\x00\x00}\x94(\x8c\x05login\x94N\x8c\bpassword\x94N\x8c\x02db\x94\x8c\bethicall\x94\x8c\x03uid\x94N\x8c\acontext\x94}\x94\x8c\x04lang\x94\x8c\x05zh_CN\x94su."
unserialized :
In [4]: from cPickle import loads, dump
In [5]: loads('\x80\x02}q\x01(U\x05loginq\x02NU\x08passwordq\x03NU\x02dbq\x04X\x08\x00\x00\x00ethicallq\x05U\x03uidq\x06NU\x07contextq\x07}q\x08U\x04langq\tU\x05zh_CNq\nsu.')
Out[5]:
{'context': {'lang': 'zh_CN'},
'db': u'ethicall',
'login': None,
'password': None,
'uid': None}
When I use 'get' method to get a serialized string from redis :
the serialized string like this :
unserialized :
fortunately, when I use set it works:
The text was updated successfully, but these errors were encountered: