KowalskiThomas · GitHub

Bug report

Bug description

The recently introduced array_hook parameter to json.load isn't being forwarded to json.loads, making it a no-op (it is always None).

This very simple reproducer shows it -- it fails with an Assertion Error.

fp = StringIO('[10, 20, 30]')
result = self.json.load(fp, array_hook=tuple)
assert isinstance(result, tuple)

CPython versions tested on

CPython main branch

Operating systems tested on

macOS

Linked PRs

Read the original on github.com ↗