Skip to content

argparse: when wrong choice is selected, the error message prints available choices using repr() instead of str() #118839

Closed as not planned

Description

@rindeal

Bug report

Bug description:

I tried using StrEnum for choices and it printed choose from <Enum.FOO: 'foo'>, ... instead of choose from foo, .....

Fix in #117766

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on May 9, 2024
  2. serhiy-storchaka commented on Sep 27, 2024

    @serhiy-storchaka
    Member

    This is actually a duplicate of #86357.

  3. rindeal commented on Sep 27, 2024

    @rindeal
    ContributorAuthor

    This is actually a duplicate of #86357.

    Good find. I've re-linked the PR and I'm closing this in favor of that issue.

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

    type-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions