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 755916 - Gio.Task is unable to return GLib.Error / task.return_error(e) with ASSERT !=NULL
Gio.Task is unable to return GLib.Error / task.return_error(e) with ASSERT !=...
Status: RESOLVED DUPLICATE of bug 685197
Product: pygobject
Classification: Bindings
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-01 02:36 UTC by Evgeny Kolesnikov
Modified: 2016-01-23 04:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Evgeny Kolesnikov 2015-10-01 02:36:10 UTC
sample.py 
---
from gi.repository import GLib, Gio

def cb(*args, **kwargs):
   pass

t = Gio.Task.new(None, None, cb, None, 0)
t.return_error(GLib.Error())
---

Given the sample code sample.py, "python sample.py" will bail out with:

TypeError: Gio.Task.return_error() takes exactly 1 argument (2 given)

And "python3 sample.py" will show:

(process:12319): GLib-GIO-CRITICAL **: g_task_return_error: assertion 'error != NULL' failed

Fedora 22, pygobject-3.19.1-py3.4-linux-x86_64 via jhbuild
Comment 1 Evgeny Kolesnikov 2015-10-04 14:29:10 UTC
Also

Gio.SimpleAsyncResult.new_from_error(None, None, None, GLib.Error())

would give you

(process:7444): GLib-GIO-CRITICAL **: g_simple_async_result_set_from_error: assertion 'error != NULL' failed
Comment 2 Christian Hergert 2016-01-22 07:37:44 UTC
We want to be able to use this in Builder, too. I suspect something handling a TAG_ERROR is not checking the the argument direction.
Comment 3 Evgeny Kolesnikov 2016-01-22 08:07:49 UTC
Yeah, that is the problem that holds me on Meson build plugin for Builder.
Comment 4 Simon Feltman 2016-01-23 04:06:14 UTC

*** This bug has been marked as a duplicate of bug 685197 ***