python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal mul...

转自:https://www.cnblogs.com/mengyu/p/6638975.html

注:此文为转载,如有侵权请告知,此文将予以删除


python读取文件时提示"UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multibyte sequence"

解决办法1:

FILE_OBJECT= open('order.log','r', encoding='UTF-8')

解决办法2:

FILE_OBJECT= open('order.log','rb')

你可能感兴趣的:(python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal mul...)