Menu

#8 Unable to output menus that scan *.desktop files with Unicode characters

open
nobody
None
5
2017-04-25
2017-04-25
No

System Details

  • mmaker 0.99.10
  • Python 3.6.1

Steps to reproduce

  • Place the attached *.desktop file in /usr/share/applications or ~/.local/share/applications
  • Run mmaker -vvc any_frontend

Expected Output

The menu in the console output.

Actual Output

* scanning
  desktop...
entering /usr/share/applications
parsing exo-file-manager.desktop...ok
parsing virtualbox.desktop...ok
parsing qosmic.desktop...ok
parsing wine.desktop...REJECTED : NoDisplay is True
parsing DiscordCanary.desktop...ok
parsing ccsm.desktop...ok
parsing aseprite.desktop...ok
parsing towers.desktop...ok
parsing awf.desktop...ok
parsing org.gnome.FontManager.desktop...ok
parsing love07.desktop...Traceback (most recent call last):
  File "/usr/share/menumaker/Prophet/Desktop/__init__.py", line 152, in scan
    result.append(App(os.path.join(w[0], x)))
  File "/usr/share/menumaker/Prophet/Desktop/__init__.py", line 258, in __new__
    self.__setup__(desktop)
  File "/usr/share/menumaker/Prophet/Desktop/__init__.py", line 262, in __setup__
    self.desktop = _parse(desktop)
  File "/usr/share/menumaker/Prophet/Desktop/__init__.py", line 186, in _parse
    xs = codecs.open(desktop, "r", "utf-8").readlines()  # Py 2.4+
  File "/usr/lib/python3.6/codecs.py", line 706, in readlines
    return self.reader.readlines(sizehint)
  File "/usr/lib/python3.6/codecs.py", line 615, in readlines
    data = self.read()
  File "/usr/lib/python3.6/codecs.py", line 501, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd6 in position 24: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/mmaker", line 3, in <module>
    import MenuMaker.CLI
  File "/usr/share/menumaker/MenuMaker/CLI.py", line 204, in <module>
    desktop = Prophet.Desktop.scan()
  File "/usr/share/menumaker/Prophet/Desktop/__init__.py", line 160, in scan
    msg(".desktop UTF-8 decode issue in " + desktop)
NameError: name 'desktop' is not defined
1 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB