Skip to content

gh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys=True #132200

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

Conversation

roeibenartzi
Copy link
Contributor

@roeibenartzi roeibenartzi commented Apr 7, 2025

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 7, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Apr 7, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Copy link
Contributor

@nineteendo nineteendo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, this matches what I did in jsonyx.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 3, 2025
@serhiy-storchaka serhiy-storchaka merged commit ec12559 into python:main Jun 3, 2025
53 checks passed
@miss-islington-app
Copy link

Thanks @roeibenartzi for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 3, 2025
…indent and skipkeys=True (pythonGH-132200)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry, @roeibenartzi and @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker ec12559ebafca01ded22c9013de64abe535c838d 3.13

@bedevere-app
Copy link

bedevere-app bot commented Jun 3, 2025

GH-135060 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 Jun 3, 2025
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Jun 3, 2025
… using indent and skipkeys=True (pythonGH-132200)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Jun 3, 2025

GH-135061 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 Jun 3, 2025
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Jun 3, 2025
… using indent and skipkeys=True (pythonGH-132200)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
@serhiy-storchaka
Copy link
Member

Thank you for your contribution @roeibenartzi.

Please sign the CLI also for your GitHub address. This is necessary for backporting.

@roeibenartzi
Copy link
Contributor Author

Thanks @nineteendo for reviewing and @serhiy-storchaka for merging my first CPython contribution 🎉
Also - thanks @noamcohen97 for guidinging me through the process

serhiy-storchaka pushed a commit that referenced this pull request Jun 5, 2025
… indent and skipkeys=True (GH-132200) (GH-135060)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
serhiy-storchaka added a commit that referenced this pull request Jun 5, 2025
… indent and skipkeys=True (GH-132200) (GH-135061)

(cherry picked from commit ec12559)

Co-authored-by: Roei Ben Artzi <155478676+roeibenartzi@users.noreply.github.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Debian root 3.14 (tier-1) has failed when building commit 97822b8.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1742/builds/171) and take a look at the build logs.
  4. Check if the failure is related to this commit (97822b8) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1742/builds/171

Failed tests:

  • test_embed
  • test.test_concurrent_futures.test_thread_pool

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 53, done.        
remote: Counting objects:   1% (1/53)        
remote: Counting objects:   3% (2/53)        
remote: Counting objects:   5% (3/53)        
remote: Counting objects:   7% (4/53)        
remote: Counting objects:   9% (5/53)        
remote: Counting objects:  11% (6/53)        
remote: Counting objects:  13% (7/53)        
remote: Counting objects:  15% (8/53)        
remote: Counting objects:  16% (9/53)        
remote: Counting objects:  18% (10/53)        
remote: Counting objects:  20% (11/53)        
remote: Counting objects:  22% (12/53)        
remote: Counting objects:  24% (13/53)        
remote: Counting objects:  26% (14/53)        
remote: Counting objects:  28% (15/53)        
remote: Counting objects:  30% (16/53)        
remote: Counting objects:  32% (17/53)        
remote: Counting objects:  33% (18/53)        
remote: Counting objects:  35% (19/53)        
remote: Counting objects:  37% (20/53)        
remote: Counting objects:  39% (21/53)        
remote: Counting objects:  41% (22/53)        
remote: Counting objects:  43% (23/53)        
remote: Counting objects:  45% (24/53)        
remote: Counting objects:  47% (25/53)        
remote: Counting objects:  49% (26/53)        
remote: Counting objects:  50% (27/53)        
remote: Counting objects:  52% (28/53)        
remote: Counting objects:  54% (29/53)        
remote: Counting objects:  56% (30/53)        
remote: Counting objects:  58% (31/53)        
remote: Counting objects:  60% (32/53)        
remote: Counting objects:  62% (33/53)        
remote: Counting objects:  64% (34/53)        
remote: Counting objects:  66% (35/53)        
remote: Counting objects:  67% (36/53)        
remote: Counting objects:  69% (37/53)        
remote: Counting objects:  71% (38/53)        
remote: Counting objects:  73% (39/53)        
remote: Counting objects:  75% (40/53)        
remote: Counting objects:  77% (41/53)        
remote: Counting objects:  79% (42/53)        
remote: Counting objects:  81% (43/53)        
remote: Counting objects:  83% (44/53)        
remote: Counting objects:  84% (45/53)        
remote: Counting objects:  86% (46/53)        
remote: Counting objects:  88% (47/53)        
remote: Counting objects:  90% (48/53)        
remote: Counting objects:  92% (49/53)        
remote: Counting objects:  94% (50/53)        
remote: Counting objects:  96% (51/53)        
remote: Counting objects:  98% (52/53)        
remote: Counting objects: 100% (53/53)        
remote: Counting objects: 100% (53/53), done.        
remote: Compressing objects:   4% (1/25)        
remote: Compressing objects:   8% (2/25)        
remote: Compressing objects:  12% (3/25)        
remote: Compressing objects:  16% (4/25)        
remote: Compressing objects:  20% (5/25)        
remote: Compressing objects:  24% (6/25)        
remote: Compressing objects:  28% (7/25)        
remote: Compressing objects:  32% (8/25)        
remote: Compressing objects:  36% (9/25)        
remote: Compressing objects:  40% (10/25)        
remote: Compressing objects:  44% (11/25)        
remote: Compressing objects:  48% (12/25)        
remote: Compressing objects:  52% (13/25)        
remote: Compressing objects:  56% (14/25)        
remote: Compressing objects:  60% (15/25)        
remote: Compressing objects:  64% (16/25)        
remote: Compressing objects:  68% (17/25)        
remote: Compressing objects:  72% (18/25)        
remote: Compressing objects:  76% (19/25)        
remote: Compressing objects:  80% (20/25)        
remote: Compressing objects:  84% (21/25)        
remote: Compressing objects:  88% (22/25)        
remote: Compressing objects:  92% (23/25)        
remote: Compressing objects:  96% (24/25)        
remote: Compressing objects: 100% (25/25)        
remote: Compressing objects: 100% (25/25), done.        
remote: Total 30 (delta 26), reused 7 (delta 5), pack-reused 0 (from 0)        
From https://github.com/python/cpython
 * branch                    3.14       -> FETCH_HEAD
Note: switching to '97822b8199c84f4900c74b0ab01ce08a13d1c99e'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 97822b8199c [3.14] gh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys=True (GH-132200) (GH-135060)
Switched to and reset branch '3.14'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
configure: WARNING: pkg-config is missing. Some dependencies may not be detected correctly.

make: *** [Makefile:2454: buildbottest] Error 2

@serhiy-storchaka
Copy link
Member

You are welcome. Nice work!

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