Message200361
Here is a proof of concept that raises this error:
>>> import json; json.load(open('input.json'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wolf/dev/py/2.7/Lib/json/__init__.py", line 290, in load
**kw)
File "/home/wolf/dev/py/2.7/Lib/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/home/wolf/dev/py/2.7/Lib/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/wolf/dev/py/2.7/Lib/json/decoder.py", line 381, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
If the idea is OK I will add tests and implement it for the Python scanner too (and possibly tweak the error message if you have better suggestions). |
|
Date |
User |
Action |
Args |
2013-10-19 04:08:24 | ezio.melotti | set | recipients:
+ ezio.melotti, ncoghlan, docs@python, serhiy.storchaka, Anoop.Thomas.Mathew, vajrasky, Gallaecio |
2013-10-19 04:08:24 | ezio.melotti | set | messageid: <1382155704.03.0.419375939602.issue18958@psf.upfronthosting.co.za> |
2013-10-19 04:08:24 | ezio.melotti | link | issue18958 messages |
2013-10-19 04:08:23 | ezio.melotti | create | |
|