Skip to content

Fix the --omit-header help text of pybabel update - #1527

Open
itzzdev09 wants to merge 2 commits into
python-babel:masterfrom
itzzdev09:fix-omit-header-help
Open

itzzdev09 wants to merge 2 commits into
python-babel:masterfrom
itzzdev09:fix-omit-header-help

Conversation

@itzzdev09

Copy link
Copy Markdown

The --omit-header help text of pybabel update is written as "do not include msgid "" entry in header". The inner "" closes and reopens the string literal, so Python concatenates the pieces and the help shown to users loses the quotes:

$ pybabel update --help
  --omit-header   do not include msgid  entry in header

ExtractMessages already uses single quotes for the same text; this does the same for UpdateCatalog.

Added test_update_catalog_omit_header_help, which fails before the change and passes after.

Comment on lines +242 to +246
def test_update_catalog_omit_header_help():
options = {name: help for name, _short, help in UpdateCatalog.user_options}
assert options['omit-header'] == 'do not include msgid "" entry in header'


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need a test, thanks.

Suggested change
def test_update_catalog_omit_header_help():
options = {name: help for name, _short, help in UpdateCatalog.user_options}
assert options['omit-header'] == 'do not include msgid "" entry in header'

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants