IndexError in YAMA: list index out of range

Bug #651689 reported by John M
8
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Awn Extras
Fix Released
Low
onox

Bug Description

It happens when the applet starts (e.g., on session login).

...$ lsb_release -rd && apt-cache policy avant-window-navigator-trunk awn-applets-c-core-trunk awn-applets-python-core-trunk
Description: Ubuntu maverick (development branch)
Release: 10.10
avant-window-navigator-trunk:
  Installed: 0.4.1~bzr743+201009122042~maverick1
  Candidate: 0.4.1~bzr743+201009122042~maverick1
  Version table:
 *** 0.4.1~bzr743+201009122042~maverick1 0
        500 http://ppa.launchpad.net/awn-testing/ppa/ubuntu/ maverick/main amd64 Packages
        100 /var/lib/dpkg/status
awn-applets-python-core-trunk:
  Installed: 0.4.1~bzr1415-1.10.10
  Candidate: 0.4.1~bzr1415-1.10.10
  Version table:
 *** 0.4.1~bzr1415-1.10.10 0
        500 http://ppa.launchpad.net/awn-testing/ppa/ubuntu/ maverick/main amd64 Packages
        100 /var/lib/dpkg/status
awn-applets-c-core-trunk:
  Installed: 0.4.1~bzr1415-1.10.10
  Candidate: 0.4.1~bzr1415-1.10.10
  Version table:
 *** 0.4.1~bzr1415-1.10.10 0
        500 http://ppa.launchpad.net/awn-testing/ppa/ubuntu/ maverick/main amd64 Packages
        100 /var/lib/dpkg/status
jwm@walrus:~$

- the traceback
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/awn/extras/awnlib.py", line 1540, in init_start
    applet_class(applet)
  File "/usr/share/avant-window-navigator/applets/yama/yama.py", line 95, in __init__
    self.build_menu()
  File "/usr/share/avant-window-navigator/applets/yama/yama.py", line 125, in build_menu
    self.create_places_submenu(self.menu)
  File "/usr/share/avant-window-navigator/applets/yama/yama.py", line 261, in create_places_submenu
    self.append_bookmarks()
  File "/usr/share/avant-window-navigator/applets/yama/yama.py", line 368, in append_bookmarks
    icon = self.get_icon_name(info.get_attribute_object(gio.FILE_ATTRIBUTE_STANDARD_ICON))
  File "/usr/share/avant-window-navigator/applets/yama/yama.py", line 394, in get_icon_name
    return self.get_first_existing_icon(icon.get_names())
  File "/usr/share/avant-window-navigator/applets/yama/yama.py", line 399, in get_first_existing_icon
    return filter(self.icon_theme.has_icon, icons)[0]
IndexError: list index out of range

- applet version: '0.4.1'

Tags: traceback yama

Related branches

Revision history for this message
onox (onox) wrote :

Can you go to /usr/share/avant-window-navigator/applets/yama/yama.py and insert between line 399 and 400:

print icons

Then start avant-window-navigator and try to reproduce the traceback. Look at the output _before_ the traceback.

Changed in awn-extras:
assignee: nobody → onox (onox)
importance: Undecided → Medium
milestone: none → 0.4.2
status: New → Confirmed
tags: added: traceback yama
Revision history for this message
onox (onox) wrote :

After inserting previous line, also insert between 394 and 395:

print icon

Changed in awn-extras:
status: Confirmed → Incomplete
Revision history for this message
onox (onox) wrote :

Please respond or this bug report will be set to Won't Fix soon.

Revision history for this message
John M (jwmwalrus) wrote :

After I added the two print lines you suggested, I haven't received any error from YAMA ---I already tried the logout/login/restart combinations that used to trigger the error, with or without Avant being in the gnome-session-properties list, but nothing happens.

Since Python is not my area of expertise, I don't know what else to do. Any suggestions?

(as as side note: one common error that still occurs in YAMA is the duplication of menu items after any package has been installed/removed. Could it be related to the IndexError?)

Revision history for this message
onox (onox) wrote :

Hmm, adding those two print statements should not affect whether the error occurs. It seems to be related to your (nautilus) bookmarks. I can easily fix this though by using the "image-missing" image if there're no images.

The duplication of menu items is a different issue. I thought I had fixed it by using some complex locking, but apparently not. Can you create a new bug report for that? I cannot really reproduce it here anymore (only before adding the locking) so I need to know which people I should ask to confirm (via a bug report) the bug has been fixed when I commit a possible fix to bzr. So please create a new bug report for the duplication issue. Please specify which python version you have.

Revision history for this message
onox (onox) wrote :

Btw, which icon theme do you use?

Revision history for this message
John M (jwmwalrus) wrote :

Since I never use the Places menu (I have a shortcut for Nautilus, so it's much faster), I hadn't noticed that YAMA had problem with the icons for special folders.

It seems that YAMA is now using the default GNOME icons for those folders ---I'm not sure if the constant crashes I was having with the gnome-settings-daemon (which used to cause the whole theme to revert to GNOME's default) have something to do with the choice of icons and the fact that YAMA's IndexError doesn't show up anymore.

The set of icons I'm using is called oxygenrefit (from http://www.nanolx.org/nanolx/oxygenrefit2/ ). I've attached an image to show the inconsistency.

I'll go ahead and create a new bug report for the duplication issue. Thanks.

Revision history for this message
onox (onox) wrote :

I noticed that Faenza, Gnome (obviously), and ubuntu breathe icon themes show the appropriate icons for special folders. Tango does not. YAMA retrieves the icons via GIO (some IO library of Gnome) and, although I don't know how Cairo Menu does it, it also happens in Cairo Menu. So I think the icon themes (Tango and oxygenrefit, and probably more) are the culprit.

I'll commit a fix (fallback to "image-missing" icon) soon.

Changed in awn-extras:
importance: Medium → Low
status: Incomplete → Confirmed
Revision history for this message
onox (onox) wrote :

I've committed revision 1428 in which the "image-missing" icon will be used if the case where none of the possible icons exist ever occurs again.

Changed in awn-extras:
status: Confirmed → Fix Committed
Povilas Kanapickas (p12)
Changed in awn-extras:
status: Fix Committed → Fix Released
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.