Implement better GPG output decoding

This commit is contained in:
Jan Dittberner 2015-11-10 23:18:22 +01:00
parent 8dd7b5ad84
commit 2e3cb7aa64

View file

@ -160,7 +160,11 @@ def process_keyrings():
stdout=subprocess.PIPE)
fpr = None
for line in proc.stdout.readlines():
fpr = process_gpg_list_keys_line(line.decode('utf8'), fpr)
try:
line = line.decode('utf8')
except UnicodeDecodeError:
line = line.decode('iso8859-1')
fpr = process_gpg_list_keys_line(line, fpr)
retcode = proc.wait()
if retcode != 0:
logging.error("subprocess ended with return code %d", retcode)