Score:0

"utf-8' codec can't decode byte 0x99 in position 0

cn flag

This problem appears in various ways eg. a simple lsb_release command. It seems ubuntu cannot determine the version.

LC_ALL=C.UTF-8 when I run locale on the command line so this does not fix the problem.

Here's the output...

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

Driving me nuts. Thanks for any suggestions.

hr flag
Is there a `LSB_OS_RELEASE` variable in your environment (ex. `printenv | grep LSB`)? What is the output of `xxd -l 8 /usr/lib/os-release` ?
molipha avatar
cn flag
Thanks steeldriver. Output `printenv` | grep LSB is nothing Output `xxd -l 8 /usr/lib/os-release` is `00000000: 5052 4554 5459 5f4e PRETTY_N`
hr flag
OK thanks, so I'm stumped - I can reproduce exactly this error by doing `printf '\x99' > somefile` and then running `LSB_OS_RELEASE=./somefile lsb_release -a` so everything is pointing to a spurious byte at the start of that file.
molipha avatar
cn flag
Sorry, which file?
hr flag
... `./somefile` is an arbitrary new file in the current directory, it's just a way of debugging without modifying the *actual* `/usr/lib/os-release` file
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.