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

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


http://hg.python.org/cpython/rev/f11683963558
changeset:   85143:f11683963558
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
@@ -245,6 +245,8 @@
    kwarg; otherwise :class:`JSONDecoder` is used.  Additional keyword arguments
    will be passed to the constructor of the class.
 
+   If the data being deserialized is not a valid JSON document, a
+   :exc:`ValueError` will be raised.
 
 .. function:: loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)
 

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


More information about the Python-checkins mailing list