python: ctx.decrypt() has problematic error handling

* lang/python/src/core.py (Context.decrypt): document odd
error-handling behavior as a potential problem to be addressed.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
Daniel Kahn Gillmor 2018-12-04 20:29:40 +03:00 committed by Andre Heinecke
parent 5d8b4f7489
commit 878a0ad012
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -427,6 +427,10 @@ class Context(GpgmeWrapper):
results=results) results=results)
if verify: if verify:
# FIXME: should we really throw BadSignature, even if
# we've encountered some good signatures? as above, once
# we hit this error, there is no way to accept it and
# continue to process the remaining signatures.
if any(s.status != errors.NO_ERROR if any(s.status != errors.NO_ERROR
for s in verify_result.signatures): for s in verify_result.signatures):
raise errors.BadSignatures(verify_result, results=results) raise errors.BadSignatures(verify_result, results=results)