mdb.escape_string(img))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0:
invalid start byte
so how to fix it ?
Python 3 distinguishes between binary data and Unicode text.
Trying to apply string functions to images or other binary
data won't work.
Maybe
\py32\itest4.py, line 20, in module
mdb.escape_string(img))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid
start byte
so how to fix it ?
--
http://mail.python.org/mailman/listinfo/python-list
it to python 3 ,and also change
fin = open(chrome.png)
to
fin = open(Chrome_Logo.png,'rb')
but when I run it ,it gives the following error :
Traceback (most recent call last):
File E:\Python\py32\itest4.py, line 20, in module
mdb.escape_string(img))
UnicodeDecodeError: 'utf-8' codec can't decode
\itest4.py, line 20, in module
mdb.escape_string(img))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0:
invalid start byte
so how to fix it ?
Python 3 distinguishes between binary data and Unicode text.
Trying to apply string functions to images or other binary
data
mdb.escape_string(img))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0:
invalid start byte
so how to fix it ?
I suggest you start by reading the documentation for
MySQLdb.escape_string. What does it do? What does it expect? A byte
string or a unicode text string?
It seems very