HomePhabricator

Fix JSON response loading

Description

Fix JSON response loading

json.load [1] only accepts binary files, such as HTTPResponse objects,
since Python 3.6. As Toolforge only has Python 3.4, we have to go for
the slightly more inefficient route of loading the whole response into
memory, decoding it in-memory, and then parsing it in-memory. Luckily,
none of the responses are expected to be large enough for this to matter
very much.

[1]: https://docs.python.org/3/library/json.html#json.load

Details

Provenance
LucasWerkmeisterAuthored on Oct 21 2018, 4:52 PM
Parents
R2422:67e30d1eadc4: Remove underscores in numeric literals
Branches
Unknown
Tags
Unknown
Reverted By
R2422:f364335bf8cd: Revert "Fix JSON response loading"
ChangeId
None