AttributeError: ‘str’ object has no attribute ‘decode’
一般是因为str的类型本身不是bytes,所以不能解码
普通str:可理解的语义
字节流str(bytes)(0101010101,可视化显示)
Encode: 把普通字符串 转为 机器可识别的bytes
Decode: 把bytes转为字符串
Python3的str 默认不是bytes,所以不能decode,只能先encode转为bytes,再decode
python2的str 默认是bytes,所以能decode