[issue21451] Improve error messages for malformed JSON

2014-05-07 Thread Raymond Hettinger
New submission from Raymond Hettinger: The error message for malformed JSON just tells you that the JSON is invalid, it doesn't say why (showing you which character bombed, what text is being read, what the pending openers are, or what allowable characters would have been expected). In the

[issue21451] Improve error messages for malformed JSON

2014-05-07 Thread R. David Murray
R. David Murray added the comment: Python 3.4.0+ (3.4:d994d75cce95, May 6 2014, 21:37:02) [GCC 4.8.2] on linux Type help, copyright, credits or license for more information. import json json.loads('''[ ... boys: 10, ... girls: 20, ... ]''') Traceback (most recent

[issue21451] Improve error messages for malformed JSON

2014-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: What do you think about backporting the improved error messages? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21451 ___

[issue21451] Improve error messages for malformed JSON

2014-05-07 Thread R. David Murray
R. David Murray added the comment: Hmm. I guess I don't have any objection in principle. It is hard to imagine why someone would depend on the exact format of the old low-information messages, though anything is possible. -- ___ Python tracker