Summary: | Test failure with Python 2 and non-English locales | ||
---|---|---|---|
Product: | PyXDG | Reporter: | Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA> |
Component: | PyXDG | Assignee: | Thomas Kluyver <thomas> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | ejsheldrake |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Arfrever Frehtes Taifersar Arahesis
2012-07-25 16:01:32 UTC
Thanks for the report. I think the first step will be to try to make a self-contained test case that reproduces the problem for anyone in any locale. Apparently test suite of PyXDG triggers parsing of desktop entries installed in /usr/share/applications. The following can be used to reproduce this bug in any locale: $ cat /tmp/test.desktop [Desktop Entry] Name=€ $ python2.7 -c 'import xdg.Menu; menu_entry=xdg.Menu.MenuEntry("/tmp/test.desktop"); menu_entry < menu_entry' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python2.7/site-packages/xdg/Menu.py", line 487, in __lt__ other = other._key() File "/usr/lib64/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'\u20ac' in position 0: ordinal not in range(128) $ python3.2 -c 'import xdg.Menu; menu_entry=xdg.Menu.MenuEntry("/tmp/test.desktop"); menu_entry < menu_entry' $ Great. I've added a test and fixed the issue: http://cgit.freedesktop.org/xdg/pyxdg/commit/?id=2780bc434aac3817097a5a09b0efd93d2c373a02 |
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.