# python gpgme-pytest.py !! testing encryption Traceback (most recent call last): File "/usr/lib64/python3.4/site-packages/gpg/core.py", line 259, in encrypt self.op_encrypt_sign(recipients, flags, plaintext, ciphertext) File "/usr/lib64/python3.4/site-packages/gpg/core.py", line 151, in wrapper return _funcwrap(self, *args) File "/usr/lib64/python3.4/site-packages/gpg/core.py", line 135, in _funcwrap return errorcheck(result, "Invocation of " + name) File "/usr/lib64/python3.4/site-packages/gpg/errors.py", line 62, in errorcheck raise GPGMEError(retval, extradata) gpg.errors.GPGMEError: Invocation of gpgme_op_encrypt_sign: GPGME: Unusable secret key During handling of the above exception, another exception occurred: Traceback (most recent call last): File "gpgme-pytest.py", line 7, in ciphertext, _, _ = c.encrypt(b"Hello world") File "/usr/lib64/python3.4/site-packages/gpg/core.py", line 263, in encrypt if e.getcode() == errors.UNUSABLE_PUBKEY: AttributeError: 'module' object has no attribute 'UNUSABLE_PUBKEY'