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 121544 - GObject property flags are not working
GObject property flags are not working
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
2.9.0
Other Linux
: Normal normal
: ---
Assigned To: Python bindings maintainers
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2003-09-05 14:15 UTC by Lorenzo Gil Sanchez
Modified: 2006-01-09 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
code sample to show the bug (1023 bytes, text/plain)
2003-09-05 14:17 UTC, Lorenzo Gil Sanchez
Details

Description Lorenzo Gil Sanchez 2003-09-05 14:15:29 UTC
I created a property with the gobject.PARAM_READABLE flags and
object.set_property() is not giving an error with that property.

I'll attach some code to show what I mean.
Comment 1 Lorenzo Gil Sanchez 2003-09-05 14:17:47 UTC
Created attachment 19765 [details]
code sample to show the bug
Comment 2 James Henstridge 2003-12-23 13:51:27 UTC
The attached example now prints the following warning for me:

>>> print o1.set_property('prop-name', 'other value')
 
(process:12384): GLib-GObject-WARNING **: g_object_set_property:
property `prop-name' of object class `__main__+MyObject' is not writable
None
>>>

This seems to have been added by Tim on Nov 27.  We should probably be
checking this ourselves though, and raising the appropriate exception.
Comment 3 James Henstridge 2003-12-23 14:22:24 UTC
Added some checks to get_property() and set_property() for the
readable and writable flags on both branches.

I haven't done any checks for construct_only, because Python code
might want to call set_property during construction and I can't tell
whether that is happening or not.  Will have to rely on the C level
warning for that ...