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 639972 - raise a better exception when we aren't able to allocate a struct
raise a better exception when we aren't able to allocate a struct
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-01-19 18:04 UTC by Tomeu Vizoso
Modified: 2012-09-03 16:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tomeu Vizoso 2011-01-19 18:04:08 UTC
If a struct is opaque and g-i reports a size of 0 _and_ there isn't a suitable default constructor, a MemoryError is raised because we try to allocate a buffer of 0 bytes.

Instead, we should give a better error that instructed people to add an override or fix it in the C level.
Comment 1 Martin Pitt 2012-09-03 16:00:28 UTC
Fixed with a test case:

http://git.gnome.org/browse/pygobject/commit/?id=77844c571ad0bad