[elbe-devel] [PATCH 02/25] soapclient: open files in binary mode
Manuel Traut
manut at linutronix.de
Fri Dec 1 16:50:59 CET 2017
binascii.bs2a_base64 expects binary data
Signed-off-by: Manuel Traut <manut at linutronix.de>
---
elbepack/soapclient.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index d5a15d7e..add70122 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -255,7 +255,7 @@ class SetXmlAction(ClientAction):
size = 1024 * 1024
part = 0
- with file (filename, "r") as fp:
+ with file (filename, "rb") as fp:
while (True):
xml_base64 = binascii.b2a_base64(fp.read (size))
# finish upload
@@ -670,7 +670,6 @@ class DownloadAction(RepoAction):
client.download_file (builddir, filename, dst_fname)
print("%s saved" % dst_fname)
-
RepoAction.register(DownloadAction)
@@ -685,7 +684,7 @@ class UploadPackageAction(RepoAction):
# Uploads file f into builddir in intivm
size = 1024 * 1024
part = 0
- with file (f, "r") as fp:
+ with file (f, "rb") as fp:
while (True):
xml_base64 = binascii.b2a_base64(fp.read (size))
# finish upload
--
2.15.1
More information about the elbe-devel
mailing list