[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-04-08 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-04-03 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +23914 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25173 ___ Python tracker

[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-03-03 Thread Kamil Turek
Change by Kamil Turek : -- nosy: +kamilturek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: json.loads() accepts also data encoded with UTF-16 and UTF-32. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Normally, we don't (or can't) enumerate all possible exceptions. But in this case, it is worth expanding the documentation so that person can know which of two common input errors they need to catch: "If the data being deserialized is not valid UTF-8 a

[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-02-27 Thread Eric V. Smith
Eric V. Smith added the comment: As a rule we don't try and document every exception that can be raised. I could go either way on documenting encoding errors with the json module, although it seems pretty clear that an encoding error would be possible in this case. -- assignee: ->

[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-02-27 Thread Matthew Woodcraft
New submission from Matthew Woodcraft : The documentation for json.load() and json.loads() says: « If the data being deserialized is not a valid JSON document, a JSONDecodeError will be raised. » But this is not currently entirely true: if the data is provided in bytes form and is not