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 670924 - Ctrl-C does not terminate GTK3 Gtk.main() loop when program run from command line
Ctrl-C does not terminate GTK3 Gtk.main() loop when program run from command ...
Status: RESOLVED DUPLICATE of bug 622084
Product: pygobject
Classification: Bindings
Component: introspection
3.1.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-28 00:22 UTC by narnie
Modified: 2012-03-01 13:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description narnie 2012-02-28 00:22:08 UTC
In a normal python program, Ctrl-C will set up a KeyboardInterrupt and terminate the program. This works with a normal python script, including GTK2 gtk.main(), but GTK3 Gtk.main() (even when used in a more robust GTK program than coded below) will not terminate with Ctrl-C requiring a Ctrl-Z and killing the job to terminate. See the commmand line output below:

$ python -c "while True:
>  pass
> "
^CTraceback (most recent call last):
  • File "<string>", line 1 in <module>
    KeyboardInterrupt
  • File "<string>", line 2 in <module>
    KeyboardInterrupt


$ python -c "from gi.repository import Gtk
> Gtk.main()
> "
^C
^C
^Z
[1]+  Stopped                 python -c "from gi.repository import Gtk
Gtk.main()
"
$ kill %1

[1]+  Stopped                 python -c "from gi.repository import Gtk
Gtk.main()
"

The behaviour under Gtk.main() should be changed to respond to the KeyboardInterrupt.
Comment 1 Jose Rostagno 2012-03-01 13:12:52 UTC
I think this is a duplicate of Bug 622084 - Ctrl+C does not exit gtk app
Comment 2 Paolo Borelli 2012-03-01 13:15:17 UTC
indeed.

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