❯ cat input.jsonl{"ingredients":["frog", "water", "chocolate", "glucose"]}{"ingredients":["chocolate","steel bolts"]}❯ python3.12 --versionPython 3.12.10
❯ python3.12 -m json.tool --json-lines input.jsonl{ "ingredients": [ "frog", "water", "chocolate", "glucose" ]}{ "ingredients": [ "chocolate", "steel bolts" ]}❯ python3.13 --versionPython 3.13.3
❯ python3.13 -m json.tool --json-lines input.jsonlI/O operation on closed file.
❯ python3.14 --versionPython 3.14.0a7
❯ python3.14 -m json.tool --json-lines input.jsonlI/O operation on closed file.
❯ ./python.exe --version --versionPython 3.14.0a7+ (heads/main:e42bda94411, Apr 17 2025, 14:59:38) [Clang 16.0.0 (clang-1600.0.26.6)]
❯ ./python.exe Lib/test/test_json/test_tool.py -h
❯ ./python.exe -m json.tool --json-lines input.jsonlI/O operation on closed file.
Bug report
Bug description:
With any JSON Lines file, such as:
This works on Python 3.12:
But not 3.13 or higher:
CPython versions tested on:
3.13, 3.14, CPython main branch
Operating systems tested on:
macOS, Linux
Linked PRs