[elbe-devel] [PATCH 2/2] Python 3: decode the downloaded base64 OpenPGP key
bage at linutronix.de
bage at linutronix.de
Tue Dec 10 23:31:17 CET 2019
From: Bastian Germann <bage at linutronix.de>
urlopen() returns binary data, so it has to be converted for Python 3.
As the data is base64 in this case, we can assume ASCII data.
Signed-off-by: Bastian Germann <bage at linutronix.de>
---
elbepack/xmlpreprocess.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/elbepack/xmlpreprocess.py b/elbepack/xmlpreprocess.py
index e310048e3..26db99b6b 100644
--- a/elbepack/xmlpreprocess.py
+++ b/elbepack/xmlpreprocess.py
@@ -43,7 +43,7 @@ def preprocess_pgp_key(xml):
print("[WARN] <key>%s</key> is deprecated. You should use raw-key instead." % key.text)
try:
keyurl = key.text.strip().replace('LOCALMACHINE', 'localhost')
- myKey = urlopen(keyurl).read()
+ myKey = urlopen(keyurl).read().decode('ascii')
key.tag = "raw-key"
key.text = "\n%s\n" % myKey
except HTTPError as E:
--
2.20.1
More information about the elbe-devel
mailing list