]> granicus.if.org Git - python/commitdiff
Documenting that json.load may raise a ValueError.
authorFelix Crux <felixc@felixcrux.com>
Mon, 12 Aug 2013 21:39:51 +0000 (17:39 -0400)
committerFelix Crux <felixc@felixcrux.com>
Mon, 12 Aug 2013 21:39:51 +0000 (17:39 -0400)
Issue #18680: JSONDecoder should document that it raises a ValueError
  for malformed data

Doc/library/json.rst

index 68aef217936bdf50cdc489679bc3cfed3ba0d183..877ccd07ee1315baded538c719436fe710419555 100644 (file)
@@ -245,6 +245,8 @@ Basic Usage
    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)