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 687550 - gi struct array length annotations are not used with array fields
gi struct array length annotations are not used with array fields
Status: RESOLVED DUPLICATE of bug 678663
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-04 05:10 UTC by Simon Feltman
Modified: 2012-11-20 10:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Feltman 2012-11-04 05:10:55 UTC
Currently when accessing the "param_types" field of a GSignalQuery struct we get back an invalid GType:

$ python3 -c "import gi.module; print(gi.module.get_introspection_module('GObject').signal_query(1).param_types)"

<GType invalid (28749744)>

When looking into a fix, bug 687545 and bug 687541 were found. I was able to manually add the proper annotation to the GObject gir as noted in bug 687545. Typelibs and the gi api give back the proper info for struct array length fields but more problems were uncovered in pygi.

The above python code then gives the following error once the annotation is fixed:
** (process:22252): CRITICAL **: Unable to determine array length for 0x2895d30

Within gi/pygi-info.c:_wrap_g_field_info_get_value there is a special case for handling GI_TYPE_TAG_ARRAY fields. This handling re-uses _pygi_argument_to_array for an array field but it cannot properly handle lookup of an array length of a struct as the function is intended to work with function arguments, not struct fields. _pygi_argument_to_array could copied and specialized for struct fields to fix this.
Comment 1 Simon Feltman 2012-11-20 10:59:38 UTC

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