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 440059 - Bad check for direction "out" parameters with return-type "none"
Bad check for direction "out" parameters with return-type "none"
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: codegen
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: atk-proxy 440034
 
 
Reported: 2007-05-20 23:38 UTC by Peter Parente
Modified: 2008-07-16 10:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Peter Parente 2007-05-20 23:38:04 UTC
There is an explicit check to see if the return value is Py_None on a virtual method marked return-type "none". This is fine and expected, except when the virtual method has parameters with outbound values.

The following in gtk-base.defs:

(define-virtual toggle_size_request
  (of-object "GtkMenuItem")
  (return-type "none")
  (parameters
    '("gint*" "requisition" (direction "out"))
  )
)


produces a _wrap_GtkMenuItem__proxy_do_toggle_size_request function in gtk.c with the following sequence of code:

py_retval = PyObject_CallObject(py_method, NULL);
...
if (py_retval != Py_None) {
...
}
py_retval = Py_BuildValue("(N)", py_retval);

The problem here is that the Python method implementing do_toggle_size_request must return the integer value to be stored in the requisition outbound parameter. However, the explicit check to see if py_retval is Py_None gets in the way in this case.

This causes problems for many of the functions in atk too.
Comment 1 Gustavo Carneiro 2007-05-21 14:04:11 UTC
Sounds like a bug.
Comment 2 Gustavo Carneiro 2007-05-23 15:35:08 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 3 Loïc Minier 2007-07-10 09:14:38 UTC
This change broke some applications; please see bug #455468.