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 653007 - Setting TYPE_OBJECT property to None results in a warning
Setting TYPE_OBJECT property to None results in a warning
Status: RESOLVED DUPLICATE of bug 661155
Product: pygobject
Classification: Bindings
Component: gobject
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: 666182
 
 
Reported: 2011-06-20 13:55 UTC by Ivan Stankovic
Modified: 2011-12-14 15:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The backtrace (2.09 KB, text/plain)
2011-06-20 13:55 UTC, Ivan Stankovic
  Details
A patch that fixes the problem (652 bytes, patch)
2011-09-15 08:12 UTC, Ivan Stankovic
none Details | Review

Description Ivan Stankovic 2011-06-20 13:55:51 UTC
Created attachment 190273 [details]
The backtrace

This program:

import gobject

class X(gobject.GObject):
    __gproperties__ = {
        'foo' : (gobject.TYPE_OBJECT, 'foo property', None,
                 gobject.PARAM_READWRITE)
    }

    def __init__(self):
        gobject.GObject.__init__(self)
        self.foo = None

    def do_get_property(self, prop):
        if prop.name == 'foo':
            return self.foo

    def do_set_property(self, prop, value):
        if prop.name == 'foo':
            self.foo == value

gobject.type_register(X)

x = X()
x.props.foo = None

will give the following warning:

GLib-GObject-CRITICAL **: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed

This is with glib 2.28.8, pygobject 2.28.4 and Python 2.7. The backtrace is
attached. It seems to me that pyg_value_as_pyobject should check that the
return value of g_value_get_object is not NULL before passing it to
pygobject_new_sunk.
Comment 1 johnp 2011-06-20 21:16:06 UTC
I thought we fixed this.  That is exactly what is happening.
Comment 2 Ivan Stankovic 2011-09-15 08:12:58 UTC
Created attachment 196594 [details] [review]
A patch that fixes the problem

The patch applies to the 2.28 branch and I would really appreciate if it
could land in for the upcoming bugfix release.
Comment 3 johnp 2011-12-14 15:22:54 UTC

*** This bug has been marked as a duplicate of bug 661155 ***