Properties of type "v" and structs cause a traceback and aren't shown in the UI

Bug #1192296 reported by Daniel Manrique
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
D-Feet
Fix Released
Medium
d-feet (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

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.

While looking at this in more detail, I noticed that basically anything that uses a struct will be affected, see the reproduction case below.

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 the upstream repository 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.

The bug is reported upstream here:

https://bugzilla.gnome.org/show_bug.cgi?id=702593

Steps to reproduce:
- Install and launch d-feet on an Ubuntu 13.04 system, on a terminal so console output can be seen.
- Select the "session bus" tab (top right).
- On the search field, type "org.gnome.zeitgeist.engine".
- On the list of objects (right pane), expand /org/gnome/zeitgeist/log/activity (last one)
- Under this, expand org.gnome.zeitgeist.Log
- At the very end of the list of exposed properties/methods, double-click on "Array of [String] extensions (read)". The list of extensions will be loaded and shown immediately to the right of the field description and type. This is expected behavior.
- Double-click on "Struct of (Int32, Int32, Int32) version (read)".

Expected behavior:
- The version should be shown next to the field type/description, as with the "extensions" field above.

Actual behavior:
- Nothing is shown.
- Trace visible in the console:

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

======
ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: d-feet 0.3.3-1
ProcVersionSignature: Ubuntu 3.8.0-23.34-generic 3.8.11
Uname: Linux 3.8.0-23-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.9.2-0ubuntu8.1
Architecture: amd64
Date: Tue Jun 18 15:07:05 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-04-25 (53 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: d-feet
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Daniel Manrique (roadmr) wrote :
Daniel Manrique (roadmr)
description: updated
summary: - Properties of type "v" cause a traceback and aren't shown
+ Properties of type "v" and structs cause a traceback and aren't shown in
+ the UI
Changed in d-feet:
importance: Unknown → Medium
status: Unknown → New
Changed in d-feet:
status: New → Fix Released
Changed in d-feet (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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