v = json.loads("{'test':'test'}")

J. Clifford Dyer jcd at sdf.lonestar.org
Sun Jan 25 16:47:20 EST 2009


Please include all relevant information in the *body* of your message,
not just in the subject.  It's a pain having to piece a question back
together between the subject.

On Sun, 2009-01-25 at 13:12 -0800, gert wrote:
> raise ValueError(errmsg("Expecting property name", s, end))
> http://docs.python.org/library/json.html
> What am I doing wrong ?

JSON requires strings to be enclosed in double quotes.  It is not as
flexible as python when it comes to quotation.  If you change your
example to

v = json.loads('{"test":"test"}')

it will work.  (Note JSON also doesn't allow trailing commas, so
'{"test":"test",}' will also fail)

Cheers,
Cliff


> --
> http://mail.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list