Fri 9 8:44PM> python
Python 2.6 (r26:66714, Apr 2 2009, 13:18:58)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yajl
>>> import json
>>> yajl.dumps(1)
'1'
>>> yajl.loads('1')
Traceback (most recent call last):
File "", line 1, in
ValueError: eof was met before the parse could complete
>>> json.dumps(1)
'1'
>>> json.loads('1')
1
>>> yajl.dumps(1.05)
'1.05'
>>> yajl.loads('1.05')
Traceback (most recent call last):
File "", line 1, in
ValueError: eof was met before the parse could complete
>>> json.dumps(1.05)
'1.05'
>>> json.loads('1.05')
1.05
>>>
This is actually correct behavior, the json module is incorrect here. Objects being passed in as JSON should be either objects (dicts) or arrays (lists).