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 — Allow "-m json" instead of "-m json.tool" · Issue #122873 · python/cpython

Allow "-m json" instead of "-m json.tool" #122873

New issue
Copy link
New issue
Copy link
Closed
Closed
Allow "-m json" instead of "-m json.tool"#122873
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@treyhunner
treyhunner
opened on Aug 9, 2024
Issue body actions

Feature or enhancement

Proposal:

This is a feature proposal for allowing python3 -m json to work in addition to python -m json.tool and softly deprecating the use of python3 -m json.tool.

I made a branch to see what these changes might look like.

Here is a separate branch which issues a DeprecationWarning .
However, since json.tool will continue working that warning may cause more hassle for end users than is worthwhile.

I think the no-warning approach may be more sensible.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

Discussion in Ideas discuss thread

Linked PRs

  • gh-122873: Allow "python3 -m json" to work #122884
Reacted by Hugo van Kemenade, Alyssa Coghlan, Hash, Kirill Podoprigora and Erlend E. Aasland

Activity

  1. treyhunner
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Aug 9, 2024
  2. hugovk
    added
    3.14bugs and security fixesbugs and security fixes
    on Aug 9, 2024
  3. ncoghlan commented on Aug 10, 2024

    @ncoghlan
    ncoghlan
    on Aug 10, 2024
    Contributor
    More actions

    The "No warning" branch looks good to me (it would just need docs and News for me to approve a PR)

  4. Eclips4
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Aug 10, 2024
  5. Eclips4 commented on Aug 10, 2024

    @Eclips4
    Eclips4
    on Aug 10, 2024
    Member
    More actions

    Hi @hugovk! Just a quick note: type-feature label doesn't require a version label: https://devguide.python.org/triage/labels/#type-labels

    Reacted by Hugo van Kemenade
  6. Eclips4
    removed
    3.14bugs and security fixesbugs and security fixes
    on Aug 10, 2024
  7. hugovk commented on Aug 10, 2024

    @hugovk
    hugovk
    on Aug 10, 2024
    Member
    More actions

    The "No warning" branch looks good to me (it would just need docs and News for me to approve a PR)

    Agreed.

    And change this in Lib/json/tool.py?

     def main():
    -    prog = 'python -m json.tool'
    +    prog = 'python -m json'

    @treyhunner Would you like to put together a PR?

  8. treyhunner commented on Aug 10, 2024

    @treyhunner
    treyhunner
    on Aug 10, 2024
    MemberAuthor
    More actions

    I will put together a PR shortly. 👍

    Reacted by Hugo van Kemenade
  9. rhettinger commented on Aug 10, 2024

    @rhettinger
    rhettinger
    on Aug 10, 2024
    Contributor
    More actions

    +1 from me

  10. hugovk commented on Aug 11, 2024

    @hugovk
    hugovk
    on Aug 11, 2024
    Member
    More actions

    PR is here: #122884

  11. AA-Turner
    added a commit that references this issue on Aug 13, 2024

    gh-122873: Allow "python -m json" to work (#122884)

    906b796
  12. hugovk
    closed this as completedon Aug 13, 2024
  13. blhsing
    added a commit that references this issue on Aug 22, 2024

    pythongh-122873: Allow "python -m json" to work (python#122884)

    8b27d24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.