Python3.x Error:AttributeError: ‘str’ object has no attribute ‘decode’

Python 3. X: attributeerror: ‘STR’ object has no attribute ‘decode’

1. There are some differences between Python 3.X and python 2.X. I encountered two problems as follows:

a. First report: mysqlclient version 1.3 is wrong:

Solution: comment out the line

b. Second, the problem of character set

The error is as follows: file “C:// users/administrator/pcharmprojects/untitled1/venv/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’

Solution: Comment out here because the character set is not supported

Similar Posts: