Message188374
I wonder if json should simply be less strict by default. If you pass the raw unescaped character, the json module accepts it:
>>> json.loads('{"a": "\ud8e9"}')
{'a': '\ud8e9'}
It's only if you pass the escaped representation that json rejects it:
>>> json.loads('{"a": "\\ud8e9"}')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/antoine/cpython/default/Lib/json/__init__.py", line 316, in loads
return _default_decoder.decode(s)
File "/home/antoine/cpython/default/Lib/json/decoder.py", line 344, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/antoine/cpython/default/Lib/json/decoder.py", line 360, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Unpaired high surrogate: line 1 column 9 (char 8) |
|
Date |
User |
Action |
Args |
2013-05-04 15:59:32 | pitrou | set | recipients:
+ pitrou, rhettinger, bob.ippolito, ezio.melotti, serhiy.storchaka |
2013-05-04 15:59:32 | pitrou | set | messageid: <1367683172.02.0.258713299528.issue17906@psf.upfronthosting.co.za> |
2013-05-04 15:59:32 | pitrou | link | issue17906 messages |
2013-05-04 15:59:31 | pitrou | create | |
|