Skip to content

Fix exceptions in argparse #126068

Closed
Closed

Description

@serhiy-storchaka

Bug report

There are several issues with exceptions in the argparse module:

  • Only error messages for ArgumentError and ArgumentTypeError should be translated. These exceptions are the part of the user interface of the program that uses argparse. Other exceptions indicate logical errors in the program and are purposed for the programmer.
  • ArgumentError should only be used for command line errors, not for logical errors in the program.

Linked PRs

Activity

  1. added a commit that references this issue on Oct 28, 2024
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Oct 28, 2024
  3. added a commit that references this issue on Oct 30, 2024
  4. serhiy-storchaka commented on Oct 30, 2024

    @serhiy-storchaka
    MemberAuthor

    Even if some of this looks like bugs, I decided to not backport the change, because there is a small chance of user code depending on this. The benefit of making all right is not large, most users will not notice the change.

  5. added a commit that references this issue on Dec 8, 2024
  6. added a commit that references this issue on Jan 12, 2025
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/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions