馃悰 Fix formatting in NoSuchOption.format_message() - #1843
Merged
Conversation
It used to be:
No such option: --param-a (Possible options: --param-b, --param-c)
And now it becomes:
No such option: --param-a ('(Possible options: --param-b, --param-c)',)
NoSuchOption.format_message()
svlandeg
approved these changes
Jun 17, 2026
Member
There was a problem hiding this comment.
Thanks for the PR and for going through the standard flow of opening a discussion first! 馃檹
This is indeed a typo from the vendoring (in which we removed ngettext from the original code here).
While this is considered internals and some of these error messages may still change in the future, for now it's an obvious little bug/typo that we should fix. I don't feel like a regression test is necessary at this point.
Merging 馃帀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request
Discussion: #1840
Description
NoSuchOption.format_message()intyper/_click/exceptions.pyproduces a tuplerepr in its output instead of a plain string when
possibilitiesis non-empty.Current output:
Error: No such option: --fooo ('(Possible options: --foo)',)Expected output:
Error: No such option: --fooo (Possible options: --foo)Checklist