Skip to content
Myr

simplejson.JSONDecodeError may be raised on Py2 and Py3

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Clauss · committed by GitHub · parent 06462a6 · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:docs/user/quickstart.rst+3 added-3 removed
148 unmodified lines
149 [{'repository': {'open_issues': 0, 'url': 'https://github.com/...150151In case the JSON decoding fails, ``r.json()`` raises an exception. For example, if152the response gets a 204 (No Content), or if the response contains invalid JSON,153attempting ``r.json()`` raises ``ValueError: No JSON object could be decoded`` on154Python 2 and raises ``simplejson.JSONDecodeError`` or ``json.JSONDecodeError`` on155Python 3.153attempting ``r.json()`` raises ``simplejson.JSONDecodeError`` if simplejson is154installed or raises ``ValueError: No JSON object could be decoded`` on Python 2 or155``json.JSONDecodeError`` on Python 3.156157It should be noted that the success of the call to ``r.json()`` does **not**158indicate the success of the response. Some servers may return a JSON object in a159failed response (e.g. error details with HTTP 500). Such JSON will be decoded
407 unmodified lines