Improper construction for gpg.constants.import in GPGME python bindings
Closed, ResolvedPublic

Description

Hello!

In gpg.constants, there is a subclass/attribute named "import". However, this is a forbidden keyword per python (because of the "import" statement):

>>> import keyword
>>> keyword.iskeyword('import')
True

leading to strange errors like this:

>>> import gpg
>>> gpg.constants.import.NEW
  File "<stdin>", line 1
    gpg.constants.import.NEW
                       ^
SyntaxError: invalid syntax

perhaps change gpg.constants.import to gpg.constants.import_type?

brents created this task.Nov 5 2018, 7:24 PM
brents added a comment.Nov 5 2018, 8:38 PM

or, more accurately so it matches the C api, perhaps gpg.constants.import_status

werner triaged this task as High priority.Nov 6 2018, 9:19 AM
werner assigned this task to BenM.
werner raised the priority of this task from High to Unbreak Now!.Sat, Nov 17, 10:54 AM
werner added a subscriber: werner.

Form my understanding this needs to be fixed urgently.

oh! i suppose i underestimated the severity of it. apologies!

BenM closed this task as Resolved.Mon, Nov 19, 11:44 AM

This should be fixed in commit fd34415bdd57332424bd5a98d279e2331678a2fb