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 686608 - Fails to start after failing to set tool item types
Fails to start after failing to set tool item types
Status: RESOLVED FIXED
Product: gaupol
Classification: Other
Component: general
0.20
Other Linux
: Normal major
: ---
Assigned To: gaupol-maint@gnome.bugs
gaupol-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2012-10-22 07:32 UTC by Evangelos Foutras
Modified: 2013-02-19 18:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to disable menu tool buttons (3.42 KB, patch)
2012-11-05 20:10 UTC, Osmo Salomaa
none Details | Review

Description Evangelos Foutras 2012-10-22 07:32:35 UTC
Gaupol fails to start with Python 3.3 (on Arch Linux). It used to work with Python 3.2 as far as I recall.

Software versions used:

gaupol 0.20
python-gobject 3.4.1.1
iso-codes 3.38

Below are the warnings/errors I get when trying to launch Gaupol:

$ gaupol 
/usr/lib/python3.3/site-packages/gi/types.py:47: Warning: g_object_set: assertion `G_IS_OBJECT (object)' failed
  return info.invoke(*args, **kwargs)

(gaupol:16240): Gtk-CRITICAL **: gtk_activatable_set_related_action: assertion `GTK_IS_ACTIVATABLE (activatable)' failed
/usr/lib/python3.3/site-packages/gi/types.py:47: Warning: g_object_ref_sink: assertion `G_IS_OBJECT (object)' failed
  return info.invoke(*args, **kwargs)

(gaupol:16240): Gtk-CRITICAL **: gtk_widget_set_name: assertion `GTK_IS_WIDGET (widget)' failed

(gaupol:16240): Gtk-CRITICAL **: gtk_toolbar_insert: assertion `GTK_IS_TOOL_ITEM (item)' failed
/usr/lib/python3.3/site-packages/gi/types.py:47: Warning: instance with invalid (NULL) class pointer
  return info.invoke(*args, **kwargs)
/usr/lib/python3.3/site-packages/gi/types.py:47: Warning: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
  return info.invoke(*args, **kwargs)
Traceback (most recent call last):
  • File "/usr/bin/gaupol", line 29 in <module>
    gaupol.main.main(sys.argv[1:])
  • File "/usr/lib/python3.3/site-packages/gaupol/main.py", line 171 in main
    _init_application(opts, args)
  • File "/usr/lib/python3.3/site-packages/gaupol/main.py", line 37 in _init_application
    application = gaupol.Application()
  • File "/usr/lib/python3.3/site-packages/gaupol/application.py", line 135 in __init__
    self._init_gui()
  • File "/usr/lib/python3.3/site-packages/gaupol/application.py", line 209 in _init_gui
    self._init_main_toolbar(vbox)
  • File "/usr/lib/python3.3/site-packages/gaupol/application.py", line 223 in _init_main_toolbar
    self._init_undo_button()
  • File "/usr/lib/python3.3/site-packages/gaupol/application.py", line 330 in _init_undo_button
    undo_button = self.get_tool_item("undo_action")
  • File "/usr/lib/python3.3/site-packages/gaupol/agents/util.py", line 103 in get_tool_item
    return [x for x in widgets if isinstance(x, Gtk.ToolItem)][0]
IndexError: list index out of range

Comment 1 Osmo Salomaa 2012-10-22 17:17:35 UTC
I don't find any clues in that output. My best guess is that you have some GObject introspection, PyGObject or Python packaging problem in Arch. I haven't tried Python 3.3 myself (still using 3.2), but I don't see any major changes there [1]. gaupol 0.20 to my knowledge works fine at least on debian unstable and fedora 17.

[1] http://docs.python.org/py3k/whatsnew/3.3.html
Comment 2 Evangelos Foutras 2012-10-29 08:34:44 UTC
Just tested on Fedora 18 Alpha (installed all 599 updates first!) and it fails to start in the exact same way. I don't think it's a packaging error on Arch's or Fedora's side.

Also, if I comment out the 'self._init_main_toolbar(vbox)' line in application.py:_init_gui(), gaupol is able to start (obviously with no toolbar).

Maybe gaupol is not compatible with PyGObject 3.4.x?

Thanks for your help.
Comment 3 Osmo Salomaa 2012-10-29 22:29:22 UTC
(In reply to comment #2)
> Just tested on Fedora 18 Alpha (installed all 599 updates first!) and it fails
> to start in the exact same way. I don't think it's a packaging error on Arch's
> or Fedora's side.

Oh, okay.

> Maybe gaupol is not compatible with PyGObject 3.4.x?

Either that or a newer gtk+.

It's probably best that I find a way to test this myself. Based on a quick look [1], it seems that pygobject3 is included on the f18 live cd. I'll see if I can test gaupol with that next weekend.

[1] http://kojipkgs.fedoraproject.org//work/tasks/5718/4635718/livecd.log
Comment 4 Osmo Salomaa 2012-11-03 17:03:21 UTC
Posting from a fedora 18 live system.

Your original traceback did contain the problem after all. The problem lies in setting the tool item types, i.e. dropdown arrows on open, undo and redo buttons. I filed this as bug 687522 against pygobject; the same fails on their own demo.

I'll see if I can come up with some workaround, e.g. regressing those menutoolbuttons to regular toolbuttons.
Comment 5 Osmo Salomaa 2012-11-05 20:10:03 UTC
Created attachment 228184 [details] [review]
Patch to disable menu tool buttons

Here's a workaround that uses regular Gtk.ToolButtons instead of Gtk.MenuToolButtons. If you need a fix right now, just apply this patch against gaupol 0.20 or git head. gaupol should start, you'll just be missing drop-down arrows on undo and redo buttons.

I didn't test this patch on f18 or arch, but it should work, let me know if it doesn't.
Comment 6 Evangelos Foutras 2012-11-05 20:42:00 UTC
Review of attachment 228184 [details] [review]:

Workaround works well; gaupol starts correctly and doesn't output any errors to the terminal on start-up.

Hopefully, the removed functionality can be restored once the pygobject people fix or comment on bug 687522.
Comment 7 Osmo Salomaa 2012-11-11 00:04:34 UTC
Thanks for checking. Still no word from PyGobject devs. I'll release 0.20.1 (tomorrow perhaps) with this patch and a couple other bug fixes. I'll keep this bug open until this workaround can be replaced with a proper fix. I want those damn drop-down arrows back.
Comment 8 Osmo Salomaa 2013-02-19 18:42:45 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

I can't manage to test it yet, but I trust PyGObject 3.7.90 fixes this as advertised.

commit eb9034590060b0b3cc67d17c4eca564402a0069e
Author: Osmo Salomaa <otsaloma@iki.fi>
Date:   Tue Feb 19 20:24:39 2013 +0200

    Restore drop-down arrows on undo and redo toolbar buttons.
    
    Restore the do_create_tool_item method, but remove that at the class
    level if using PyGObject earlier than 3.7.90.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686608
    https://bugzilla.gnome.org/show_bug.cgi?id=687522

https://github.com/otsaloma/gaupol/commit/eb9034590060b0b3cc67d17c4eca564402a0069e