python - pythoin and json - ValueError: Expecting property name: line 1 column 1 (char 1) -
wowee...and python json what? below string poping redis queue generated dumping dictionary json string , placing in list. when pop..wow..i below
args = {'series': 'exr|usd|gbp', 'k': 2, 'm': 2, 'tau': 1} args = json.loads(args) traceback (most recent call last): file "/home/ubuntu/workspace/chaos/chaos_worker.py", line 12, in <module> args = json.loads(args) file "/usr/lib/python2.7/json/__init__.py", line 326, in loads return _default_decoder.decode(s) file "/usr/lib/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) file "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode obj, end = self.scan_once(s, idx) valueerror: expecting property name: line 1 column 1 (char 1)
wait, converting python dict json? in case use json.dumps
. args
have defined on first line in fact dict
.
args = {'series': 'exr|usd|gbp', 'k': 2, 'm': 2, 'tau': 1} print args.__class__ out: dict args = json.dumps(args) print args out: '{"series": "exr|usd|gbp", "k": 2, "m": 2, "tau": 1}'
in json parsable string expected.
Comments
Post a Comment