执行代码

# -*- coding: utf-8 -*-
file = open('label.txt', 'r')
print(type(lines))
file.close()

报错误

(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 7: invalid start byte

解决办法

解决办法:“r”改为“rb”