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 683775 - signal GValue arguments do not accept 64 bit ints
signal GValue arguments do not accept 64 bit ints
Status: RESOLVED DUPLICATE of bug 705291
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-09-11 07:42 UTC by Martin Pitt
Modified: 2013-08-14 20:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Martin Pitt 2012-09-11 07:42:01 UTC
When trying to call a signal which expects a GValue argument, merely passing an integer constant is always going to create a TYPE_INT variant, which overflows when the constant is bigger than MAXINT. Depending on the API it might be better to automatically create a TYPE_INT64 variant?

The workaround is to create an explicit int64 value:

        v = GObject.Value()
        v.init(GObject.TYPE_INT64)
        v.set_int64(GObject.G_MAXINT64)

then you can pass v to a signal just fine (that's covered in a test case, see bug 683596).

In this case, the code path is the G_TYPE_BOXED case in pyg_value_from_pyobject() in gi/_gobject/pygtype.c, which calls pyg_type_from_object(), which does

       if (tp == &PYGLIB_PyLong_Type)
            return G_TYPE_INT;

i. e. does not do any range check.
Comment 1 Simon Feltman 2013-08-14 20:16:44 UTC
This is actually a dup of bug #705291. Marking this one as the dup because more information has been added to the other ticket.

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