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 692381 - ValueError on passing inf float argument
ValueError on passing inf float argument
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-01-23 13:20 UTC by Christoph Reiter (lazka)
Modified: 2013-01-23 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christoph Reiter (lazka) 2013-01-23 13:20:40 UTC
>>> import gi
>>> gi.version_info
(3, 4, 2)
>>> from gi.repository import GObject
>>> v = GObject.Value()
>>> v.init(GObject.TYPE_FLOAT)
0.0
>>> v.set_float(float('inf'))
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
  • File "/usr/lib/python2.7/dist-packages/gi/types.py", line 47 in function
    return info.invoke(*args, **kwargs)
ValueError: %f not in range %f to %f


same for double and float('-inf'), float('nan') works
Comment 1 Martin Pitt 2013-01-23 13:58:23 UTC
Fixed that and the broken error message, including tests:

http://git.gnome.org/browse/pygobject/commit/?id=e65c124893ceaa9c97eb4c8c743fbeb756b9a6e6

Thank you for the report!