Skip to content

Commit

Permalink
fix: [PgpDump] catch UnicodeDecodeError error
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Jun 12, 2019
1 parent e71daac commit 2b6cb86
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bin/PgpDump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2b6cb86

Please sign in to comment.