• Bug#1074599: command-not-found: UnicodeDecodeError: 'utf-8' codec can't

    From =?UTF-8?B?T3R0byBLZWvDpGzDpGluZW4=?@21:1/5 to All on Thu Jun 5 17:40:01 2025
    I saw this again in a container, and it is easy to reproduce now.

    Just install the package 'aspell-is' that includes filename 'usr/lib/aspell/\xedslenska.alias' and running /usr/lib/cnf-update-db
    will fail:

    (extra output is my custom print() in creator.py line 241)
    l: b'usr/lib/aspell/xh.dat\t\t\t\t\t universe/text/aspell-xh\n'
    l: b'usr/lib/aspell/xh.multi\t\t\t\t\t universe/text/aspell-xh\n'
    l: b'usr/lib/aspell/xh.rws\t\t\t\t\t universe/text/aspell-xh\n'
    l: b'usr/lib/aspell/xhosa.alias\t\t\t\t universe/text/aspell-xh\n'
    l: b'usr/lib/aspell/zu.dat\t\t\t\t\t universe/text/aspell-zu\n'
    l: b'usr/lib/aspell/zu.multi\t\t\t\t\t universe/text/aspell-zu\n'
    l: b'usr/lib/aspell/zu.rws\t\t\t\t\t universe/text/aspell-zu\n'
    l: b'usr/lib/aspell/zulu.alias\t\t\t\t universe/text/aspell-zu\n'
    l: b'usr/lib/aspell/\xedslenska.alias\t\t\t\t universe/text/aspell-is\n' Traceback (most recent call last):
    File "/usr/lib/cnf-update-db", line 32, in <module>
    col.create(db)
    ~~~~~~~~~~^^^^
    File "/usr/share/command-not-found/CommandNotFound/db/creator.py",
    line 96, in create
    self._fill_commands(con)
    ~~~~~~~~~~~~~~~~~~~^^^^^
    File "/usr/share/command-not-found/CommandNotFound/db/creator.py",
    line 141, in _fill_commands
    self._parse_single_contents_file(con, f, sub.stdout)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
    File "/usr/share/command-not-found/CommandNotFound/db/creator.py",
    line 242, in _parse_single_contents_file
    l = l.decode("utf-8")
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position
    15: invalid continuation byte

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)