Skip to content

pygettext: help output for keywords prints the whole keyword dictionary #129911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tomasr8 opened this issue Feb 9, 2025 · 0 comments
Closed
Assignees
Labels
triaged The issue has been accepted as valid by a triager. type-bug An unexpected behavior, bug, or error

Comments

@tomasr8
Copy link
Member

tomasr8 commented Feb 9, 2025

Bug report

Bug description:

The --keyword entry when printing the help via ./python Tools/i18n/pygettext.py --help shows the whole keyword dictionary:

    -k word                                                                                                                                                   
    --keyword=word                                                                                                                                            
        Keywords to look for in addition to the default set, which are:                                                                                       
        {'_': {0: 'msgid'}, 'gettext': {0: 'msgid'}, 'ngettext': {0: 'msgid', 1: 'msgid_plural'}, 'pgettext': {0: 'msgctxt', 1: 'msgid'}, 'npgettext': {0: 'ms
gctxt', 1: 'msgid', 2: 'msgid_plural'}, 'dgettext': {1: 'msgid'}, 'dngettext': {1: 'msgid', 2: 'msgid_plural'}, 'dpgettext': {1: 'msgctxt', 2: 'msgid'}, 'dnpg
ettext': {1: 'msgctxt', 2: 'msgid', 3: 'msgid_plural'}}                                                                                                       
                                                                                                                                                              
        You can have multiple -k flags on the command line.

This is because the format of DEFAULTKEYWORDS recently changed from a list to a dictionary.
We should just list the function names as we did before.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@tomasr8 tomasr8 added the type-bug An unexpected behavior, bug, or error label Feb 9, 2025
@tomasr8 tomasr8 self-assigned this Feb 9, 2025
@picnixz picnixz added the triaged The issue has been accepted as valid by a triager. label Feb 10, 2025
@tomasr8 tomasr8 closed this as completed Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged The issue has been accepted as valid by a triager. type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

2 participants