Skip to content
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

Allow automatic trustdb checks to be disabled. #129

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gnupg/_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ def _get_options_group(group=None):
'--lock-multiple',
'--lock-never',
'--lock-once',
'--no-auto-check-trustdb',
'--no-default-keyring',
'--no-default-recipient',
'--no-emit-version',
Expand Down
3 changes: 2 additions & 1 deletion gnupg/gnupg.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ def __init__(self, binary=None, homedir=None, verbose=False,

# Make sure that the trustdb exists, or else GnuPG will exit with a
# fatal error (at least it does with GnuPG>=2.0.0):
self.create_trustdb()
if not (self.options is not None and '--no-auto-check-trustdb' in self.options):
self.create_trustdb()

# The --no-use-agent and --use-agent options were deprecated in GnuPG
# 2.x, so we should set use_agent to None here to avoid having
Expand Down