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

2016-04-27 Thread Berker Peksag

Berker Peksag added the comment:

3.4 is in security-fix-only mode and 3.5+ has better error messages thanks to 
JSONDecodeError (07af9847dbec). Closing this as 'out of date'.

--
nosy: +berker.peksag
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-12-02 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-12-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In issue19361 I suggest to change error messages even more and drop end 
position from "Extra data" error message.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-02-02 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> To me new error messages look more informative and more correct.

Yes, I agree with you.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-02-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

"No JSON object could be decoded, expecting value" is too expensive and second 
part of this message just repeat first part. The message can be shortened to 
"No JSON object could be decoded". But this is not fully correct. JSON term 
"object" corresponds to Python dict. But this error raised when arbitrary JSON 
value expected: "object", "array" (corresponded to Python list), string, number 
or boolean. That is why I had changed "object" to "value". So may be the "No 
JSON value could be decoded" is more correct.

Also note other differences between 3.3 and 3.4:

json.loads('[')
3.3: Expecting object: line 1 column 1 (char 0)
3.4: Expecting value: line 1 column 2 (char 1)

json.loads('[,')
3.3: No JSON object could be decoded
3.4: Expecting value: line 1 column 2 (char 1)

json.loads('[42')
3.3: Expecting object: line 1 column 3 (char 2)
3.4: Expecting ',' delimiter: line 1 column 4 (char 3)

json.loads('[42,')
3.3: Expecting object: line 1 column 4 (char 3)
3.4: Expecting value: line 1 column 5 (char 4)

json.loads('["')
3.3: end is out of bounds
3.4: Unterminated string starting at: line 1 column 2 (char 1)

json.loads('["foo')
3.3: Unterminated string starting at: line 1 column 2 (char 1)
3.4: Unterminated string starting at: line 1 column 2 (char 1)

To me new error messages look more informative and more correct.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-31 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-31 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jan 31, 2014, at 04:23 PM, R. David Murray wrote:

>If backward compatibility is the concern, I'd think you'd just want to
>restore that one message.

Yeah.  I think the tests are a little more difficult to adjust in that case,
and of course, if we do change that one message it *won't* be completely
backward compatible (because it will have the additional information).
It's not a critical issue for me, so let's see if anybody else chimes in.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-31 Thread R. David Murray

R. David Murray added the comment:

If backward compatibility is the concern, I'd think you'd just want to restore 
that one message.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-31 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

So, here's a patch that should work.  One thing I'm not positive about is that 
this is a more expansive change then just merging the two messages in the one 
case in the original description.  But it probably makes sense to be 
consistent.  Or should we try for a narrower fix?

--
Added file: http://bugs.python.org/file33832/20453.expansive

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-31 Thread R. David Murray

R. David Murray added the comment:

It seems to me that it should indeed have been that way.  I thought the 
referenced issue was *adding* the location information to the existing error 
messages.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-31 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

What do you think of combining the error messages, e.g.

No JSON object could be decoded, expecting value: line 1 column 1 (char 0)

?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, the change is deliberate (issue16009).

--
nosy: +ezio.melotti, pitrou, rhettinger, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-01-31 Thread Barry A. Warsaw

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com