0

I have an issue using the gnupg module in python in Ubuntu 14.

My keychain is set up correctly. I can use gpg on the command line to decrypt files with having to enter my passphrase.

I have also checked that my gpg-agent is running.

However, in my python script, I constantly get an error to the effect that no passphrase is available for my private key, which it needs to decrypt the file.

The error I am getting is:

Error opening terminal: unknown

I have also confirmed that I am using GPG 2+

Code is:

import gnupg
import os

def set_auth(k):

    h = os.path.expanduser("~")

    gpg = gnupg.GPG(homedir='~/.gnupg',use_agent=True)

    with open(h + "/.secure/" + k + ".gpg", "rb") as f:
        status = gpg.decrypt_file(f, output=h + "/.secure/key.tmp")

1 Answer 1

0

This turned out to be a bug in the version of python that this issue of Ubuntu was installing.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.