python3 redis 二进制 转为str 报错提示 AttributeError: ‘bytes’ object has no attribute ‘encode’

# 这是因为,python3中,编码的时候区分了字符串和二进制
#encode 改为 decode 就可以了 参数默认utf-8
code = code.decode('utf-8')

猜你喜欢

转载自blog.csdn.net/qq_42795565/article/details/87639652