Ezio Melotti added the comment:
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).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue18958>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com