| Summary: | [abrt] openbox-3.5.0-3.fc16: openbox-xdg-menu:69:walk_menu:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 26: ordinal not in range(128) | |||
|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | biorochi | |
| Component: | openbox | Assignee: | Miroslav Lichvar <mlichvar> | |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 16 | CC: | cwickert, dima_skok, ejsheldrake, haliyo, mlichvar, pendulum, pierredelune86 | |
| Target Milestone: | --- | |||
| Target Release: | --- | |||
| Hardware: | x86_64 | |||
| OS: | Unspecified | |||
| Whiteboard: | abrt_hash:e5d1bc244c106635f158fa4975df699bdc5779cc | |||
| Fixed In Version: | openbox-3.5.0-5.fc16 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 874633 (view as bug list) | Environment: | ||
| Last Closed: | 2012-04-18 19:34:32 UTC | Type: | --- | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Bug Depends On: | ||||
| Bug Blocks: | 874633 | |||
| Attachments: | ||||
|
Description
biorochi
2012-03-04 03:28:21 UTC
Created attachment 567360 [details]
File: datos_de_fallos
Created attachment 573148 [details]
yet another revision of xdg-menu
*** Bug 808235 has been marked as a duplicate of this bug. *** *** Bug 808234 has been marked as a duplicate of this bug. *** openbox-3.5.0-5.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/openbox-3.5.0-5.fc16 Thanks, the patch was included in openbox-3.5.0-5.fc16. openbox-3.5.0-5.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/openbox-3.5.0-5.fc17 Package openbox-3.5.0-5.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing openbox-3.5.0-5.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-4975/openbox-3.5.0-5.fc16 then log in and leave karma (feedback). *** Bug 812303 has been marked as a duplicate of this bug. *** openbox-3.5.0-5.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report. *** Bug 812685 has been marked as a duplicate of this bug. *** openbox-3.5.0-5.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report. I'm still getting this on F17 KDE. LANG is fr_FR.UTF-8 I've already applied pyxdg fix from Bug 869877 [haliyo@pad ~]$ /usr/libexec/openbox-xdg-menu applications > app.menu /usr/lib/python2.7/site-packages/xdg/Menu.py:1115: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if menuentry.DesktopFileID not in ids: /usr/lib/python2.7/site-packages/xdg/Menu.py:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal """ Traceback (most recent call last): File "/usr/libexec/openbox-xdg-menu", line 101, in <module> map(walk_menu, menu.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu map(walk_menu, entry.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu map(walk_menu, entry.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu map(walk_menu, entry.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu map(walk_menu, entry.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 79, in walk_menu '<command>%s</command></action>' % command UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 173: ordinal not in range(128) ____________________________________________________________________________ [haliyo@pad ~]$ /usr/libexec/openbox-xdg-menu preferences > pref.menu Traceback (most recent call last): File "/usr/libexec/openbox-xdg-menu", line 101, in <module> map(walk_menu, menu.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 73, in walk_menu command = re.sub(' -caption "%c"| -caption %c', ' -caption "%s"' % entry_name(entry.DesktopEntry), entry.DesktopEntry.getExec()) File "/usr/lib64/python2.7/re.py", line 151, in sub return _compile(pattern, flags).sub(repl, string, count) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 32: ordinal not in range(128) Created attachment 634494 [details]
app.menu
Created attachment 634495 [details]
pref.menu
That's odd. Are you sure in both cases the locale is UTF-8? Can you try to find the offending desktop file? Running it under "strace -eopen" might help. (In reply to comment #16) > That's odd. Are you sure in both cases the locale is UTF-8? quite sure, yes: [haliyo@pad ~]$ echo $LANG; /usr/libexec/openbox-xdg-menu applications > app.menu fr_FR.UTF-8 /usr/lib/python2.7/site-packages/xdg/Menu.py:1115: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if menuentry.DesktopFileID not in ids: /usr/lib/python2.7/site-packages/xdg/Menu.py:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal """ Traceback (most recent call last): File "/usr/libexec/openbox-xdg-menu", line 101, in <module> map(walk_menu, menu.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu map(walk_menu, entry.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu map(walk_menu, entry.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu map(walk_menu, entry.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu map(walk_menu, entry.getEntries()) File "/usr/libexec/openbox-xdg-menu", line 79, in walk_menu '<command>%s</command></action>' % command UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 173: ordinal not in range(128) > > Can you try to find the offending desktop file? Running it under "strace > -eopen" might help. will do that. Hmm setting LANG=en_US.UTF-8 fixes for preferences but not for applications. I couldn't tell the offending .desktop because in both cases (preferences en_US & fr_FR) there is no diff on any open.desktop. I attach the logs hoping that you'll make make sense out of it than me. Created attachment 635487 [details]
LANG=fr_Fr.UTF-8 LANGUAGE=fr_FR.UTF-8 strace -o strace_FR_prefs.txt -e open /usr/libexec/openbox-xdg-menu preferences > pref.menu
[haliyo@pad ~]$ LANG=fr_Fr.UTF-8 LANGUAGE=fr_FR.UTF-8 strace -o strace_FR_prefs.txt -e open /usr/libexec/openbox-xdg-menu preferences > pref.menu
Traceback (most recent call last):
File "/usr/libexec/openbox-xdg-menu", line 101, in <module>
map(walk_menu, menu.getEntries())
File "/usr/libexec/openbox-xdg-menu", line 73, in walk_menu
command = re.sub(' -caption "%c"| -caption %c', ' -caption "%s"' % entry_name(entry.DesktopEntry), entry.DesktopEntry.getExec())
File "/usr/lib64/python2.7/re.py", line 151, in sub
return _compile(pattern, flags).sub(repl, string, count)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 32: ordinal not in range(128)
Created attachment 635488 [details]
LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 strace -o strace_EN_prefs.txt -e open /usr/libexec/openbox-xdg-menu preferences > pref.menu
[haliyo@pad ~]$ LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 strace -o strace_EN_prefs.txt -e open /usr/libexec/openbox-xdg-menu preferences > pref.menu
[haliyo@pad ~]$
Created attachment 635489 [details]
LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 strace -o strace_EN_apps.txt -e open /usr/libexec/openbox-xdg-menu applications > app.menu
Traceback (most recent call last):
File "/usr/libexec/openbox-xdg-menu", line 101, in <module>
map(walk_menu, menu.getEntries())
File "/usr/libexec/openbox-xdg-menu", line 73, in walk_menu
command = re.sub(' -caption "%c"| -caption %c', ' -caption "%s"' % entry_name(entry.DesktopEntry), entry.DesktopEntry.getExec())
File "/usr/lib64/python2.7/re.py", line 151, in sub
return _compile(pattern, flags).sub(repl, string, count)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 32: ordinal not in range(128)
[haliyo@pad ~]$ LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 strace -o strace_EN_apps.txt -e open /usr/libexec/openbox-xdg-menu applications > app.menu
/usr/lib/python2.7/site-packages/xdg/Menu.py:1115: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if menuentry.DesktopFileID not in ids:
/usr/lib/python2.7/site-packages/xdg/Menu.py:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
"""
Traceback (most recent call last):
File "/usr/libexec/openbox-xdg-menu", line 101, in <module>
map(walk_menu, menu.getEntries())
File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu
map(walk_menu, entry.getEntries())
File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu
map(walk_menu, entry.getEntries())
File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu
map(walk_menu, entry.getEntries())
File "/usr/libexec/openbox-xdg-menu", line 67, in walk_menu
map(walk_menu, entry.getEntries())
File "/usr/libexec/openbox-xdg-menu", line 79, in walk_menu
'<command>%s</command></action>' % command
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 173: ordinal not in range(128)
Hm, I can't make any sense of the strace output either. However, looking at your app.menu again, I see that the last (incomplete) entry is "Bibliothèque multimédia Microsoft", so I guess that's the offending entry for the application call. The difference in behavior with different locale could be explained by different localized strings in the entries, like the name or icon. I'm guessing the problem with the applications menu is due to the wine programs being installed into directories with non-ASCII characters in their names. This resulted in non-ASCII chars ending up in the value of the Exec key in the .desktop file. The desktop entry specification says that the value of the Exec key is a string (not a UTF-8 localestring) and so should be plain ASCII. Created attachment 635724 [details]
example offending .desktop file
desktop-file-validate doesn't complain about this .desktop file.
Created attachment 635737 [details]
revised openbox-xdg-menu
It's openbox-xdg-menu with one more ".encode('utf-8')" thrown in.
Interesting, with your revised code it now fails here. I see I'm still using the old pyxdg here. It seems the new pyxdg getExec() returns unicode instead of str. Isn't that a bug? I'm not sure it can assume in what encoding are the file names stored. the revised version fixes it for me. Although it still gives a warning if run from console, the menu displays correctly on the desktop. by the way, the sub-menu ids are still in english even if the lang is fr_Fr, but it's another bug. [haliyo@pad ~]$ /usr/libexec/openbox-xdg-menu applications > app.menu /usr/lib/python2.7/site-packages/xdg/Menu.py:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal """ [haliyo@pad ~]$ thx! |