Skip to content

gh-132631: Fix "I/O operation on closed file" when parsing JSON Lines file#132632

Merged
hugovk merged 8 commits intopython:mainfrom
hugovk:3.14-fix-jsonlines
Apr 23, 2026
Merged

gh-132631: Fix "I/O operation on closed file" when parsing JSON Lines file#132632
hugovk merged 8 commits intopython:mainfrom
hugovk:3.14-fix-jsonlines

Conversation

@hugovk
Copy link
Copy Markdown
Member

@hugovk hugovk commented Apr 17, 2025

cat input.jsonl
{"ingredients":["frog", "water", "chocolate", "glucose"]}
{"ingredients":["chocolate","steel bolts"]}

Before

./python.exe -m json --json-lines input.jsonl
I/O operation on closed file.

After

./python.exe -m json --json-lines input.jsonl
{
    "ingredients": [
        "frog",
        "water",
        "chocolate",
        "glucose"
    ]
}
{
    "ingredients": [
        "chocolate",
        "steel bolts"
    ]
}

@hugovk hugovk added the needs backport to 3.13 bugs and security fixes label Apr 17, 2025
@hugovk hugovk changed the title Fix "I/O operation on closed file" when parsing JSON Lines file gh-132631: Fix "I/O operation on closed file" when parsing JSON Lines file Apr 17, 2025
Comment thread Misc/NEWS.d/next/Library/2025-04-17-15-26-35.gh-issue-132631.IDFZfb.rst Outdated
Comment thread Lib/json/tool.py Outdated
@python-cla-bot
Copy link
Copy Markdown

python-cla-bot Bot commented Apr 18, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 23, 2026
@zware zware removed the stale Stale PR or inactive for long period of time. label Apr 23, 2026
@hugovk hugovk enabled auto-merge (squash) April 23, 2026 14:56
@hugovk hugovk merged commit 42d645a into python:main Apr 23, 2026
53 of 54 checks passed
@hugovk hugovk deleted the 3.14-fix-jsonlines branch April 23, 2026 15:27
@miss-islington-app
Copy link
Copy Markdown

Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Apr 23, 2026

GH-148921 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Apr 23, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented Apr 23, 2026

GH-148922 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Apr 23, 2026
hugovk added a commit that referenced this pull request Apr 23, 2026
…N Lines file (GH-132632) (#148921)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants