python: ctx.decrypt() has problematic error handling
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Tue, 4 Dec 2018 17:29:40 +0000 (20:29 +0300)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 5 Dec 2018 10:46:09 +0000 (11:46 +0100)
* 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>
lang/python/src/core.py

index 3bd6f71..f3202eb 100644 (file)
@@ -427,6 +427,10 @@ class Context(GpgmeWrapper):
                                               results=results)
 
         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
                    for s in verify_result.signatures):
                 raise errors.BadSignatures(verify_result, results=results)