Bug#743208: python3-gi: Ctrl-C does not abort Gtk.main()

Luca Boccassi bluca at debian.org
Tue Dec 12 18:08:20 UTC 2017


Control: tags -1 patch stretch
Control: fixed -1 3.27.0

On Mon, 31 Mar 2014 15:49:38 +0200 Roland Koebler <r.koebler at yahoo.de>
wrote:
> Package: python3-gi
> Version: 3.2.2-2
> Severity: important
> Tags: upstream
> 
> Dear Maintainer,
> 
> when starting a Python-GTK+-program from a terminal, pressing Ctrl-C
> does nothing. Usually, Ctrl-C aborts programs, and it did with older
> PyGTK-versions, but it doesn't with python3-gi; the same applies to
> python-gi, and it probably also applies to upstream.
> 
> It looks like KeyboardInterrupt or SIGINT is catched in Gtk.main(),
> which is a very bad idea, and results in totally unexpected
behaviour,
> making it impossible to abort a program with Ctrl-C.
> 
> Example:
> 
> - normal behaviour of Ctrl-C in Python:
> 
>   $ python
>   >>> while(1): pass
>   ...
>   ^CTraceback (most recent call last):
>     File "<stdin>", line 1, in <module>
>    KeyboardInterrupt
> 
> - python3-gi/python-gi behaviour:
> 
>   $ python
>   >>> from gi.repository import Gtk
>   >>> Gtk.main()
>   ^C^C^C^C^C^C^C^C^C^C
> 
> - So, to stop Gtk.main(), I would manually have to kill Python:
> 
>   ^Z
>   [1]+  Stopped                 python
>   $ ps |grep python
>   12517 pts/35   00:00:01 python
>   $ kill 12517
>   $ fg
>   python
>   Terminated
>   $
> 
> This not only applies to running GTK+ in the interactive Python-
interpreter,
> but to all Python-GTK+-programs.

Formatted patches attached, they apply cleanly on 3.22.0-2 on Stretch
and fix the problem. Please consider for stretch-p-u if time allows and
you find the solution adequate. Thanks!

-- 
Kind regards,
Luca Boccassi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02_run_sig_handler.patch
Type: text/x-patch
Size: 12648 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20171212/c7c60390/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03_default_sig_handler.patch
Type: text/x-patch
Size: 12679 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20171212/c7c60390/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20171212/c7c60390/attachment-0001.sig>


More information about the pkg-gnome-maintainers mailing list