isislovecruft / python-gnupg

A modified version of python-gnupg, including security patches, extensive documentation, and extra features.
Other
424 stars 172 forks source link

Can't add --ignore-time-conflict to the options list #182

Open Dimss opened 7 years ago

Dimss commented 7 years ago

I'm trying to add the ignore-time-conflict option, to be able to import keys even if there is a clock mismatch. I'm initialise the GPG class in that way

gpg = gnupg.GPG(binary=config.GPG_BIN, homedir=self.get_home_dir(), options=['--ignore-time-conflict'])

but for some reason, when I'm executing that code, I see the following error:

Got groups: {'--ignore-time-conflict': ''}
_is_allowed(): Dropping option '--ignore-time-conflict'...
_check_option(): Option '--ignore-time-conflict' not supported.
Dropped option: '--ignore-time-conflict None'

To make it works I've patched the _parser.py file. I've updated the _get_options_group function, by adding --ignore-time-conflict option to none_options frozenset, and now it's works as expected.

My question, is there is a more proper way to make python's GPG wrapper to pass the --ignore-time-conflict options, without patching module code?

isislovecruft commented 6 years ago

Hi @Dimss! Nope, adding it as you have done is the correct way. If you'd like to submit a PR with your patch, I'll gladly take it.

nikiforniket commented 9 months ago

@isislovecruft Can we mark this issue resolved ?