After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702593 - Properties of type "v" cause a traceback and aren't shown
Properties of type "v" cause a traceback and aren't shown
Status: RESOLVED FIXED
Product: d-feet
Classification: Other
Component: general
0.3.x
Other Linux
: Normal normal
: ---
Assigned To: D-Feet Maintainer(s)
D-Feet Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-06-18 19:06 UTC by Daniel Manrique
Modified: 2013-06-19 06:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Manrique 2013-06-18 19:06:56 UTC
Our project is presenting a dbus service exposing some objects which have a property of type "v" (variant). On the Python side, those contain a tuple of a string and two integers. So the "container" has dbus_signature="v" and the content is put together like this:

dbus.Struct([
                filename,
                line_start,
                line_end
            ], signature=dbus.Signature("(suu)"))

When I attempt to look at this property in d-feet, I get the following exception:

Traceback (most recent call last):
  • File "/usr/lib/python2.7/dist-packages/dfeet/introspection.py", line 104 in __treeview_row_activated_cb
    model[iter_][0] = obj.markup_str
  • File "/usr/lib/python2.7/dist-packages/dfeet/introspection_helper.py", line 87 in markup_str
    s += " = %s" % (self.value)
TypeError: not all arguments converted during string formatting

One of my colleagues figured out that the string formatting in line 87 is missing a comma (single-element tuple syntax is botched). If I change line 87 to read:

    s += " = %s" % (self.value, )

then things work as expected and d-feet is able to properly show the variant data in the UI.

This was observed on d-feet 0.3.3 on an Ubuntu 13.04 system, I also checked and the code is still like this in git://git.gnome.org/d-feet, so I assume the problem is still present. On the git repository, however, the troublesome tuple has moved to line 90.
Comment 1 Daniel Manrique 2013-06-18 21:30:19 UTC
The matching bug report on Ubuntu's bug tracking system has a reproduction case:

https://bugs.launchpad.net/d-feet/+bug/1192296

This can be reproduced on Ubuntu 13.04, or potentially on any system that has org.gnome.zeitgeist.engine available through session dbus. The bug seems to affect any property using a struct, not only variants.
Comment 2 Thomas Bechtold 2013-06-19 06:16:39 UTC
Hi Daniel,

thanks for the bugreport. I fixed the problem in git master and added a simple unittest.