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
- pipenv install error UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in positionErrorUnicode
- Python3.7使用pip install xxxx報錯:UnicodeDecodeError: 'gbk' codec can't decode bytePythonUnicodeError
- Python讀取檔案時出現UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position xx: 解決方案PythonUnicodeError
- python在用pandas對csv檔案處理的時候報UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb6。。。的錯誤PythonUnicodeError
- PIP3安裝報錯nicodeDecodeError: 'ascii' codec can't decode byte 0xc3ErrorASCII
- Python——UnicodeEncodeError: 'ascii' codec can't encode/decode charactersPythonUnicodeErrorASCII
- Python讀取csv檔案出現解碼錯誤UnicodeDecodeError: ‘utf-8‘ codec can‘t decodPythonUnicodeError
- Python3解決UnicodeEncodeError: 'ascii' codec can't encode characters in position 0PythonUnicodeErrorASCII
- pip install ... ERROR: UnicodeDecodeError: ‘gbk‘ codec can‘t decode/ python setup.py egg_info CheckErrorUnicodePython
- day1 UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 2490: illegal multi...UnicodeError
- Sublime Text 2報 Decode error - output not utf-8 錯誤的解決辦法Error
- python cx_Oracle: UnicodeEncodeError: 'ascii' codec can't encode charactersPythonOracleUnicodeErrorASCII
- MYSQL報1022錯誤:Can't write;duplicate key in table '.....'MySql
- 【python爬蟲】用selenium爬時報錯UnicodeEncodeError: ‘gbk‘ codec can‘t encode character ‘\u2022‘Python爬蟲UnicodeError
- [mac pip錯誤]Can't connect to HTTPS URL because the SSL module is not availableMacHTTPAI
- Can't Connect to MySQL Server on IP Address (10061) 錯誤的解決方案MySqlServer
- python str與byte轉換 encode decodePython
- eslint --fix 報錯 can't not find modulesEsLint
- Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock錯誤MySqlServer
- Invalid byte 3 of 3-byte UTF-8 sequence 解決方案
- Could not decode a text frame as UTF-8 的解決
- mORMot2 獲取資料集1ORM
- MSSQL連線資料庫密碼獲取工具與原文數個錯誤糾正SQL資料庫密碼
- jQuery Validate獲取驗證錯誤的數目jQuery
- tasklist 遠端獲取程式報錯賬號密碼錯誤密碼
- 錯誤捕獲
- (資料庫之pymysql)資料庫MySql
- pymysql批量更新資料MySql
- Android開發:Android虛擬機器啟動錯誤Can't find 'Linux version ' string in kernel image fileAndroid虛擬機Linux
- PHP中的Malformed UTF-8 characters錯誤解決PHPORM
- Android使用Camera2獲取預覽資料Android
- 小程式真機報錯errMsg: “hideLoading:fail:toast can‘t be found“ ?IDEAIAST
- TypeError: can‘t concat str to bytesError
- Can't open file: (errno: 24)
- 讀取nc錯誤