GNOME Bugzilla – Bug 682355
Cannot pass GParamSpec arguments
Last modified: 2018-01-10 20:18:54 UTC
The problem looks like a namespace bug, with the following traceback : TypeError: argument pspec: Expected GObject.ParamSpec, but got gobject.GParamSpec It also occurs with the hand written bindings for g_object_class_list_properties, which led me to think pyg_param_spec.c didn't register the types correctly. Unfortunately, I couldn't find the exact reason why. Attached is a testcase.
Created attachment 221996 [details] [review] This applies to pygobject
Created attachment 221997 [details] [review] This applies to gobject-introspection
Created attachment 221999 [details] [review] This applies to gobject-introspection
The static bindings of GParamSpec (in the gobject module) should probably be removed in favor of the introspected ones in gi/GObject.
Thanks for the tip, I'll have a try soon
Note, in bug 683099 I attached a test case which checks a full round-trip from Python through C back to Python via a signal argument. This currently fails bitterly due to multiple bugs. Note that before we can drop the static bindings for GParamSpec, the GObject.param_spec_* methods must be fixed to become introspectable (they currently are not). We also need to provide overrides for providing a backwards compatible API: the GObject.ParamSpec API e. g. uses .get_name(), where our _gobject.ParamSpec uses .name.
This will be resolved by 685275 but let's keep this bug open until that's done.
*** Bug 690463 has been marked as a duplicate of this bug. ***
Comment on attachment 221999 [details] [review] This applies to gobject-introspection This g-i patch has been superseded by a more complete one, which actually asserts some properties of the GParamSpec argument: http://git.gnome.org/browse/gobject-introspection/commit/?id=5e4ddbcb8eacede04d5ade9e630d2efe29c022a0
Comment on attachment 221996 [details] [review] This applies to pygobject This has been superseded by a more complete test: http://git.gnome.org/browse/pygobject/commit/?id=b092630efc691a6f7ae94ae896193254f5a961a6 Thanks!
The C -> Python direction has already worked fine for some time (these are covered by tests), so retitling the bug accordingly.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/30.