Package: reportbug
Followup-For: Bug #853159

It may make sense to create a new reportbug-gtk-ui binary package with
proper Depends: instead of Suggests:, but this is too late for the
upcoming stable release.

In the meantime, we can at least fix the crashes and fall back to the
text ui as intended.

The attached patch fixes both #852652 and #853159.
>From 7c4ef828a097583f71144e2b785e15c9a7895a55 Mon Sep 17 00:00:00 2001
From: Nis Martensen <[email protected]>
Date: Mon, 30 Jan 2017 23:52:20 +0100
Subject: [PATCH 3/3] ui/gtk2_ui: fix incomplete fallback to text ui

This fixes crashes when the python3-gi-cairo and gir1.2-vte-2.91
packages are not installed, so that the fallback can work in these
cases.
---
 reportbug/ui/gtk2_ui.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index f60a1eb..3d74a7a 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -42,6 +42,8 @@ try:
 
     gi.require_version('Gtk', '3.0')
     from gi.repository import Gtk
+
+    gi.require_foreign('cairo')
 except ImportError:
     raise UINotImportable('Please install the python3-gi and gir1.2-gtk-3.0 packages to use this interface.')
 
@@ -1777,7 +1779,7 @@ def initialize():
     try:
         gi.require_version('Vte', '2.91')
         from gi.repository import Vte
-    except ImportError:
+    except (ImportError, ValueError):
         message = """Please install the %s package to use the GTK+(known as 'gtk2' in reportbug) interface.
 Falling back to 'text' interface."""
         dialog = Gtk.MessageDialog(None, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
-- 
2.1.4

_______________________________________________
Reportbug-maint mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint

Reply via email to