Bug 52533 - xdg.Menu.parse() - sorting fails with UnicodeEncodeError
Summary: xdg.Menu.parse() - sorting fails with UnicodeEncodeError
Status: RESOLVED DUPLICATE of bug 52492
Alias: None
Product: PyXDG
Classification: Unclassified
Component: PyXDG (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Heinrich Wendel
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-26 12:08 UTC by Edward Sheldrake
Modified: 2012-07-26 20:25 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.