Skip to content

Documentation Update: How To Change GPG Base Dir #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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