GNOME Bugzilla – Bug 669847
GSimpleAsyncResult introspection annotates methods as functions; unusable for creating results for errors
Last modified: 2018-05-24 13:46:19 UTC
Several methods on GSimpleAsyncResult are annotated as functions. This breaks, at least, many attempts to use it from Python. For instance: >>> from gi.repository import GLib, Gio >>> error = GLib.Error() >>> result = Gio.SimpleAsyncResult.new(None, None, None, "") >>> result.set_from_error(error) Traceback (most recent call last):
+ Trace 229642
return info.invoke(*args, **kwargs) TypeError: set_from_error() takes exactly 1 argument (2 given) >>> result.set_from_error() # this is surely wrong anyway
return info.invoke(cls, *args, **kwargs) TypeError: new_from_error() takes exactly 3 arguments (4 given)
I can't see any way to construct a GSimpleAsyncResult from Python for a GError without running into one of these bugs.
This is with glib 2.31.16, by the way. And sorry for what Bugzilla seems to have done to the formatting of my example ...
Hmm...here I have it as a method: <method name="set_from_error" c:identifier="g_simple_async_result_set_from_error"> What version of gobject-introspection are you using? BTW hi Colin!
Hi :-) gobject-introspection 1.31.10. And it looks right in the typelib, even: $ g-ir-generate /usr/lib/girepository-1.0/Gio-2.0.typelib | grep set_from_error <method name="set_from_error" c:identifier="g_simple_async_result_set_from_error"> I'm still seeing the same results, though.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME'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.gnome.org/GNOME/glib/issues/510.