Bug 799663 - [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)
Summary: [abrt] openbox-3.5.0-3.fc16: openbox-xdg-menu:69:walk_menu:UnicodeDecodeError...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openbox
Version: 16
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:e5d1bc244c106635f158fa4975d...
: 808234 808235 812303 812685 (view as bug list)
Depends On:
Blocks: 874633
TreeView+ depends on / blocked
 
Reported: 2012-03-04 03:28 UTC by biorochi
Modified: 2012-11-08 14:59 UTC (History)
7 users (show)

Fixed In Version: openbox-3.5.0-5.fc16
Clone Of:
: 874633 (view as bug list)
Environment:
Last Closed: 2012-04-18 19:34:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: datos_de_fallos (4.71 KB, text/plain)
2012-03-04 03:28 UTC, biorochi
no flags Details
yet another revision of xdg-menu (2.95 KB, text/plain)
2012-03-27 18:28 UTC, Edward Sheldrake
no flags Details
app.menu (19.39 KB, application/octet-stream)
2012-10-28 11:35 UTC, Sinan H
no flags Details
pref.menu (229 bytes, application/octet-stream)
2012-10-28 11:36 UTC, Sinan H
no flags 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 (146.80 KB, text/plain)
2012-10-30 10:39 UTC, Sinan H
no flags 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 (141.10 KB, text/plain)
2012-10-30 10:39 UTC, Sinan H
no flags 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 (154.26 KB, text/plain)
2012-10-30 10:41 UTC, Sinan H
no flags Details
example offending .desktop file (103 bytes, text/plain)
2012-10-30 19:16 UTC, Edward Sheldrake
no flags Details
revised openbox-xdg-menu (2.98 KB, application/octet-stream)
2012-10-30 19:19 UTC, Edward Sheldrake
no flags Details

Description biorochi 2012-03-04 03:28:21 UTC
libreport version: 2.0.8
abrt_version:   2.0.7
cmdline:        /usr/bin/python /usr/libexec/openbox-xdg-menu system-settings
executable:     /usr/libexec/openbox-xdg-menu
kernel:         3.2.7-1.fc16.x86_64
reason:         openbox-xdg-menu:69:walk_menu:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 26: ordinal not in range(128)
reported_to:    file: datos_de_fallos
time:           dom 04 mar 2012 00:27:38 CLST
uid:            1001
username:       ronald

datos_de_fallos: Text file, 4820 bytes

backtrace:
:openbox-xdg-menu:69:walk_menu:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 26: ordinal not in range(128)
:
:Traceback (most recent call last):
:  File "/usr/libexec/openbox-xdg-menu", line 98, in <module>
:    map(walk_menu, menu.getEntries())
:  File "/usr/libexec/openbox-xdg-menu", line 69, in walk_menu
:    escape(icon_attr(entry.DesktopEntry)))
:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 26: ordinal not in range(128)
:
:Local variables in innermost frame:
:entry: system-config-lvm.desktop

event_log:
:2012-03-04-00:27:59> Smolt profile successfully saved
:2012-03-04-00:28:15> El informe fue añadido a datos_de_fallos

