AttributeError: 'str' object has no attribute 'decode'

AttributeError: 'str' object has no attribute 'decode'

AttributeError: 'str' object has no attribute 'decode'

 

 

  • 从 Error信息中可以得知,这是 str编码的问题,而且还是和 mysql进行交互之间的编码问题。

  • python3里面,字符串要先encode手动指定其为某一编码的字节码之后,才能decode解码。

AttributeError: 'str' object has no attribute 'decode'

 

 

上一篇:springCloud 不同数据库类型的多数据源配置


下一篇:自定义分页