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

Gnupg return code 2 while trusting key #243

Open
Nichokas opened this issue Oct 29, 2024 · 1 comment
Open

Gnupg return code 2 while trusting key #243

Nichokas opened this issue Oct 29, 2024 · 1 comment

Comments

@Nichokas
Copy link

Nichokas commented Oct 29, 2024

Describe the bug
The Python script should be updating the trust level, but it might be me; I can’t think of any way to fix it."
To Reproduce

gpg = gnupg.GPG()
cert="DACCF18B6800FCD0"
trust_levels = [("TRUST_FULLY", "Trusted"),("TRUST_NEVER", "NOT Trusted")]
trust = radiolist_dialog(
    title="Select a trust level",
    text="Selec a trust level for the selected key:",
    values=trust_levels
).run()
if trust:
    gpg.trust_keys(cert, trust)

File "/home/nichokas/Documents/gpg4td/venv/lib/python3.12/site-packages/gnupg.py", line 2276, in trust_keys
raise ValueError('gpg returned an error - return code %d' % p.returncode)
ValueError: gpg returned an error - return code 2

Expected behavior
Certificate with changed trust

Environment

  • fedora linux 40, python 3.12
  • v0.5.3
@vsajip
Copy link
Owner

vsajip commented Oct 30, 2024

I suggest you enable logging and look at the portion of the log relating to the trust_keys() call. If you don't spot an obvious problem, post that portion of the log here.

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

No branches or pull requests

2 participants