>>> json.loads('''{"a": "\\'"}''')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.7/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 1 column 8 (char 7)
So the library should translate {"a": "\\'"} to {"a": "'"}
json.loads
treats\\'
as an invalid escape:So the library should translate
{"a": "\\'"}
to{"a": "'"}