Bug 69967

Summary: does not use dbus.Struct.signature to guess signature of a Struct
Product: dbus Reporter: Simon McVittie <smcv>
Component: pythonAssignee: Simon McVittie <smcv>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Simon McVittie 2013-09-30 14:32:50 UTC
>>> import dbus
>>> dbus.lowlevel.Message.guess_signature((42,))
dbus.Signature('(i)')
>>> dbus.lowlevel.Message.guess_signature(dbus.Struct((42,), signature='u'))
dbus.Signature('(i)')

The second one should clearly be dbus.Signature('(u)').

Workaround: use a tuple containing fully-qualified dbus types:

>>> dbus.lowlevel.Message.guess_signature((dbus.UInt32(42),))
dbus.Signature('(u)')

Arrays work fine either way:

>>> dbus.lowlevel.Message.guess_signature([42])
dbus.Signature('ai')
>>> dbus.lowlevel.Message.guess_signature(dbus.Array([42], signature='u'))
dbus.Signature('au')
>>> dbus.lowlevel.Message.guess_signature([dbus.UInt32(42)])
dbus.Signature('au')
Comment 1 GitLab Migration User 2018-08-22 22:03:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus-python/issues/3.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.