[issue20453] json.load() error message changed in 3.4

Barry A. Warsaw report at bugs.python.org
Fri Jan 31 11:08:52 CET 2014


New submission from Barry A. Warsaw:

Run the attached file under Python 3.3 and you get:

No JSON object could be decoded

Run the same file under Python 3.4 and you get:

Expecting value: line 1 column 1 (char 0)

So a couple of things:

Since the error message changed, it makes it difficult to test in doctest and other text-based matches.  I'm also not sure the new message is "better".  Objectively speaking, probably both error messages are useful (i.e. that no json object was found, and where the problem was found).  I think the second message by itself is pretty mysterious.

I want to make sure the change was deliberate.  I couldn't find anything in Misc/NEWS which might not be entirely unexpected since specific error messages aren't generally a part of the guaranteed API.  Perhaps at the least, if the change was deliberate, let's document it in Misc/NEWS.

----------
files: foo.py
messages: 209755
nosy: barry
priority: normal
severity: normal
status: open
title: json.load() error message changed in 3.4
versions: Python 3.4
Added file: http://bugs.python.org/file33824/foo.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20453>
_______________________________________


More information about the Python-bugs-list mailing list