GNOME Bugzilla – Bug 775439
Catch AttributeError additionally to GLib.Error
Last modified: 2017-10-20 22:59:22 UTC
Hi, I've noticed a bug report on Debian with the following exception [1] Traceback (most recent call last):
+ Trace 236908
self.new_window()
window = meldwindow.MeldWindow()
self.widget.set_help_overlay(shortcut_window)
Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/meld/meldapp.py", line 78, in do_command_line tab = self.parse_args(command_line) File "/usr/lib/python2.7/dist-packages/meld/meldapp.py", line 336, in parse_args focus=i == 0) File "/usr/lib/python2.7/dist-packages/meld/meldapp.py", line 149, in open_files window = self.get_meld_window() File "/usr/lib/python2.7/dist-packages/meld/meldapp.py", line 144, in get_meld_window return self.get_active_window().meldwindow AttributeError: 'NoneType' object has no attribute 'meldwindow' I guess the the attached patch should fix the issue. Thanks, Andrey [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824603
Created attachment 341101 [details] [review] Proposed fix
I'm sure your patch fixes this, but I don't see how this can happen in any sane, release version of GTK+. The line: shortcut_window = builder.get_object("shortcuts-meld") should throw the GLib.Error being caught because it can't instantiate GtkShortcutsWindow. Best I can see, this traceback would require someone to have GtkShortcutsWindow but not set_help_overlay, but they were both included in the same stable release. Also, checking the debian bug report, Meld depends on GTK+ (etc.) 3.20 already, which (to me) means that this really, really can't happen if the reporter has their install in a sane state.
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment. Thanks!