Skip to content

Better argument validation for python *gettext functions #1002

Open

Description

@tomasr8

Overview Description

*gettext calls should be properly validated for the correct number/type of arguments and an error/warning should be issued if the signature does not match.

Some examples which currently produce po file entries w/o any errors/warnings:

gettext(some_arg="hello") - gettext takes only one positional argument
gettext("hello", "asdad") - same for this
ngettext("asd", "sdfsdfsd") - missing n argument

These should either be errors or at least warnings as they will result in runtime errors.

Additional Information

babel version 2.12.1

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions