GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-122873: Allow "python3 -m json" to work by treyhunner · Pull Request #122884 · python/cpython

Conversation

@treyhunner

@treyhunner treyhunner commented Aug 10, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Allow python3 -m json to work in addition to python3 -m json.tool and update documentation to use python3 -m json instead of python3 -m json.tool.

Issue: #122873

  • Issue: Allow "-m json" instead of "-m json.tool" #122873

📚 Documentation preview 📚: https://cpython-previews--122884.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk, erlend-aasland, david-lev, and deronnax reacted with hooray emoji david-lev reacted with rocket emoji
All reactions
  • 🎉 4 reactions
  • 🚀 1 reaction
@bedevere-app bedevere-app Bot mentioned this pull request Aug 10, 2024
Allow "-m json" instead of "-m json.tool" #122873
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Aug 10, 2024
treyhunner added 10 commits August 10, 2024 12:24
@treyhunner
Rename json.tool to json.__main__
27e449d
@treyhunner
Make json.tool delegate to json.__main__
423c971
@treyhunner
Note json.tool deprecation
1c1a8fa
@treyhunner
Move main function from json.__main__ to json.tool
f8f6931
@treyhunner
Remove deprecation warning
834fbd7
@treyhunner
Fix module name as shown at command-line
62afcf1
@treyhunner
Update docs and what's new for json.tool to json
f58e60a
@treyhunner
Remove duplicate json module description from docs
168082a
@treyhunner
Give up on marking -m as an option
52039ee
@treyhunner
Remove unnecessary newline in changed note
2e37475
@treyhunner
treyhunner force-pushed the json-script2 branch from 4a8fdb0 to 2e37475 Compare August 10, 2024 19:36
@treyhunner
Remove now-invalid json.tool module reference
efd0503
AA-Turner
AA-Turner reviewed Aug 10, 2024
View reviewed changes
Comment thread Doc/library/json.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/json.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/json/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/json/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@treyhunner
Add news entry with blurb
c6bb211
@treyhunner

treyhunner commented Aug 10, 2024

Copy link
Copy Markdown
Member Author

Thank you @AA-Turner for reviewing. Let me know if you'd like any variation of the suggestions I commented on made.

I just used blurb to add a NEWS.d entry as well.
I wrote the same copy as in "What's New".
I'm fuzzy on the use of "What's New" and NEWS.d, so please correct me if either should be updated or removed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

treyhunner and others added 3 commits August 10, 2024 14:38
@treyhunner @AA-Turner
Remove older raw string usage in docstring
e768e39
Co-authored-by: Adam Turner <[email protected]>
@treyhunner @AA-Turner
Use sentence case in section title
a6b5c0d
Co-authored-by: Adam Turner <[email protected]>
@treyhunner @AA-Turner
Add CLI invocation for easier copy-pasting
3105bc2
Co-authored-by: Adam Turner <[email protected]>
@AA-Turner

AA-Turner commented Aug 10, 2024

Copy link
Copy Markdown
Member

I just used blurb to add a NEWS.d entry as well.
I wrote the same copy as in "What's New".
I'm fuzzy on the use of "What's New" and NEWS.d, so please correct me if either should be updated or removed.

NEWS.d goes into the full changelog, whatsnes is for bigger or user visible changes. Using the same text for both is fine, you've done the right thing here.

A

treyhunner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Aug 10, 2024

Copy link
Copy Markdown
Member

I'm fuzzy on the use of "What's New" and NEWS.d, so please correct me if either should be updated or removed.

We do want both.

"What's New" is the main set release notes. This'll be the main document people read about the release (~30k views/month):

https://docs.python.org/3.14/whatsnew/3.14.html#json

NEWS.d files eventually becomes part of the giant changelog, not read so often (~4k views/month), but can be useful to filter via the search box:

https://docs.python.org/3.14/whatsnew/changelog.html

treyhunner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk
hugovk reviewed Aug 10, 2024
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Let's also change ./Doc/library/cmdline.rst:

-* :ref:`json.tool <json-commandline>`
+* :ref:`json <json-commandline>`

