GNOME Bugzilla – Bug 788890
Problem when returning an array of enum values
Last modified: 2017-10-23 08:54:49 UTC
I've put up a simple example to reproduce the issue at https://github.com/MathieuDuponchelle/pygobject-enum-array-return , runnable with: meson build meson test -C build -v The introspected function is very simple, it returns an array of two enum values, TEST_FOO and TEST_BAR, in the python program we get [TEST_FOO, TEST_FOO]. If g_new0 isn't used to initialize the array, then we see "invalid enum value: 1701474162" If the prototype of the function is modified to return an array of gint, we do get [0, 1] as expected.
Thanks
Same cause as bug 646581 I think
Created attachment 362056 [details] [review] to_py_array: Properly handle enum array items It used the fallback path and copied pointers. Do the same thing we do for integer items instead.
Review of attachment 362056 [details] [review]: LGTM