Union type not working correctly with python 3 and GObject introspection
Submitted by Vratislav Podzimek
Link to original bug (#761101)
Description
Created attachment 319698 the reproducer sources
Description of problem: If I have a union type in my GObject-based code and try to use it from python 3, the right value doesn't get to the "C side". However, this works just fine with python 2. Running the attached reproducer I get this:
$ GI_TYPELIB_PATH=. LD_LIBRARY_PATH=. python reproducer.py got unit with int value: 1 got unit with int value: 2 got unit with int value: 3
$ GI_TYPELIB_PATH=. LD_LIBRARY_PATH=. python3 reproducer.py got unit with int value: 1 got unit with int value: 1 got unit with int value: 1
How reproducible: 100%
Steps to Reproduce:
- unpack the attached reproducer
- run rebuild_test_data.sh
- run $ GI_TYPELIB_PATH=. LD_LIBRARY_PATH=. python reproducer.py
- run $ GI_TYPELIB_PATH=. LD_LIBRARY_PATH=. python3 reproducer.py
Actual results: different behaviour for python 2 (correct) and python 3 (wrong)
Expected results: the same (correct) behaviour in python 3 as in python 2
Additional info: this blocks python-blivet [1] from starting to use the new libbytesize library [2]
[1] https://github.com/rhinstaller/blivet [2] https://github.com/rhinstaller/libbytesize
Attachment 319698, "the reproducer sources":
reproducer.tar.gz