【发布时间】:2017-11-05 19:53:53
【问题描述】:
我正在尝试读取文件,(密码列表),我收到以下错误:
Traceback (most recent call last):
File "C:\Users\ayden\Documents\2.1 Hacks\Python\PowerUp\FTPCracker.py", line 25, in <module>
passwords = file.read()
File "C:\Users\ayden\AppData\Local\Programs\Python\Python35-32\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 1911885: character maps to <undefined>
是太大了还是有一些奇怪的不允许的字符?
【问题讨论】:
-
您需要发布您的代码以获得更好的帮助!
-
试试this:
file = open(filename, encoding="utf8") -
确保在读取时设置编码='utf-8'