[New-bugs-announce] [issue14138] Ctrl-C does not terminate GTK3 Gtk.main() loop when program run from command line

Narnie Harshoe report at bugs.python.org
Mon Feb 27 04:13:28 CET 2012


New submission from Narnie Harshoe <signupnarnie at gmail.com>:

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 that 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


$ python -c "import gtk
> gtk.main()
> "
^CTraceback (most recent call last):
  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.

----------
components: None
messages: 154427
nosy: Narnie.Harshoe
priority: normal
severity: normal
status: open
title: Ctrl-C does not terminate GTK3 Gtk.main() loop when program run from command line
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14138>
_______________________________________


More information about the New-bugs-announce mailing list