Exception when parsing some desktop files

Bug #595230 reported by Philipp Wolfer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ear Candy
New
Undecided
Unassigned

Bug Description

Earycandy has problems with some .desktop files where there are several commands in Exec separated by semicolons. E.g. on my system there is the file ~/.local/share/applications/gthumb-import.desktop which includes the following Exec line:
Exec=sh -c 'gvfs-mount -u "%U"; exec gthumb --import-photos'

Obviously ConfigParser returns such values not as a string but as a list. I have a fix in my branch at http://bazaar.launchpad.net/~phw/earcandy/fixes/revision/81 .

Without the fix the following exeption is thrown when scanning such a .desktop file:

TypeError: expected string or buffer
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/earcandy/windows/Watcher.py", line 49, in window_opened
    a = Application(pid, command, app_name, self.desktop_files, win.get_icon ())
  File "/usr/lib/pymodules/python2.6/earcandy/windows/Application.py", line 26, in __init__
    self.__match_desktop(desktop_files)
  File "/usr/lib/pymodules/python2.6/earcandy/windows/Application.py", line 34, in __match_desktop
    ex = a.get_exec_array()[0].lower()
  File "/usr/lib/pymodules/python2.6/earcandy/util/Freedesktop.py", line 90, in get_exec_array
    for r in re.finditer(p, self.get("Exec")):
  File "/usr/lib/python2.6/re.py", line 186, in finditer
    return _compile(pattern, flags).finditer(string)

Related branches

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.