After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 677343 - 0.13.4 crashes on startup: AttributeError: 'TreeIter' object has no attribute 'get_separator'
0.13.4 crashes on startup: AttributeError: 'TreeIter' object has no attribute...
Status: RESOLVED FIXED
Product: alacarte
Classification: Applications
Component: general
0.13.x
Other Linux
: Normal critical
: ---
Assigned To: Alacarte Maintainer(s)
Alacarte Maintainer(s)
Depends on: 677344
Blocks:
 
 
Reported: 2012-06-02 15:45 UTC by Olav Vitters
Modified: 2012-06-25 14:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
MainWindow: Fix typos related to separators (1.46 KB, patch)
2012-06-11 15:42 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Olav Vitters 2012-06-02 15:45:24 UTC
$ alacarte
Traceback (most recent call last):
  • File "/usr/bin/alacarte", line 36 in <module>
    main()
  • File "/usr/bin/alacarte", line 33 in main
    app.run()
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 64 in run
    self.loadMenus()
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 203 in loadMenus
    self.on_menu_tree_cursor_changed(menu_tree)
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 354 in on_menu_tree_cursor_changed
    self.loadItems(self.menu_store[menu_path][2], menu_path)
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 217 in loadItems
    for item, show in self.editor.getItems(menu):
  • File "/usr/lib/python2.7/site-packages/Alacarte/MenuEditor.py", line 145 in getItems
    item = item_iter.get_separator()
AttributeError: 'TreeIter' object has no attribute 'get_separator'

Comment 1 Jasper St. Pierre (not reading bugmail) 2012-06-02 17:18:02 UTC
Seems to be missing gnome-menus API.
Comment 2 Olav Vitters 2012-06-02 20:31:51 UTC
Ah, maybe not new enough?
Comment 3 Olav Vitters 2012-06-02 20:32:51 UTC
$ rpm -qa | grep menu
lib64gnome-menu2-3.0.1-3.mga2
lib64gmenu-gir3.0-3.4.2-1.mga3
lib64gmenu-gir2.0-3.0.1-3.mga2
python-gnome-menus-3.4.2-1.mga3
menu-messages-1-0.2.mga1
gnome-menus-3.4.2-1.mga3
gnome-menus-debug-3.4.2-1.mga3
lib64gnome-menu3_0-3.4.2-1.mga3
lib64gnome-menu-devel-3.4.2-1.mga3

I'm guessing it takes the 3.0 version..
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-06-02 20:33:36 UTC
No, it's that the API never existed in the first place. Not sure who wrote that code in the first place.

https://bugzilla.gnome.org/show_bug.cgi?id=677344
Comment 5 Olav Vitters 2012-06-02 20:38:10 UTC
Ah ok, I prefer if this goes in gnome-menu 3.4.x, so I can provide Alacarte for Mageia 2.
Comment 6 Iain Lane 2012-06-11 15:36:27 UTC
After applying that patch, Alacarte still crashes at startup with

Traceback (most recent call last):
  File /usr/bin/alacarte, line 37, in <module>
    main()
  File /usr/bin/alacarte, line 34, in main
    app.run()
  File /usr/share/alacarte/Alacarte/MainWindow.py, line 65, in run
    self.loadMenus()
  File /usr/share/alacarte/Alacarte/MainWindow.py, line 204, in loadMenus
    self.on_menu_tree_cursor_changed(menu_tree)
  File /usr/share/alacarte/Alacarte/MainWindow.py, line 364, in on_menu_tree_cursor_changed
    self.loadItems(self.menu_store[menu_path][2], menu_path)
  File /usr/share/alacarte/Alacarte/MainWindow.py, line 224, in loadItems
    elif isinstance(item, GMenu.Separator):
  File /usr/lib/python2.7/dist-packages/gi/module.py, line 249, in __getattr__
    return getattr(self._introspection_module, name)
  File /usr/lib/python2.7/dist-packages/gi/module.py, line 107, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.GMenu' object has no attribute 'Separator'

Making the obvious fix of changing 'Separator' to 'TreeSeparator' at MainWindow.py:223 allows it to start again.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-06-11 15:42:48 UTC
Created attachment 216126 [details] [review]
MainWindow: Fix typos related to separators

Thanks, Ian.
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-06-11 15:43:37 UTC
Attachment 216126 [details] pushed as f3a41e1 - MainWindow: Fix typos related to separators


I attached the patch so that you could easily put it in a distro patch.
Comment 9 Pavel Roskin 2012-06-25 05:05:33 UTC
I'm still having that problem with alacarte from git (3.5.4) on Fedora 17 (GNOME 3.4).  alacarte fails to show the window.  Instead, following is shown on the terminal:

$ alacarte 
Traceback (most recent call last):
  • File "/bin/alacarte", line 36 in <module>
    main()
  • File "/bin/alacarte", line 33 in main
    app.run()
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 63 in run
    self.loadMenus()
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 200 in loadMenus
    self.on_menu_tree_cursor_changed(menu_tree)
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 351 in on_menu_tree_cursor_changed
    self.loadItems(self.menu_store[menu_path][2], menu_path)
  • File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 214 in loadItems
    for item, show in self.editor.getItems(menu):
  • File "/usr/lib/python2.7/site-packages/Alacarte/MenuEditor.py", line 151 in getItems
    item = item_iter.get_separator()
AttributeError: 'TreeIter' object has no attribute 'get_separator'

It doesn't seem to me that the attached patch would fix the problem in the original backtrace.  It must have fixed some other problem.  I think the bug as reported is not really fixed.

Commenting out the offending lines with get_separator() allows alacarte to start.
Comment 10 Pavel Roskin 2012-06-25 05:19:59 UTC
Sorry, I spoke too soon.  I didn't realize that gnome-menus also needs to be patched.  I rebuilt the gnome-menus rpm with the patch, and now the alacarte window would appear.
Comment 11 Jasper St. Pierre (not reading bugmail) 2012-06-25 05:31:39 UTC
You also commented on the Fedora bug about the window still being useless. What do you mean?
Comment 12 Pavel Roskin 2012-06-25 13:55:44 UTC
I cannot create any new menu or item under LXDE.  It turns out I can create menus and items under GNOME.  alacarte shows them where I create them.  However, the Application menu in GNOME Shell shows the new items under Others and the new menus are not shown at all.  Then I logged in under LXDE and found the new items in the Other menu as well.

What I really want is to add xterm, firefox and a few other programs to the top level menu and have them above Accessories and other menus.  I want everything to work in LXDE without ever having to log in under GNOME.

I could do that with alacarte on Fedora versions that came with GNOME 2.x.  But it's impossible now.
Comment 13 Jasper St. Pierre (not reading bugmail) 2012-06-25 14:23:58 UTC
How can you not create any new menu or item under LXDE? Can you file another bug for it, with explanations of what you see?

I reproduced the gnome-shell menu issue and it's a gnome-shell issue. I'll look into it this week.