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 668356 - Can not access to gpointer values inside a struct
Can not access to gpointer values inside a struct
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other All
: Normal critical
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-20 16:59 UTC by Cédric Krier
Modified: 2012-02-10 08:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test.py (62 bytes, application/octet-stream)
2012-01-20 17:20 UTC, Cédric Krier
  Details
Patch (1.32 KB, patch)
2012-01-21 18:40 UTC, Cédric Krier
none Details | Review
Patch (1.67 KB, patch)
2012-01-22 19:21 UTC, Cédric Krier
none Details | Review
Patch (1.45 KB, patch)
2012-01-22 20:49 UTC, Cédric Krier
needs-work Details | Review
A test script using TreeView and inherited TreeModel (3.69 KB, text/plain)
2012-01-22 21:12 UTC, Cédric Krier
  Details
Patch with test suite (2.08 KB, patch)
2012-01-25 10:44 UTC, Cédric Krier
none Details | Review

Description Cédric Krier 2012-01-20 16:59:20 UTC
Python stop with:
 SystemError: NULL result without error in PyObject_Call
when trying to access an attribute of a struct that is a gpointer.

In attachment a simple script example.
Comment 1 Cédric Krier 2012-01-20 17:20:40 UTC
Created attachment 205710 [details]
test.py
Comment 2 Cédric Krier 2012-01-21 18:40:41 UTC
Created attachment 205772 [details] [review]
Patch

Here is a patch that fix the issue.
Comment 3 Cédric Krier 2012-01-22 19:21:02 UTC
Created attachment 205828 [details] [review]
Patch

A better patch that takes care of increasing reference counter when object is set to a gpointer.
Comment 4 Cédric Krier 2012-01-22 20:49:17 UTC
Created attachment 205835 [details] [review]
Patch

New patch that increase/decrease the right objects.
Comment 5 Cédric Krier 2012-01-22 21:12:15 UTC
Created attachment 205838 [details]
A test script using TreeView and inherited TreeModel

This test script runs now with the patch applied.
Comment 6 Tomeu Vizoso 2012-01-24 15:53:33 UTC
Comment on attachment 205835 [details] [review]
Patch

Could you add a test case covering this to the test suite? Thanks!
Comment 7 Cédric Krier 2012-01-25 10:44:56 UTC
Created attachment 206072 [details] [review]
Patch with test suite

Here is the patch with test suite.
Comment 8 Martin Pitt 2012-02-10 08:06:55 UTC
Thanks for this! I took the liberty of moving the test case from test_overrides (it's not related to overrides) to test_everything.py, and use a GValue instead (to avoid pulling in GTK there):

http://git.gnome.org/browse/pygobject/commit/?id=4aeb27efc43e131de5d0bc0f60dca7c1d34c3d45