GNOME Bugzilla – Bug 653007
Setting TYPE_OBJECT property to None results in a warning
Last modified: 2011-12-14 15:36:01 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.
I thought we fixed this. That is exactly what is happening.
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.
*** This bug has been marked as a duplicate of bug 661155 ***