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 686496 - signal decorator fails with "selection_changed" signal
signal decorator fails with "selection_changed" signal
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: 683312
 
 
Reported: 2012-10-19 20:17 UTC by Paolo Borelli
Modified: 2012-10-20 09:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase (291 bytes, text/plain)
2012-10-19 20:18 UTC, Paolo Borelli
  Details
Fix Signal decorator to not use base class gsignals dict (3.29 KB, patch)
2012-10-20 09:55 UTC, Simon Feltman
committed Details | Review

Description Paolo Borelli 2012-10-19 20:17:38 UTC
If I try to register a "selection_changed" signal on an object that's not an iconview, but I also have an IconView subclass (see testcase), I get the following error

/opt/gnome/lib64/python2.7/site-packages/gi/_gobject/__init__.py:280: Warning: gsignal.c:1627: signal "selection_changed" already exists in the `GtkIconView' class ancestry
Comment 1 Paolo Borelli 2012-10-19 20:18:25 UTC
Created attachment 226854 [details]
testcase
Comment 2 Simon Feltman 2012-10-20 00:58:09 UTC
Confirmed. The problem looks to be with signalhelper.py:install_signals where it uses: gsignals = getattr(cls, '__gsignals__', {})

Using getattr here will pull in these defs from base class if the class variable is not defined and re-assign them to the current class going through the meta class. Interestingly this code was based on the property helper install_properties so I wonder if Properties will exhibit the behavior with a similar setup.

In any case I will look into a fix for this a little later tonight and cherry pick it for pygobject 3.4.
Comment 3 Simon Feltman 2012-10-20 09:55:10 UTC
Created attachment 226878 [details] [review]
Fix Signal decorator to not use base class gsignals dict

Fix install_signals to not use the parent classes __gsignals__
dict if one does not exist on the given class.