tfix 3262: protobuf SerializeToString() returns bytes.. - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 60e0b43b8129fe1b66a6ceeb9f2dc01a5b6de1b4 (DIR) parent e05854f0045138a68edd5f81c1a8d98e60360f24 (HTM) Author: ThomasV <thomasv@electrum.org> Date: Mon, 13 Nov 2017 11:10:51 +0100 fix 3262: protobuf SerializeToString() returns bytes.. Diffstat: M lib/paymentrequest.py | 2 +- M lib/wallet.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- (DIR) diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py t@@ -411,7 +411,7 @@ def sign_request_with_x509(pr, key_path, cert_path): s = f.read() bList = pem.dePemList(s, "CERTIFICATE") certificates = pb2.X509Certificates() - certificates.certificate.extend(map(str, bList)) + certificates.certificate.extend(map(bytes, bList)) pr.pki_type = 'x509+sha256' pr.pki_data = certificates.SerializeToString() msgBytes = bytearray(pr.SerializeToString()) (DIR) diff --git a/lib/wallet.py b/lib/wallet.py t@@ -1292,7 +1292,7 @@ class Abstract_Wallet(PrintError): except OSError as exc: if exc.errno != errno.EEXIST: raise - with open(os.path.join(path, key), 'w') as f: + with open(os.path.join(path, key), 'wb') as f: f.write(pr.SerializeToString()) # reload req = self.get_payment_request(addr, config)