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 745014 - cannot access array of struct from python
cannot access array of struct from python
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: gobject
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-23 13:38 UTC by jdemeyer
Modified: 2018-01-10 20:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description jdemeyer 2015-02-23 13:38:30 UTC
Hello,

I'm trying to read values written by a C library (with GObjects) in python with g-i. I try to mix C and Python in a GStreamer application.

I have followed the pattern here (i.e. using GBoxedType) : http://blog-vpodzime.rhcloud.com/?p=33
I made it works but I'm stuck when the structure defined in C has an array of another structure.
In the real program (too complicated to show it to you), a get a :
** (python3:5741): CRITICAL **: Stack overflow protection. Can't copy array element into GIArgument.

After that, I tried to make a simple example and even if the behaviour is not the same, I cannot access values in the inner structure (It works if I don't use array or with array of int).

The code is available there:
https://gist.github.com/macq-jdemeyer/73a90e07418bfac5bbb3
To make it works :
make
export GI_TYPELIB_PATH=`pwd`
export LD_LIBRARY_PATH=`pwd`/.libs:$LD_LIBRARY_PATH
./test.py

I have an array of None where I should have an array of TutAnotherStruct
Comment 1 GNOME Infrastructure Team 2018-01-10 20:48:56 UTC
-- 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/96.