我试图读取一个文件,(密码列表),我收到以下错误:文件阅读问题的Python
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](https://stackoverflow.com/questions/9233027/unicodedecodeerror-charmap-codec-cant-decode-byte-x-in-position-y-character):'file = open(filename,encoding = “utf8”)' –
请确保读取set encoding ='utf-8' –