[issue43775] JSON Parsing Alarm: Requests + Json = JSONDecodeError

Raymond Hettinger report at bugs.python.org
Thu Apr 8 15:58:43 EDT 2021


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> Two days ago everything worked completely fine, 
> and now this disaster happens.

It's unlikely that Python itself changed over those two days. It's more likely that the data source has changed.

Try this in your notebook:

    import requests
    r = requests.get('https://api.github.com/users/gvanrossum')
    print(r.status_code)
    print(r.headers['Content-Type'])
    print(r.json())

If that works, try it with your url.  If the content-type is not 'application/json; charset=utf-8', then you've identified a problem with the data source rather than with the tooling.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43775>
_______________________________________


More information about the Python-bugs-list mailing list