[Telepathy] Type Conversion Error in PyGI tp-glib
Mystilleef
mystilleef at gmail.com
Mon Jun 13 22:35:16 PDT 2011
On Mon, Jun 13, 2011 at 9:23 AM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
> On Sun, Jun 12, 2011 at 09:12, Mystilleef <mystilleef at gmail.com> wrote:
>> I get the following error when I use an integer parameter
>> during account creation:
>>
>> Traceback (most recent call last):
>> File "/home/lateef/teletest/AccountCreator.py", line 75, in __create_async_cb
>> account = telepathy_account_manager.create_account_finish(result)
>> File "/usr/lib/python2.7/site-packages/gi/types.py", line 44, in function
>> return info.invoke(*args)
>> glib.GError: org.freedesktop.DBus.GLib.UnmappedError.McdAccountManagerError.Code0:
>> Failed to set parameter: parameter keepalive-interval must be of type
>> guint, not gint
>>
>> Python only uses ints, no uints. And I can't find a way to
>> convert from Python ints to Glib uints.
>>
>> 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.
>
I filed a bug report.
https://bugzilla.gnome.org/show_bug.cgi?id=652518
Is there anything tp-glib can do to help with the type conversion?
More information about the telepathy
mailing list