close

[Solved] Valid JSON giving JSONDecodeError: Expecting , delimiter

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Valid JSON giving JSONDecodeError: Expecting , delimiter in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Valid JSON giving JSONDecodeError: Expecting , delimiter Error Occurs?

Today I get the following error Valid JSON giving JSONDecodeError: Expecting , delimiter in python.

How To Solve Valid JSON giving JSONDecodeError: Expecting , delimiter Error ?

  1. How To Solve Valid JSON giving JSONDecodeError: Expecting , delimiter Error ?

    To Solve Valid JSON giving JSONDecodeError: Expecting , delimiter Error 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.

  2. Valid JSON giving JSONDecodeError: Expecting , delimiter

    To Solve Valid JSON giving JSONDecodeError: Expecting , delimiter Error 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.

Solution 1

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.\"" } }""")

Solution 2

You need to add r before your json string.

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

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read