mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [PgpDump] catch UnicodeDecodeError error
This commit is contained in:
parent
e71daac7d2
commit
2b6cb86d55
1 changed files with 6 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue