|

楼主 |
发表于 2022-4-12 14:26:20
|
显示全部楼层
我用的anaconda里的jupter,会不会是这个编译器的问题啊
请输入需要比较的头一个文件名:something.txt
请输入需要比较的另一个文件名:something2.txt
---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_7880\2847495758.py in <module>
19 file2 = input('请输入需要比较的另一个文件名:')
20
---> 21 differ = file_compare(file1, file2)
22
23 if len(differ) == 0:
~\AppData\Local\Temp\ipykernel_7880\2847495758.py in file_compare(file1, file2)
6 differ = [] # 统计不一样的数量
7
----> 8 for line1 in f1:
9 line2 = f2.readline()
10 count += 1
C:\Anaconda\envs\fish_c\lib\codecs.py in decode(self, input, final)
320 # decode input (taking the buffer into account)
321 data = self.buffer + input
--> 322 (result, consumed) = self._buffer_decode(data, self.errors, final)
323 # keep undecoded input until the next call
324 self.buffer = data[consumed:]
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb4 in position 0: invalid start byte |
|