Valid JSON giving JSONDecodeError: Expecting , delimiter Valid JSON giving JSONDecodeError: Expecting , delimiter python python

Valid JSON giving JSONDecodeError: Expecting , delimiter


You'll need a r before """, or replace all \ with \\. This is not something you should care about when read the json from somewhere else, but something in the string itself.

data = json.loads(r"""{ "entry":{ "etag":"W/\"A0UGRK47eCp7I9B9WiRrYU0.\"" } }""")

see here for more information


You need to add r before your json string.

>>> st = r'{ "entry":{ "etag":"W/\"A0UGRK47eCp7I9B9WiRrYU0.\"" } }'>>> data = json.loads(st)>>>