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 702634 - Handle exceptions in idle_add/timeout_add
Handle exceptions in idle_add/timeout_add
Status: RESOLVED DUPLICATE of bug 702552
Product: pygobject
Classification: Bindings
Component: general
3.8.x
Other Linux
: Normal enhancement
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-19 10:40 UTC by Christoph Reiter (lazka)
Modified: 2013-06-19 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christoph Reiter (lazka) 2013-06-19 10:40:42 UTC
If an unhandled exception occurs in idle_add/timeout_add the source doesn't get removed, leading to endless calls of the same function which leads to the same exception again... 

While this is of course a user error, it is really hard to debug errors since stdout/stderr get spamed without end.

Possible solutions I can imagine:
 - Handle in the overrides, print the stacktrace and return False
 - Somehow make the bool return value in case of an error False in all callbacks..

The following example leads to endless stacktraces, while only one is printed with pygtk.

##################################

from gi.repository import GLib, Gtk
def faulty_function():
    raise Exception
GLib.idle_add(faulty_function)
Gtk.main()
Comment 1 Simon Feltman 2013-06-19 14:22:43 UTC

*** This bug has been marked as a duplicate of bug 702552 ***