Closed runeh closed 14 years ago
Did another quick test. Seems that there is some state maintained between the calls, as trying to dump the same value twice gives different results:
>>> yajl.dumps(1233333333333) '-1' >>> yajl.dumps(1233333333333) Traceback (most recent call last): File "", line 1, in OverflowError: long int too large to convert to int >>> yajl.dumps(1233333333333) '-1'
Are you running this with the latest HEAD? I've added a test to try this and it's working properly for me:
>>> yajl.dumps([11889582081])
'[11889582081]'
>>> yajl.dumps([11889582082])
'[11889582082]'
Also, are you on a 32-bit architecture per-chance? I'm on Linux/amd64 so I'm wondering if that could be related
Aha! This is very much a 32-bit machine problem, see Hudson build 73, which was run against only 32-bit machines.
I'll see what I can do :)
Corrected with SHA: 1c276f4366746c973b0e92061e528dda87403f13
Verified fixed in master. Thanks!
Dealing with large numbers either throw OverflowError or returns -1. Twitter's tweet IDs are currently large enough to trigger this, so there are some real world use cases.