Package: reportbug
Version: 7.1.2
Tags: patch
Severity: important

When I try to use the GTK3 backend to report a bug, I get the following
stack trace:

> Traceback (most recent call last):
>   File "/usr/bin/reportbug", line 2233, in <module>
>     main()
>   File "/usr/bin/reportbug", line 1107, in main
>     return iface.user_interface()
>   File "/usr/bin/reportbug", line 2149, in user_interface
>     package, severity, mode, charset=charset, tags=tags)
>   File "/usr/bin/reportbug", line 182, in handle_editing
>     editor, charset)
>   File "/usr/lib/python3/dist-packages/reportbug/ui/gtk2_ui.py", line 1561, 
> in func
>     op = klass(parent)
>   File "/usr/lib/python3/dist-packages/reportbug/ui/gtk2_ui.py", line 539, in 
> __init__
>     self.widget = self.create_widget()
>   File "/usr/lib/python3/dist-packages/reportbug/ui/gtk2_ui.py", line 1173, 
> in create_widget
>     expander = Gtk.Expander("Other system information")
> TypeError: GObject.__init__() takes exactly 0 arguments (1 given)

This is because, while a lot of the constructors have been overridden by
PyGObject to handle the deprecated form, Expander has not been
overridden, so the explicit form has to be used. Patch attached.
Unfortunately, after applying it, it now crashes with:

> (reportbug:15278): Gtk-CRITICAL **: gtk_text_attributes_ref: assertion
> 'values != NULL' failed
> 
> (reportbug:15278): Gtk-CRITICAL **: gtk_text_attributes_ref: assertion
> 'values != NULL' failed
> 
> (reportbug:15278): Pango-CRITICAL **: pango_layout_new: assertion
> 'context != NULL' failed
> [1]    15278 segmentation fault  reportbug src:pymongo

Putting in prints doesn't seem to help; the exact location is
non-deterministic from what I can tell. I would guess there are some UI
interactions happening not on the main UI thread.

Regards,
James
>From afb99028e993c87bea2b122f9b76e78acd537cfa Mon Sep 17 00:00:00 2001
From: James Clarke <jrt...@debian.org>
Date: Mon, 9 Jan 2017 18:48:43 +0000
Subject: [PATCH] gtk2_ui: Avoid deprecated Gtk.Expander(str) constructor not
 exposed by gi

---
 reportbug/ui/gtk2_ui.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index 2829cf0..e9099c2 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -191,7 +191,7 @@ class ExceptionDialog(CustomDialog):
 
     def setup_dialog(self, vbox, tb):
         # The traceback
-        expander = Gtk.Expander("More details")
+        expander = Gtk.Expander.new_with_mnemonic("More details")
         vbox.pack_start(expander, True, True, 0)
 
         view = Gtk.TextView()
@@ -1170,7 +1170,7 @@ class EditorPage(Page):
         scrolled = create_scrollable(self.view)
         vbox.pack_start(scrolled, True, True, 0)
 
-        expander = Gtk.Expander("Other system information")
+        expander = Gtk.Expander.new_with_mnemonic("Other system information")
         view = Gtk.TextView()
         view.set_editable(False)
         self.others_buffer = view.get_buffer()
-- 
2.11.0

_______________________________________________
Reportbug-maint mailing list
Reportbug-maint@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint

Reply via email to