smolt_data:
:
:
:General
:=================================
:UUID: c944d8c1-1a23-4a95-8b53-3dda28f184c0
:SO: Fedora release 16 (Verne)
:Nivel de ejecución por defecto: Unknown
:Idioma: es_CL.utf8
:Plataforma: x86_64
:BogoMIPS: 3292.44
:Fabricante de CPU: AuthenticAMD
:Modelo de CPU: AMD E-450 APU with Radeon(tm) HD Graphics
:Paso del UCP: 0
:Familia de UCP: 20
:Número de Modelo de CPU: 2
:Número de CPUs: 2
:Velocidad del CPU: 1650
:Memoria del Sistema: 3574
:Intercambio (swap) del Sistema: 5631
:Vendedor: ASUSTeK Computer Inc.
:Sistema: K53BY 1.0
:Factor de forma: Notebook
:Kernel: 3.2.7-1.fc16.x86_64
:SELinux Habilitado: 1
:Política de SELinux: targeted
:SELinux Obligado: Enforcing
:MythTV Remote: Unknown
:MythTV Role: Unknown
:MythTV Theme: Unknown
:MythTV Plugin: 
:MythTV Tuner: -1
:
:
:Dispositivos
:=================================
:(4098:17297:4163:4124) pci, ahci, STORAGE, SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]
:(4130:5392:4130:5392) pci, None, HOST/PCI, Pavilion DM1Z-3000 Host bridge
:(4098:4884:4163:4124) pci, snd_hda_intel, MULTIMEDIA, Wrestler HDMI Audio [Radeon HD 6250/6310]
:(4098:38918:4163:4124) pci, radeon, VIDEO, N/A
:(5772:43:4525:26147) pci, ath9k, NETWORK, AR9285 Wireless Network Adapter (PCI-Express)
:(4130:5912:0:0) pci, None, HOST/PCI, Family 12h/14h Processor Function 6
:(4130:5892:0:0) pci, None, HOST/PCI, Family 12h/14h Processor Function 4
:(4130:5913:0:0) pci, None, HOST/PCI, Family 12h/14h Processor Function 7
:(4130:5910:0:0) pci, None, HOST/PCI, Family 12h/14h Processor Function 5
:(4130:5889:0:0) pci, None, HOST/PCI, Family 12h/14h Processor Function 1
:(4130:5888:0:0) pci, None, HOST/PCI, Family 12h/14h Processor Function 0
:(4130:5891:0:0) pci, k10temp, HOST/PCI, Family 12h/14h Processor Function 3
:(4130:5890:0:0) pci, None, HOST/PCI, Family 12h/14h Processor Function 2
:(4098:17302:4163:4124) pci, ehci_hcd, USB, SB7x0/SB8x0/SB9x0 USB EHCI Controller
:(4098:17303:4163:4124) pci, ohci_hcd, USB, SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
:(4332:33128:4163:4124) pci, r8169, ETHERNET, RTL8111/8168B PCI Express Gigabit Ethernet controller
:(4098:17312:4098:0) pci, pcieport, PCI/PCI, SB700/SB800 PCI to PCI bridge (PCIE port 0)
:(4098:17313:4098:0) pci, pcieport, PCI/PCI, SB700/SB800 PCI to PCI bridge (PCIE port 1)
:(4098:17308:4163:4124) pci, pata_atiixp, STORAGE, SB7x0/SB8x0/SB9x0 IDE Controller
:(4098:17285:4163:4124) pci, None, SERIAL, SBx00 SMBus Controller
:(4098:17309:4163:4124) pci, None, PCI/ISA, SB7x0/SB8x0/SB9x0 LPC host controller
:(4098:17283:4163:4124) pci, snd_hda_intel, MULTIMEDIA, SBx00 Azalia (Intel HDA)
:(4098:17305:4163:4124) pci, ohci_hcd, USB, SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
:(4098:17284:0:0) pci, None, PCI/PCI, SBx00 PCI to PCI Bridge
:(4098:17302:4163:4124) pci, ehci_hcd, USB, SB7x0/SB8x0/SB9x0 USB EHCI Controller
:(4098:26464:4163:4124) pci, radeon, VIDEO, NI Seymour [AMD Radeon HD 6470M]
:(4098:17303:4163:4124) pci, ohci_hcd, USB, SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
:(4098:17302:4163:4124) pci, ehci_hcd, USB, SB7x0/SB8x0/SB9x0 USB EHCI Controller
:(4098:17303:4163:4124) pci, ohci_hcd, USB, SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
:(4130:5394:4130:4660) pci, pcieport, PCI/PCI, Family 14h Processor Root Port
:
:
:Información relacionada con el sistema de archivos
:=================================
:device mtpt type bsize frsize blocks bfree bavail file ffree favail
:-------------------------------------------------------------------
:/dev/mapper/vg_alimania-lv_root / ext4 4096 4096 13081819 5707784 5052424 3276800 2492771 2492771
:/dev/sda2 /boot ext4 1024 1024 508745 457196 431596 128016 127751 127751
:/dev/mapper/vg_alimania-lv_home /home ext4 4096 4096 56146150 36188308 33377633 14057472 14043118 14043118
:

Comment 1 biorochi 2012-03-04 03:28:25 UTC
Created attachment 567360 [details]
File: datos_de_fallos

Comment 2 Edward Sheldrake 2012-03-27 18:28:41 UTC
Created attachment 573148 [details]
yet another revision of xdg-menu

Comment 3 Miroslav Lichvar 2012-03-30 12:51:34 UTC
*** Bug 808235 has been marked as a duplicate of this bug. ***

Comment 4 Miroslav Lichvar 2012-03-30 12:51:41 UTC
*** Bug 808234 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Update System 2012-03-30 13:57:09 UTC
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

Comment 6 Miroslav Lichvar 2012-03-30 13:57:41 UTC
Thanks, the patch was included in openbox-3.5.0-5.fc16.

Comment 7 Fedora Update System 2012-03-30 13:59:25 UTC
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

Comment 8 Fedora Update System 2012-03-31 03:02:20 UTC
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).

Comment 9 Miroslav Lichvar 2012-04-13 10:43:13 UTC
*** Bug 812303 has been marked as a duplicate of this bug. ***

Comment 10 Fedora Update System 2012-04-14 04:35:35 UTC
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.

Comment 11 Miroslav Lichvar 2012-04-16 11:39:18 UTC
*** Bug 812685 has been marked as a duplicate of this bug. ***

Comment 12 Fedora Update System 2012-04-18 19:34:32 UTC
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.

Comment 13 Sinan H 2012-10-28 11:35:12 UTC
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)

Comment 14 Sinan H 2012-10-28 11:35:53 UTC
Created attachment 634494 [details]
app.menu

Comment 15 Sinan H 2012-10-28 11:36:17 UTC
Created attachment 634495 [details]
pref.menu

Comment 16 Miroslav Lichvar 2012-10-29 18:09:54 UTC
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.

Comment 17 Sinan H 2012-10-29 21:14:21 UTC
(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.

Comment 18 Sinan H 2012-10-30 10:37:46 UTC
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.

Comment 19 Sinan H 2012-10-30 10:39:06 UTC
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)

Comment 20 Sinan H 2012-10-30 10:39:51 UTC
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 ~]$

Comment 21 Sinan H 2012-10-30 10:41:31 UTC
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)

Comment 22 Miroslav Lichvar 2012-10-30 16:52:11 UTC
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.

Comment 23 Edward Sheldrake 2012-10-30 19:14:09 UTC
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.

Comment 24 Edward Sheldrake 2012-10-30 19:16:36 UTC
Created attachment 635724 [details]
example offending .desktop file

desktop-file-validate doesn't complain about this .desktop file.

Comment 25 Edward Sheldrake 2012-10-30 19:19:28 UTC
Created attachment 635737 [details]
revised openbox-xdg-menu

It's openbox-xdg-menu with one more ".encode('utf-8')" thrown in.

Comment 26 Miroslav Lichvar 2012-10-31 09:28:47 UTC
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.

Comment 27 Sinan H 2012-10-31 11:51:19 UTC
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!


Note You need to log in before you can comment on or make changes to this bug.