python 3.7.6
django 2.2
执行python manage.py makemigrations时报错:
File "E:\software\Python3-64bit\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'
原因目前未知,部分版本就会出现这个问题。
修改{PYHTON_HOME}\lib\site-packages\django\db\backends\mysql\operations.py的146行,将
query = query.decode(errors=‘replace’)修改为query = query.encode(errors=‘replace’)