Crash on startup: TypeError: getattr(): attribute name must be string

Bug #830634 reported by maxx on 2011-08-21
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GNOME Activity Journal
Medium
Unassigned
Zeitgeist Framework
Fix Released
Undecided
Siegfried Gevatter
gnome-activity-journal (Fedora)
Fix Released
Undecided

Bug Description

The bug was first reported here:

https://bugzilla.redhat.com/show_bug.cgi?id=725821

It is still happening with the latest 0.8.0 release of gnome-activity-journal as well as a current checkout from bzr. This is with zeitgeist 0.8.1.

The full output when attempting to run gnome-activity-journal is:

Traceback (most recent call last):
  File "/usr/bin/gnome-activity-journal", line 88, in <module>
    from src.external import CLIENT, CLIENT_VERSION
  File "/usr/share/gnome-activity-journal/src/external.py", line 88, in <module>
    CLIENT_VERSION = CLIENT.get_version()
  File "/usr/lib/python2.7/site-packages/zeitgeist/client.py", line 450, in get_version
    return [int(i) for i in self._iface.version()]
  File "/usr/lib/python2.7/site-packages/zeitgeist/client.py", line 207, in version
    self.INTERFACE_NAME, "version")
  File "/usr/lib/python2.7/site-packages/zeitgeist/client.py", line 105, in _disconnection_safe
    meth = getattr(self.__iface, method_name)
TypeError: getattr(): attribute name must be string

Changed in gnome-activity-journal:
importance: Undecided → Medium
milestone: none → 0.8.1
status: New → Confirmed
Martijn Faassen (faassen) wrote :

A pdb shows that method_name is a dbus.proxies._ProxyMethod. This seems to be a callable itself.

I think there's another bug lurking here though, as the meth it tries to getattr is never actually used. Maybe it should be returned? Not knowing what is really going on I tried various things, but to no avail - I only get crashes later on
in get_version.

Martijn Faassen (faassen) wrote :

Maybe the getattr without results is intentional; I see some __getattr__ hacking in this class. I'd get rid of that __getattr__ if I were you, as it's likely to invite more hard to debug issues.

Martijn Faassen (faassen) wrote :

Okay, I hacked my way into getting a GUI. Here's my hack around line 105 (the place of the original traceback). Replace the line:

                       meth = getattr(self.__iface, method_name)

with this:

                        import dbus.proxies
                        if not isinstance(method_name, dbus.proxies._ProxyMethod):
                            meth = getattr(self.__iface, method_name)
                        else:
                            meth = method_name
                        return meth(*args, **kwargs)

this along with the scary __getattr__ (which is already there but which I criticized before) will make things work at least enough to make the GUI appear on Fedora 15.

I'm not proposing this as a real patch, as I have no idea what I'm doing. I have the feeling that there was a slow accumulation of magic in this class probably intended to make programming easier, but now pretty scary to me (and leading to odd bugs like this).

Siegfried Gevatter (rainct) wrote :

Hi,

This problem is fixed in Zeitgeist 0.8.1.1 (the particular commit, in case you're curious, is http://bazaar.launchpad.net/~zeitgeist/zeitgeist/trunk/revision/1789).

Changed in zeitgeist:
assignee: nobody → Siegfried Gevatter (rainct)
status: New → Fix Released
Changed in gnome-activity-journal:
milestone: 0.8.1 → none
Changed in gnome-activity-journal (Fedora):
importance: Unknown → Undecided
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.