New submission from Juozas Masiulis <composi...@gmail.com>:
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 double quotes inside double quotes are escaped twice instead of once. compare it to behaviour in javascript: > var a = {'a': '//a[@asdf="asdf"]'} undefined JSON.stringify(a) "{"a":"//a[@asdf=\"asdf\"]"}" ---------- messages: 327352 nosy: Juozas.Masiulis priority: normal severity: normal status: open title: json.dumps serializes double quotes incorrectly type: behavior versions: Python 2.7, Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34933> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com