ijl / orjson

Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy
Apache License 2.0
6.3k stars 218 forks source link

3.10.9 tests fail on s390x #526

Closed ptrcnull closed 1 month ago

ptrcnull commented 1 month ago

as in the title, running on Alpine Linux edge; excerpt from the logs:

____________________________ TestType.test_uint_64 _____________________________

self = <test.test_type.TestType object at 0x3ff473aed20>

    def test_uint_64(self):
        """
        uint 64-bit
        """
        for val in (0, 9223372036854775808, 18446744073709551615):
            assert orjson.loads(str(val)) == val
>           assert orjson.dumps(val) == str(val).encode("utf-8")
E           AssertionError: assert b'128' == b'9223372036854775808'
E             
E             At index 0 diff: b'1' != b'9'
E             Use -v to get more diff

test/test_type.py:445: AssertionError
______________________ TestUltraJSON.test_doubleLongIssue ______________________

self = <test.test_ujson.TestUltraJSON object at 0x3ff47b69b80>

    def test_doubleLongIssue(self):
        sut = {"a": -4342969734183514}
        encoded = orjson.dumps(sut)
        decoded = orjson.loads(encoded)
>       assert sut == decoded
E       AssertionError: assert {'a': -4342969734183514} == {'a': -6465557665793511169}
E         
E         Differing items:
E         {'a': -4342969734183514} != {'a': -6465557665793511169}
E         Use -v to get more diff

test/test_ujson.py:16: AssertionError
__________________ TestUltraJSON.test_encodeLongNegConversion __________________

self = <test.test_ujson.TestUltraJSON object at 0x3ff474175c0>

    def test_encodeLongNegConversion(self):
        val = -9223372036854775808
        output = orjson.dumps(val)

        orjson.loads(output)
        orjson.loads(output)

>       assert val == orjson.loads(output)
E       AssertionError: assert -9223372036854775808 == 128
E        +  where 128 = <built-in function loads>(b'128')
E        +    where <built-in function loads> = orjson.loads
ijl commented 1 month ago

Fixed in 3.10.10, thanks for the report.

ptrcnull commented 1 month ago

that was fast, thanks! ^^