Hi Michael,

From: Michael DeHaan
Date: Mon, 15. Dec 2014 14:29

> Things like jsonlint pass, but it seems the Python JSON formatter does not 
> like what you have.

> I'm wondering if this might actually not be valid JSON, or just that there is 
> a bug in the python json library.

Thanks a lot. According to http://json.org/ in the picture "string" double 
quotes (quotation mark) must be escaped. So I assume it is valid JSON. If so, 
there must be something wrong with the python parser?

My temporary fix on the URI module is to remove the double occurrence of 
quotation marks to not confuse the parser. However, this only works because my 
quotation marks are at the beginning/end of the string (not in between):

-js = json.loads(content)
+js = json.loads(content.replace('""','"'))

Or in your example:

STRING = """
{ "names": [
  "nameA",
  "\"double quoted name\"",
  "nameB"
] }
"""

import json
print json.loads(STRING.replace('""','"'))

Thanks, Sascha.

Aufsichtsratsvorsitzender: Herbert Vogel
Geschäftsführung: Michael Krüger
Sitz der Gesellschaft: Halle/Saale
Registergericht: Amtsgericht Stendal | Handelsregister-Nr. HRB 208414
UST-ID-Nr. DE 158253683

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Empfänger sind oder diese E-Mail irrtümlich 
erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie 
diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail 
oder des Inhalts dieser Mail sind nicht gestattet. Diese Kommunikation per 
E-Mail ist nicht gegen den Zugriff durch Dritte geschützt. Die GISA GmbH haftet 
ausdrücklich nicht für den Inhalt und die Vollständigkeit von E-Mails und den 
gegebenenfalls daraus entstehenden Schaden. Sollte trotz der bestehenden 
Viren-Schutzprogramme durch diese E-Mail ein Virus in Ihr System gelangen, so 
haftet die GISA GmbH - soweit gesetzlich zulässig - nicht für die hieraus 
entstehenden Schäden.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/383FAD2C9609F74D8F075EFF2B86B57998F2DEF7%40SGIS111.gisa-halle.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to