zserio
zserio copied to clipboard
Python runtime tests fail for new Python 3.12.3
Zserio version and language Zserio: 2.13 Language: Python 3.12.3
Describe the bug If new Python version 3.12.3 is used, the Python runtime tests fail with the following error:
ERROR: test_enum_array (test_array.ArrayTest.test_enum_array)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/tests/test_array.py", line 186, in test_enum_array
self._test_array(array_traits, array1_values, array1_bitsizeof, array1_aligned_bitsizeof, array2_values)
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/tests/test_array.py", line 352, in _test_array
self._test_array_normal(array_traits, array1_values, array1_bitsizeof)
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/tests/test_array.py", line 435, in _test_array_normal
read_array_from_reader = Array.from_reader(array_traits, from_reader, len(array_values))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/src/zserio/array.py", line 77, in from_reader
instance.read(reader, size)
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/src/zserio/array.py", line 320, in read
append(array_traits_read(reader, index))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/src/zserio/array.py", line 1994, in read
return self._element_factory.create(reader, index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/tests/test_array.py", line 170, in create
return ArrayEnum.from_reader(reader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/tests/test_object/array_enum.py", line 29, in from_reader
return cls(reader.read_signed_bits(8))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zserio/zserio/compiler/extensions/python/runtime/src/zserio/enum.py", line 27, in __call__
obj = super().__call__(value, names, module=module, qualname=qualname, type=type_, start=start)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/enum.py", line 757, in __call__
return cls.__new__(cls, value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/enum.py", line 1171, in __new__
raise ve_exc
ValueError: (0, None) is not a valid ArrayEnum
How to reproduce Steps to reproduce the behavior:
- Install Python 3.12.3.
- If necessary, set envinroment variable
PYTHON
topython3.12
- Run scripts/build.sh python_rt
Expected behavior No failure, everything should work as usually.
Additional context Python version 3.12.2 works smoothly and without any problem. Please, don't forget to update GitHub actions as well, currently we use fixed Python version 3.12.2.