1

I declared a variable which stores JSON file (output returned from subprocess).

app_data = self.run_subprocess(create_app)

Printed app_data looks like that: (check comments for printed data) I want to grab particular value from this str "appId", so I try to load app_data to json string and grab that value..

json_str = json.loads(app_data)
print(json_str["appId"])

Error

json.decoder.JSONDecodeError: Extra data: line 190 column 1 (char 5767)
martineau
124k29 gold badges181 silver badges319 bronze badges
asked Apr 27, 2020 at 16:37
5
  • newtextdocument.com/776fb7d21b output was too big to post it so check it here Commented Apr 27, 2020 at 16:40
  • Cannot reproduce with the newtextdocument.com file: it loads without error. Commented Apr 27, 2020 at 16:43
  • 2
    I did json.loads on your post and it worked for me. json_str['appId'] returned '7f1f91c2-3b28-48ee-96ed-89080980'. Commented Apr 27, 2020 at 16:43
  • @BobbyOcean so strange.. can you share you code? Commented Apr 27, 2020 at 16:46
  • I simply copied your text in triple quotes x = """ """ and then ran import json, y = json.loads(x), and then y['appId']. Commented Apr 27, 2020 at 16:49

1 Answer 1

1

It works fine upon running it and return the value 7f1f91c2-3b28-48ee-96ed-89080980. You can also confirm that it's a valid Json String by checking with a validator here.

The error

json.decoder.JSONDecodeError: Extra data: line 190 column 1 (char 5767)

I believe the error is to do with some malformed character on line 190, right after the line of the closing }. Find that and delete it and it should work fine

answered Apr 27, 2020 at 16:47
Sign up to request clarification or add additional context in comments.

1 Comment

I guess you were right guyz.. wrote json to a file and saw this peace of garbage ``` [0m ``` :D

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.