[Telepathy] Type Conversion Error in PyGI tp-glib

Tomeu Vizoso tomeu at tomeuvizoso.net
Mon Jun 13 23:52:33 PDT 2011


On Mon, Jun 13, 2011 at 16:04, Danielle Madeley
<danielle.madeley at collabora.co.uk> wrote:
> On Mon, 2011-06-13 at 15:23 +0200, Tomeu Vizoso wrote:
>
>> > I'm I doing something wrong? Or is this a bug?
>>
>> PyGObject is auto-converting your Python int into a GValue, but isn't
>> choosing the type that the C side expects. What i think should be done
>> in this case (other than moving tp-glib from dbus-glib to gdbus) is to
>> give PyGObject a hint of what type should the GValue map to, something
>> like:
>>
>>         "keepalive-interval": GValue(60, GValue.UInt32),
>>
>> Unfortunately, I don't think that exists, but would be worth asking to
>> the PyGObject community and checking if a ticket already exists in
>> bugzilla.gnome.org.
>
> Tomeu is right, this is actually the bug. I was mistakenly confused with
> dbus-python.
>
> Tomeu, out of interest would PyGObject handle this better if it was a
> GVariant. Now that gjs has gained GVariant support, I think we should
> start exposing GVariant-based APIs for gobject-introspection instead of
> TpAsv-based ones.

Yup, with variants, PyGObject doesn't try any more to guess the type
that the C side wants, so the user needs to do:

GLib.Variant('i', 42)
GLib.Variant('u', 42)

Regards,

Tomeu

> --
> Danielle Madeley
> Software Developer, Collabora Ltd.                  Melbourne, Australia
>
> www.collabora.co.uk
>
>


More information about the telepathy mailing list