From: Felix Crux Date: Mon, 12 Aug 2013 21:39:51 +0000 (-0400) Subject: Documenting that json.load may raise a ValueError. X-Git-Tag: v3.4.0a2~238 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60fb9719a195d55264b3129203790a6b43988442;p=thirdparty%2FPython%2Fcpython.git Documenting that json.load may raise a ValueError. Issue #18680: JSONDecoder should document that it raises a ValueError for malformed data --- diff --git a/Doc/library/json.rst b/Doc/library/json.rst index 68aef217936b..877ccd07ee13 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -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)