尽管设置了StrictRedis.decode_responses = True,Python-redis get()返回字节对象

时间:2018-09-04 09:39:36

标签: python-3.x redis

 r = redis.StrictRedis(host=shard['host'], port=shard['port'], charset='utf-8', decode_responses=True)
 pipe = r.pipeline()
 for key in keys:
     pipe.lrange(key, 0, -1)
 olists = pipe.execute()

尽管设置了字符集和encode_responses = True,它仍获取字节对象而不是字符串。

0 个答案:

没有答案