This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients Anoop.Thomas.Mathew, Gallaecio, docs@python, ezio.melotti, ncoghlan, serhiy.storchaka, vajrasky
Date 2013-10-19.04:08:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382155704.03.0.419375939602.issue18958@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2013-10-19 04:08:24ezio.melottisetrecipients: + ezio.melotti, ncoghlan, docs@python, serhiy.storchaka, Anoop.Thomas.Mathew, vajrasky, Gallaecio
2013-10-19 04:08:24ezio.melottisetmessageid: <1382155704.03.0.419375939602.issue18958@psf.upfronthosting.co.za>
2013-10-19 04:08:24ezio.melottilinkissue18958 messages
2013-10-19 04:08:23ezio.melotticreate