Skip to content

json.load doesn't properly forward array_hook to json.loads #149056

Closed

Description

@KowalskiThomas

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

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Apr 27, 2026
  2. added a commit that references this issue on May 29, 2026
  3. added a commit that references this issue on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions