isislovecruft / python-gnupg

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

Changed GPG homedir argument to $HOME/.gnupg #154

Closed jgraef closed 7 years ago

jgraef commented 8 years ago

Instead of _util._conf use _util._ugpg as default for homedir.

The documentation for the homedir parameter says:

Full pathname to directory containing the public and private keyrings. Default is whatever GnuPG defaults to.

Therefore the default for it should be _ugpg (which is usually $HOME/.gpg) and not _conf

jgraef commented 8 years ago

My GPG keyring was just wiped. Is it possible that python-gnupg "resets" the keyring that it uses?

meskio commented 7 years ago

@jgraef if you use gnupg version 2.x (like the default in debian sid) chances are that you are using the new keyring format pubring.kbx and private-keys-v1.d. This format doesn't live well with old style *.gpg keyrings, if you have both a pubring.kbx and a pubring.gpg gpg will show you only the contents of the pubring.gpg :(

I'm not sure if python-gnupg generates the pubring.gpg creating this problem.

meskio commented 7 years ago

I tested this pull req and looks good

isislovecruft commented 7 years ago

Hi @jgraef! I'm not sure that we want to use $HOME/.gnupg, for exactly the reason of the problem you experienced: we don't want to accidentally erase/damage/change a user's real keyring, or surprise them in any way. If you really want to use your real GNUPGHOME directory, then please do GPG([…], home='~/.gnupg').

isislovecruft commented 7 years ago

The documentation is wrong, however. That should be fixed.