[elbe-devel] [PATCH 2/2] elbepack: egpg: stop silently swallowing errors

Thomas Weißschuh thomas.weissschuh at linutronix.de
Wed May 15 11:19:28 CEST 2024


No reasoning is determinable about why errors can be swalloed.
The caller called the function for a reason.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/egpg.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/elbepack/egpg.py b/elbepack/egpg.py
index 936154bf606a..db7a76afdbb8 100644
--- a/elbepack/egpg.py
+++ b/elbepack/egpg.py
@@ -3,7 +3,6 @@
 # SPDX-FileCopyrightText: 2014-2016 Linutronix GmbH
 
 import base64
-import logging
 import os
 import pathlib
 import shutil
@@ -295,14 +294,9 @@ def export_key(fingerprint, outfile):
 def unarmor_openpgp_keyring(armored):
     """
     Unarmors one ascii-armored (string) OpenPGP keyring.
-    Returns a binary string (empty for invalid keys).
     """
     b64 = armored.strip()                                              \
                  .removeprefix('-----BEGIN PGP PUBLIC KEY BLOCK-----') \
                  .removesuffix('-----END PGP PUBLIC KEY BLOCK-----')   \
                  .strip()
-    try:
-        return base64.b64decode(b64)
-    except Exception as e:
-        logging.error(e)
-        return b''
+    return base64.b64decode(b64)

-- 
2.45.0



More information about the elbe-devel mailing list