PyMySQL 獲取資料 'utf-8' codec can't decode byte 0xed in position 2: 錯誤
轉載: https://my.oschina.net/pallormoon/blog/629807
解決:
PyMySQL 包目錄下的connections.py檔案1232行左右
def _read_row_from_packet(self, packet): row = [] for encoding, converter in self.converters: data = packet.read_length_coded_string() if data is not None: if encoding is not None: data = data .decode(encoding)
if DEBUG: print( "DEBUG: DATA = " , data ) if converter is not None: data = converter( data ) row.append( data ) return tuple(row)
data = data.decode(encoding)
改為
data = data.decode(encoding,'ignore')
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26250550/viewspace-2688950/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 0: invalid continuation byteUnicodeError
- tensorflow讀取圖片時出現錯誤UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid sUnicodeError
- Python報錯:UnicodeDecodeError: 'gbk' codec can't decode byte ...PythonUnicodeError
- pip install 報錯UnicodeDecodeError: 'ascii' codec can't decode byteUnicodeErrorASCII
- json.dumps錯誤:'utf8' codec can't decode byte解決方案JSON
- pipenv install error UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in positionErrorUnicode
- python在用pandas對csv檔案處理的時候報UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb6。。。的錯誤PythonUnicodeError
- PIP3安裝報錯nicodeDecodeError: 'ascii' codec can't decode byte 0xc3ErrorASCII
- Python讀取檔案時出現UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position xx: 解決方案PythonUnicodeError
- Python讀取csv檔案出現解碼錯誤UnicodeDecodeError: ‘utf-8‘ codec can‘t decodPythonUnicodeError
- Python——UnicodeEncodeError: 'ascii' codec can't encode/decode charactersPythonUnicodeErrorASCII
- Python3.7使用pip install xxxx報錯:UnicodeDecodeError: 'gbk' codec can't decode bytePythonUnicodeError
- Python3解決UnicodeEncodeError: 'ascii' codec can't encode characters in position 0PythonUnicodeErrorASCII
- 異常: 'ascii' codec can't encode charactersASCII
- RMAN的"rman: can't open target"錯誤
- Sublime Text 2報 Decode error - output not utf-8 錯誤的解決辦法Error
- Sublime Text 2報“Decode error - output not utf-8”錯誤的解決辦法Error
- python報錯問題解決:'ascii' codec can't encode characterPythonASCII
- day1 UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 2490: illegal multi...UnicodeError
- pip install ... ERROR: UnicodeDecodeError: ‘gbk‘ codec can‘t decode/ python setup.py egg_info CheckErrorUnicodePython
- can't assign requested address 錯誤解決
- Sublime Text 2/3 [Decode error - output not utf-8]Error
- sublime text編譯時提示錯誤[Decode error - output not utf-8] compilation terminated編譯Error
- Sublime報Decode error - output not utf-8 or cp936 錯誤的解決辦法Error
- MYSQL報1022錯誤:Can't write;duplicate key in table '.....'MySql
- MySQL錯誤1042-Can't get hostname for your addressMySql
- 關於收到localhost modprobe: modprobe: Can't locate module ethX的錯誤localhost
- python cx_Oracle: UnicodeEncodeError: 'ascii' codec can't encode charactersPythonOracleUnicodeErrorASCII
- 連線MySQL錯誤:Can't connect to MySQL server (10060)MySqlServer
- Android前後端gson傳輸資料和listview獲取positionAndroid後端View
- ios 如何獲取WKWebview錯誤資訊iOSWebView
- [mac pip錯誤]Can't connect to HTTPS URL because the SSL module is not availableMacHTTPAI
- 【crontab】“bad minute”及“errors in crontab file, can't install”錯誤處理Error
- eslint --fix 報錯 can't not find modulesEsLint
- MongoDB報錯:"assertion" : "can't map file memory"MongoDB
- MySQL錯誤1042-Can't get hostname for your address解決方法MySql
- mORMot2 獲取資料集1ORM
- MySQL 5.5 關閉資料庫報錯"Can't connect to local MySQL server through socket"MySql資料庫Server