https://cpython-previews--122884.org.readthedocs.build/en/122884/library/cmdline.html

For the What's New and NEWS.d, shall we also mention python -m json explicitly, and include a link to the json-commandline reference?

And there's some json.tool -> json we can update in the Lib/json/__init__.py docstring.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

treyhunner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Misc/NEWS.d/next/Library/2024-08-10-14-16-59.gh-issue-122873.XlHaUn.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

treyhunner added 3 commits August 10, 2024 15:58
@treyhunner
Update json.__init__ docstring for python -m json
238fc57
@treyhunner
Note python -m json in What's New
7f704bf
@treyhunner
Use SystemExit consistently in json package
fba68ac
AA-Turner
AA-Turner reviewed Aug 11, 2024
View reviewed changes
Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Misc/NEWS.d/next/Library/2024-08-10-14-16-59.gh-issue-122873.XlHaUn.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@treyhunner
Improve grammar in news
8662c81
ncoghlan
ncoghlan reviewed Aug 12, 2024
View reviewed changes

@ncoghlan ncoghlan left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

PR mostly looks good to me, just some comments inline around keeping a minimal level of json.tool documentation (since the submodule still exists and isn't going anywhere).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/json.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/json.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/json.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/whatsnew/3.14.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/json/tool.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@treyhunner @hugovk
Add json.tool submodule documentation reference back in.
52129e6
Co-authored-by: Hugo van Kemenade <[email protected]>
treyhunner and others added 3 commits August 12, 2024 07:01
@treyhunner @ncoghlan
Note that json.tool still works for compatibility reasons
016206d
Co-authored-by: Alyssa Coghlan <[email protected]>
@treyhunner @ncoghlan
Note that json.tool implements the CLI
9b22285
Co-authored-by: Alyssa Coghlan <[email protected]>
@treyhunner @ncoghlan
Reference json.__main__ in json.tool docstring
9fd0c1c
Co-authored-by: Alyssa Coghlan <[email protected]>
@hugovk

hugovk commented Aug 13, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

I think this is almost ready!

Please also change Doc/library/cmdline.rst:

-* :ref:`json.tool <json-commandline>`
+* :ref:`json <json-commandline>`

https://cpython-previews--122884.org.readthedocs.build/en/122884/library/cmdline.html

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@treyhunner
Switch json.tool to json on listing of Python CLIs
734fbf9
@treyhunner

treyhunner commented Aug 13, 2024

Copy link
Copy Markdown
Member Author

I think this is almost ready!

Please also change Doc/library/cmdline.rst:

-* :ref:`json.tool <json-commandline>`
+* :ref:`json <json-commandline>`

https://cpython-previews--122884.org.readthedocs.build/en/122884/library/cmdline.html

Just updated.

I had no idea this page existed. I wish I had known about it when writing my post on Python's CLIs! 😆

hugovk and ncoghlan reacted with rocket emoji
All reactions
  • 🚀 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk
hugovk approved these changes Aug 13, 2024
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

treyhunner and ncoghlan reacted with heart emoji
All reactions
  • ❤️ 2 reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Aug 13, 2024
AA-Turner
AA-Turner approved these changes Aug 13, 2024
View reviewed changes
@AA-Turner
AA-Turner merged commit 906b796 into python:main Aug 13, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Aug 13, 2024
@AA-Turner

AA-Turner commented Aug 13, 2024

Copy link
Copy Markdown
Member

Thanks @treyhunner!

A

treyhunner and ncoghlan reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@treyhunner
treyhunner deleted the json-script2 branch August 13, 2024 16:10
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
@treyhunner @AA-Turner
@hugovk @ncoghlan @blhsing
pythongh-122873: Allow "python -m json" to work (python#122884)
8b27d24
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Alyssa Coghlan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ncoghlan ncoghlan ncoghlan left review comments
@hugovk hugovk hugovk approved these changes
@AA-Turner AA-Turner AA-Turner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@treyhunner @AA-Turner @hugovk @ncoghlan
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.