On 14.06.2013 03:00, Yves S. Garret wrote:
Thanks again Kevin. I'm deviating from the original thread,
but I've got another issue. When I try to load the json file
and then parse it, this is the error that I get:
http://bin.cakephp.org/view/1329549559
1) Please don't top post. Put your answer after the parts you are
replying to.
2) Is Kevin sending his e-mails only to you? I don't get them and they
aren't in the mailing list archive either.
3) Please copy the traceback you get into your message. Otherwise you
will reduce the amount of people who are willing to help you because not
everyone likes to go to an external website just to read them.
So here's it:
>>> import json
>>> import pprint
>>> json_data = open('temp.json')
>>> data = json.load(json_data)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/json/__init__.py", line 290, in load
**kw)
File "/usr/local/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python2.7/json/decoder.py", line 381, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 2 column 1 (char 2)
4) The error message tells you that json.load() can't parse your file
due to an error at the beginning of line 2. So can you please post the
first lines of your file?
Bye, Andreas
--
http://mail.python.org/mailman/listinfo/python-list