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 666852 - test_bytearray_gvariant fails under python3
test_bytearray_gvariant fails under python3
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-26 06:15 UTC by Alexandre Rostovtsev
Modified: 2012-01-24 15:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (953 bytes, patch)
2011-12-26 06:20 UTC, Alexandre Rostovtsev
committed Details | Review

Description Alexandre Rostovtsev 2011-12-26 06:15:53 UTC
Attempting to run test_bytearray_gvariant under python3 results in a failure:

======================================================================
ERROR: test_bytearray_gvariant (test_gi.TestArray)
----------------------------------------------------------------------
Traceback (most recent call last):
  • File "/var/tmp/portage/dev-python/pygobject-3.0.3/work/pygobject-3.0.3-3.2/tests/test_gi.py", line 774 in test_bytearray_gvariant
    v = GLib.Variant.new_bytestring("foo")
  • File "../gi/types.py", line 72 in constructor
    return info.invoke(cls, *args, **kwargs)
TypeError: Item 0: Must be number or single byte string, not str

This is because python3 does not allow mixing strings with byte arrays; under python3, GLib.Variant.new_bytestring() expects bytes, not a string.
Comment 1 Alexandre Rostovtsev 2011-12-26 06:20:46 UTC
Created attachment 204217 [details] [review]
proposed patch
Comment 2 Tomeu Vizoso 2012-01-24 15:25:12 UTC
Comment on attachment 204217 [details] [review]
proposed patch

Pushed, thanks!