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

重新执行安装命令

  • python3里面,字符串要先encode手动指定其为某一编码的字节码之后,才能decode解码。
query = query.encode(errors='replace').decode(errors='replace')

 

posted @ 2021-07-15 16:46  翼损  阅读(132)  评论(0)    收藏  举报