Hello,

GtkRet_FromPyObject doesn't check for conversion errors, the error
condition is not cleared and may have ill effects on the python callback
which is executed with the next event.

It is called by PyGtk_CallbackMarshal and PyGtk_SignalMarshal. At the
end of PyGtk_CallbackMarshal I added (sorry, no diff.. it's right
before the "Py_DECREF(ret);" at the end of the function):

  if (PyErr_Occurred()) {
    PyErr_Print();
    PyErr_Clear();
    }

This doesn't print a call stack (there is none), but still a one-line
message. The same code could be added to the end of
PyGtk_SignalMarshal (I don't know for which signals it is used, so I
didn't change/test that part of the code).

You get such a conversion error when you define e.g. a handler for
key_press_event which forgets to return a value (so it returns None,
which can't be converted to int (bool)).

I've also created a python class to replace sys.stderr which pops up a
modal window with a display of the text when something is written to
stderr (e.g. an error traceback) in a modal window. If someone is
interested I'll mail it to the list.

Andreas
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to