[Python-checkins] cpython: Documenting that json.load may raise a ValueError.

david.wolever python-checkins at python.org
Tue Aug 13 00:13:41 CEST 2013


http://hg.python.org/cpython/rev/7ba77d77b499
changeset:   85145:7ba77d77b499
user:        Felix Crux <felixc at felixcrux.com>
date:        Mon Aug 12 17:39:51 2013 -0400
summary:
  Documenting that json.load may raise a ValueError.

Issue #18680: JSONDecoder should document that it raises a ValueError
  for malformed data

files:
  Doc/library/json.rst |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Doc/library/json.rst b/Doc/library/json.rst
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -329,6 +329,8 @@
    those with character codes in the 0-31 range, including ``'\t'`` (tab),
    ``'\n'``, ``'\r'`` and ``'\0'``.
 
+   If the data being deserialized is not a valid JSON document, a
+   :exc:`ValueError` will be raised.
 
    .. method:: decode(s)
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list