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

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


http://hg.python.org/cpython/rev/524693d62093
changeset:   85147:524693d62093
branch:      2.7
parent:      85139:adbc9789a5e4
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
@@ -348,6 +348,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