Skip to content

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

Description

@tomasr8

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

Activity

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

Metadata

Metadata

Assignees

Labels

triagedThe issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or error

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions