fix saving request: binary flag is needed on windows

This commit is contained in:
ThomasV 2015-01-31 20:25:12 +01:00
parent 78ce20b0b8
commit 820d356325
1 changed files with 2 additions and 2 deletions

View File

@ -110,7 +110,7 @@ class PaymentRequest:
self.id = bitcoin.sha256(r)[0:16].encode('hex')
filename = os.path.join(self.dir_path, self.id)
with open(filename,'w') as f:
with open(filename,'wb') as f:
f.write(r)
return self.parse(r)
@ -125,7 +125,7 @@ class PaymentRequest:
def read_file(self, key):
filename = os.path.join(self.dir_path, key)
with open(filename,'r') as f:
with open(filename,'rb') as f:
r = f.read()
assert key == bitcoin.sha256(r)[0:16].encode('hex')