Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

2012-12-07 Thread iMath
(img,)) > > thanks,but it still doesn't work > > > conn.commit() > > > > > > cursor.close() > > > conn.close() > > > > > > except mdb.Error as e: > > > > > > print ("Error

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

2012-12-06 Thread Steven D'Aprano
> but when I run it ,it gives the following error : > > Traceback (most recent call last): > File "E:\Python\py32\itest4.py", line 20, in > mdb.escape_string(img)) > UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: >

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

2012-12-06 Thread Hans Mulder
rror %d: %s" % (e.args[0],e.args[1])) > sys.exit(1) > > > I port 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 : > > Traceba

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

2012-12-06 Thread Terry Reedy
wing error : Traceback (most recent call last): File "E:\Python\py32\itest4.py", line 20, in mdb.escape_string(img)) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte so how to fix it ? -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

2012-12-06 Thread iMath
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 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