Skip to content

json.dump() with indent and skipkeys can be formatted incorrectly #131884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nineteendo opened this issue Mar 29, 2025 · 0 comments
Closed

json.dump() with indent and skipkeys can be formatted incorrectly #131884

nineteendo opened this issue Mar 29, 2025 · 0 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@nineteendo
Copy link
Contributor

nineteendo commented Mar 29, 2025

Bug report

Bug description:

>>> import json
>>> print(json.dumps({b"": 0}, indent=4, skipkeys=True))
{
    
}

Related: #123183

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs

@nineteendo nineteendo added the type-bug An unexpected behavior, bug, or error label Mar 29, 2025
@picnixz picnixz added the stdlib Python modules in the Lib dir label Mar 29, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 3, 2025
…indent and skipkeys=True (pythonGH-132200)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <[email protected]>
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this issue Jun 3, 2025
… using indent and skipkeys=True (pythonGH-132200)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <[email protected]>
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this issue Jun 3, 2025
… using indent and skipkeys=True (pythonGH-132200)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <[email protected]>
serhiy-storchaka pushed a commit that referenced this issue Jun 5, 2025
… indent and skipkeys=True (GH-132200) (GH-135060)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <[email protected]>
serhiy-storchaka added a commit that referenced this issue Jun 5, 2025
… indent and skipkeys=True (GH-132200) (GH-135061)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

2 participants