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

错误代码:query = query.encode(errors='replace')
解决方法:把decode改为encode即可。

相关文章: