Serhiy Storchaka added the comment:
>>> print(json.dumps(a))
{"a": "//a[@asdf=\"asdf\"]"}
You seen the repr or the resulting string, not the resulting string itself.
--
nosy: +serhiy.storchaka
resolution: -> not a bug
stage: -> resolved
status: open -> closed
New submission from Juozas Masiulis :
currently python behaves like this:
>>> import json
>>> a={'a': '//a[@asdf="asdf"]'}
>>> json.dumps(a)
'{"a": "//a[@asdf=\\"asdf\\"]"}'
this behaviour is incorrect.
the resulting string should be '{"a": "//a[@asdf=\"asdf\"]"}'
The difference is that