Andreas Heinlein <aheinl...@gmx.com> writes:

> Am 06.07.2017 um 14:01 schrieb Justus Winter:
>>> 2.) Is there a way to safely distinguish "User clicked cancel when asked
>>> for the passphrase" from other errors? I think an application should
>>> abort silently in this case, but I'm getting another GPGMEError without
>>> any clue to the reason.
>> Maybe.  GPGMEError is a very general error, this is a bit of pyme
>> legacy.  You can inspect the error code using .getcode().  For a quick
>> check, try to str() the error.
> Thank you for the quick answer. I gave it a try with 3 tests, one
> decrypt with cancel'ing the pinentry, one with missing private key and
> one with a truncated input file. All three gave
>
> print str(e): Invocation of gpgme_op_decrypt_verify: GPGME: Decryption
> failed
> print e.getcode(): 152
>
> So this doesn't help.

Well, then it is not python-gpg's fault, but the underlying library or
components do not differentiate that.

> But good to know someone is working on this

I'm not.  If you feel that this is important, please file a bug.


Cheers,
Justus

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to