Skip to content

Conversation

@ndonegan
Copy link

No description provided.

import gpgme

os.environ['GNUPGHOME'] = '/path/to/dir'
ctx = gpgme.Context()
Copy link

@andreimacavei andreimacavei Jun 22, 2016

Choose a reason for hiding this comment

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

If you're using more than one keyrings this will change the base dir for all.
Instead it should be noted that you can use:

import tempfile
import gpgme

temp_dir = tempfile.mkdtemp(prefix="tmp.gpghome")
ctx = gpgme.Context()
ctx.set_engine_info(gpgme.PROTOCOL_OpenPGP, None, temp_dir)

This will change the gpg dir only for this keyring/context.

Copy link
Author

Choose a reason for hiding this comment

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

Seeing as you've come up with a LOT better method, I'd be happy to abandon the above PR and let you create the PR with the above details.

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