“utf-8”编解码器无法解码位置 0 处的字节 0x99

“utf-8”编解码器无法解码位置 0 处的字节 0x99

此问题以多种方式出现,例如简单的 lsb_release 命令。看来 ubuntu 无法确定版本。

当我在命令行上运行 locale 时,LC_ALL=C.UTF-8,所以这并不能解决问题。

这是输出...

Traceback (most recent call last):
  File "/usr/bin/lsb_release", line 95, in <module>
    main()
  File "/usr/bin/lsb_release", line 59, in main
    distinfo = lsb_release.get_distro_information()
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 394, in get_distro_information
    lsbinfo = get_os_release()
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 366, in get_os_release
    for line in os_release_file:
  File "/usr/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x99 in position 0: invalid start byte

让我抓狂。感谢您的任何建议。

相关内容