fix 3262: protobuf SerializeToString() returns bytes..
This commit is contained in:
parent
e05854f004
commit
60e0b43b81
|
@ -411,7 +411,7 @@ def sign_request_with_x509(pr, key_path, cert_path):
|
||||||
s = f.read()
|
s = f.read()
|
||||||
bList = pem.dePemList(s, "CERTIFICATE")
|
bList = pem.dePemList(s, "CERTIFICATE")
|
||||||
certificates = pb2.X509Certificates()
|
certificates = pb2.X509Certificates()
|
||||||
certificates.certificate.extend(map(str, bList))
|
certificates.certificate.extend(map(bytes, bList))
|
||||||
pr.pki_type = 'x509+sha256'
|
pr.pki_type = 'x509+sha256'
|
||||||
pr.pki_data = certificates.SerializeToString()
|
pr.pki_data = certificates.SerializeToString()
|
||||||
msgBytes = bytearray(pr.SerializeToString())
|
msgBytes = bytearray(pr.SerializeToString())
|
||||||
|
|
|
@ -1292,7 +1292,7 @@ class Abstract_Wallet(PrintError):
|
||||||
except OSError as exc:
|
except OSError as exc:
|
||||||
if exc.errno != errno.EEXIST:
|
if exc.errno != errno.EEXIST:
|
||||||
raise
|
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())
|
f.write(pr.SerializeToString())
|
||||||
# reload
|
# reload
|
||||||
req = self.get_payment_request(addr, config)
|
req = self.get_payment_request(addr, config)
|
||||||
|
|
Loading…
Reference in New Issue