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’)

 

上一篇:Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushM


下一篇:GukiZ and Binary Operations CodeForces - 551D (组合计数)