Bug 52533

Summary: xdg.Menu.parse() - sorting fails with UnicodeEncodeError
Product: PyXDG Reporter: Edward Sheldrake <ejsheldrake>
Component: PyXDGAssignee: Heinrich Wendel <heinrich.wendel>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Edward Sheldrake 2012-07-26 12:08:06 UTC
This is a new issue with pyxdg 0.21:

python -c 'import xdg.Menu; xdg.Menu.parse();'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/xdg/Menu.py", line 574, in parse
    sort(tmp["Root"])
  File "/usr/lib/python2.7/site-packages/xdg/Menu.py", line 937, in sort
    sort(submenu)
  File "/usr/lib/python2.7/site-packages/xdg/Menu.py", line 964, in sort
    menu.MenuEntries.sort()
  File "/usr/lib/python2.7/site-packages/xdg/Menu.py", line 490, in __lt__
    return self._key() < other
  File "/usr/lib/python2.7/site-packages/xdg/Menu.py", line 483, in _key
    return locale.strxfrm(self.DesktopEntry.getName())
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 16: ordinal not in range(128)

U+2026 is from gnome-search-tool.desktop which contains a … character instead of ... (three dots):
Name[en_GB]=Search for Files…
Comment 1 Edward Sheldrake 2012-07-26 20:25:32 UTC

*** This bug has been marked as a duplicate of bug 52492 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.