Closed indigoviolet closed 14 years ago
Another good catch, json.dumps
throws a TypeError
, so we should probably not be throwing the ValueError
there
This also highlights a bug that already existed, if a list contains an unserializable object yajl.dumps
would simply return a '[]'
instead of raising the TypeError
Resolved with SHA: 9d8d1a4dc46df1f9161bcaba9d3da163d9811271
And thanks again!
Oh, sorry to report this separately, but sets have the same issue as #8. In general, it seems like it would be nice to raise an exception when an object inside a list (for example) cannot be processed.
In [2]: yajl.dumps(set([3,4]))
ValueError Traceback (most recent call last) in ()
ValueError: Failed to process
In [3]: yajl.dumps([set([3,4])]) Out[3]: '[]'
(json cannot do this earlier, but raises an exception).