fix: [PgpDump] catch UnicodeDecodeError error

pull/422/head
Terrtia 2019-06-12 10:33:40 +02:00
parent e71daac7d2
commit 2b6cb86d55
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 6 additions and 1 deletions

View File

@ -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):