From 2b6cb86d55f373e520202ba75ff76074003d6283 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Wed, 12 Jun 2019 10:33:40 +0200 Subject: [PATCH] fix: [PgpDump] catch UnicodeDecodeError error --- bin/PgpDump.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/PgpDump.py b/bin/PgpDump.py index 21ffd263..4b7ec629 100755 --- a/bin/PgpDump.py +++ b/bin/PgpDump.py @@ -82,7 +82,12 @@ def get_pgp_packet(message, save_path): process1 = subprocess.Popen([ 'echo', '-e', save_path], stdout=subprocess.PIPE) process2 = subprocess.Popen([ 'pgpdump'], stdin=process1.stdout, stdout=subprocess.PIPE) process1.stdout.close() - output = process2.communicate()[0].decode() + output = process2.communicate()[0] + try: + output = output.decode() + except UnicodeDecodeError: + publisher.error('Error PgpDump UnicodeDecodeError: {}'.format(message)) + output = '' return output def get_pgp_packet_file(file):