www.lsauer.com; 2013 lo sauer ###JSONDecodeError: Expecting value: line 1 column 1 (char 0) ###ValueError: Expecting property name ######Related to: http://stackoverflow.com/questions/16573332/jsondecodeerror-expecting-value-line-1-column-1-char-0 Trying to parse json in python. ValueError: Expecting property name http://stackoverflow.com/questions/9187885/trying-to-parse-json-in-python-valueerror-expecting-property-name
###Troubleshoot
Check the response data-body, whether actual data is present and a data-dump appears to be well-formatted.
In most cases your json.loads- JSONDecodeError: Expecting value: line 1 column 1 (char 0) error is due to :
non-JSON conforming quoting
XML/HTML output (that is, a string starting with <), or
incompatible character encoding
Ultimately the error tells you that at the very first position the string already doesn't conform to JSON.
As such, if parsing fails, despite having a data-body that looks at first glance JSON-like, try replacing the quotes of the data-body, as follows.
I have just spent more than one hour to find out why my call of json.loads cause exception: "<type 'exceptions.ValueError'> Expecting property name", finally I found out that the error in my json string is the trailing comma, for example, if my string is: s = '{"a": 1, "b": 2,}', then because of the trailing comma(after b), the call of json.loads(s) will raise the "Expecting property name" exception. Note the trailing comma is widely used by C programmers, so I propose to add this kind of error to your common error list above.^_^