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


File "C:\Python\Python37\lib\site-packages\django\db\backends\mysql\operations.py", line 146, in last_executed_query
query = query.decode(errors='replace')
AttributeError: 'str' object has no attribute 'decode'

解决方法:点到报错信息最后一个py文件里(上面加粗的operations.py),找到以下内容,注释掉:
# if query is not None:
query = query.decode(errors=‘replace’)

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM