Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8495125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:29:03+00:00 2026-06-10T23:29:03+00:00

I have a (probably malformed) string I need to convert to the json format.

  • 0

I have a (probably malformed) string I need to convert to the json format. Printing out the string I get

{"composemsg":{"return":null,"report":"<p class=\"error j-table-ui-report-entry\">07:39:28 - Action failed<br\/>Error adding row 0<br\/> Message <span class=\"label\">\"Test Message\"<\/span>,  Receivers 'Array\n(\n    [0] => gaga7\n)\n'<br\/><\/p>",0:""}}

ADDED: I have no way to modify this string in the first place or to change the code that produces this string. All I have is the string as quoted above!

When trying to convert the string (contained in the variable ‘j’) using

json.loads(j)

I get an error:

ValueError: Expecting property name: line 1 column 250 (char 250)

However, when starting python on the command line and asserting a variable to the printed-out string (replacing ‘null’ by ‘None’), it works fine:

In [40]: x = {"composemsg":{"return":None,"report":"<p class=\"error j-table-ui-report-entry\">07:39:28 - Action failed<br\/>Error adding row 0<br\/> Message <span class=\"label\">\"Test Message\"<\/span>,  Receivers 'Array\n(\n    [0] => gaga7\n)\n'<br\/><\/p>",0:""}}
In [41]: x
Out[41]: 
{'composemsg': {0: '','report': '<p class="error j-table-ui-report-entry">07:39:28 - Action failed<br\\/>Error adding row 0<br\\/> Message <span class="label">"Test Message<\\/span>,  Receivers \'Array\n(\n    [0] => gaga7\n)\n\'<br\\/><\\/p>', 'return': None}}

Any ideas of this behavior? Is there a malformed place in the original string? I do not see any issues.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:29:04+00:00Added an answer on June 10, 2026 at 11:29 pm

    JSON object property names should be strings. From http://www.json.org/:

    enter image description here

    The error message is pointing that you have an unquoted property name at the position 250 (the 0 key).

    It may be hard to figure out because {0:""} is valid both in Javascript and Python (but isn’t legal JSON).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following string which will probably contain ~100 entries: String foo =
I have a method that (sometimes) takes in a string in the format dddd
I have probably worded the question badly, but couldn't figure out how to phrase
I will probably have done it manually by the time I get an answer
Highcharts doesn't really do error reporting, as some of you have probably found out.
Similar questions have probably been asked before, and sry for that. Need to be
If you've used Google Wave or iGoogle you have probably seen that you can
Error: End tag for 'optgroup' which is not finished. You have probably failed to
i have another (probably unanswered) question about map views. I have a map view
well i have most probably an extremly stupid problem but could not figure it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.