[Bug 1548425] Re: update-manager crashed with AttributeError in check_hovering(): 'tuple' object has no attribute 'get_tags'
Marius Gedminas
marius at gedmin.as
Fri May 20 08:08:36 UTC 2016
The crash is in the following code:
def check_hovering(self, x, y):
"""Check if the mouse is above a tagged link and if yes show
a hand cursor"""
_hovering = False
# get the iter at the mouse position
iter = self.get_iter_at_location(x, y)
# set _hovering if the iter has the tag "url"
tags = iter.get_tags()
The error is "AttributeError: '_ResultTuple' object has no attribute 'get_tags'".
self is an instance of a subclass of Gtk.TextView, which has a
`get_iter_at_location()` method that returns a tuple (bool, iterator):
http://lazka.github.io/pgi-
docs/#Gtk-3.0/classes/TextView.html#Gtk.TextView.get_iter_at_location
(I'm guessing PyGTK used to return just the iterator (or None), but with the migration to PyGObject + gobject-introspection + GTK+ 3.x this changed.)
Suggested fix: iter = self.get_iter_at_location(x, y)
This buggy code pattern is also repeated in button_press_event.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1548425
Title:
update-manager crashed with AttributeError in check_hovering():
'tuple' object has no attribute 'get_tags'
Status in update-manager package in Ubuntu:
Incomplete
Bug description:
Unexpectedly crash on close.
ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: update-manager 1:15.10.3
ProcVersionSignature: Ubuntu 4.4.0-7.22-generic 4.4.2
Uname: Linux 4.4.0-7-generic x86_64
ApportVersion: 2.20-0ubuntu3
Architecture: amd64
CrashCounter: 1
CurrentDesktop: GNOME
Date: Mon Feb 22 14:36:11 2016
ExecutablePath: /usr/bin/update-manager
GsettingsChanges:
b'com.ubuntu.update-manager' b'show-details' b'true'
b'com.ubuntu.update-manager' b'window-height' b'733'
b'com.ubuntu.update-manager' b'first-run' b'false'
b'com.ubuntu.update-manager' b'window-width' b'817'
b'com.ubuntu.update-manager' b'launch-time' b'1456162554'
InstallationDate: Installed on 2015-11-10 (104 days ago)
InstallationMedia: Ubuntu-GNOME 16.04 LTS "Xenial Xerus" - Alpha amd64 (20151108)
InterpreterPath: /usr/bin/python3.5
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/update-manager
ProcEnviron:
LANGUAGE=pt_BR:pt:en
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=pt_BR.UTF-8
SHELL=/bin/bash
PythonArgs: ['/usr/bin/update-manager']
SourcePackage: update-manager
Title: update-manager crashed with AttributeError in check_hovering(): 'tuple' object has no attribute 'get_tags'
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm audio bluetooth cdrom clamav dip firebird gdm lp lpadmin plugdev pulse sambashare src ssh sudo tty users utmp uucp uuidd vboxusers video www-data
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1548425/+subscriptions
More information about the foundations-bugs
mailing list