After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669847 - GSimpleAsyncResult introspection annotates methods as functions; unusable for creating results for errors
GSimpleAsyncResult introspection annotates methods as functions; unusable for...
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
2.31.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-02-10 23:56 UTC by Colin Watson
Modified: 2018-05-24 13:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Colin Watson 2012-02-10 23:56:23 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):
  • File "<stdin>", line 1 in <module>
  • File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43 in function
    return info.invoke(*args, **kwargs)   TypeError: set_from_error() takes exactly 1 argument (2 given)   >>> result.set_from_error()  # this is surely wrong anyway
  • File "<stdin>", line 1 in <module>
  • File "/usr/lib/python2.7/dist-packages/gi/types.py", line 72 in constructor
    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.
Comment 1 Colin Watson 2012-02-10 23:57:18 UTC
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 ...
Comment 2 Colin Walters 2012-02-13 17:58:58 UTC
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!
Comment 3 Colin Watson 2012-02-14 13:39:30 UTC
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.
Comment 4 GNOME Infrastructure Team 2018-05-24 13:46:19 UTC
-- 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.