Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unmarshaling tests on big endian systems.
Fix about eight unmarshaling error similar to: =============================================================================== [ERROR] Traceback (most recent call last): File "/usr/lib/python3.11/unittest/case.py", line 57, in testPartExecutor yield File "/usr/lib/python3.11/unittest/case.py", line 623, in run self._callTestMethod(testMethod) File "/usr/lib/python3.11/unittest/case.py", line 579, in _callTestMethod if method() is not None: File "/home/hugh/txdbus/tests/test_marshal.py", line 487, in test_bad_length self.assertRaises( File "/usr/lib/python3.11/unittest/case.py", line 766, in assertRaises return context.handle('assertRaises', args, kwargs) File "/usr/lib/python3.11/unittest/case.py", line 237, in handle callable_obj(*args, **kwargs) File "/home/hugh/txdbus/tests/test_marshal.py", line 352, in check nbytes, value = m.unmarshal(sig, encoding, 0) File "/home/hugh/txdbus/txdbus/marshal.py", line 887, in unmarshal nbytes, value = unmarshallers[tcode](ct, data, offset, lendian, oobFDs) File "/home/hugh/txdbus/txdbus/marshal.py", line 789, in unmarshal_array nbytes, value = unmarshallers[tcode]( File "/home/hugh/txdbus/txdbus/marshal.py", line 812, in unmarshal_struct return unmarshal(ct[1:-1], data, offset, lendian, oobFDs) File "/home/hugh/txdbus/txdbus/marshal.py", line 887, in unmarshal nbytes, value = unmarshallers[tcode](ct, data, offset, lendian, oobFDs) File "/home/hugh/txdbus/txdbus/marshal.py", line 706, in unmarshal_int32 return 4, struct.unpack_from(lendian and '<i' or '>i', data, offset)[0] struct.error: unpack_from requires a buffer of at least 28 bytes for unpacking 4 bytes at offset 24 (actual buffer size is 24) tests.test_marshal.TestArrayUnmarshal.test_bad_length ===============================================================================
- Loading branch information