[elbe-devel] [PATCH 01/10] soapclient: replace 'with file' with 'with open'

Manuel Traut manut at linutronix.de
Fri Sep 29 00:11:37 CEST 2017


it isn't working in python3

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/daemons/soap/esoap.py | 2 +-
 elbepack/soapclient.py         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index a866aee5..8189a94f 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -119,7 +119,7 @@ class ESoap (ServiceBase):
         if (pos >= file_stat.st_size):
             return "EndOfFile"
 
-        with file (file_name) as fp:
+        with open (file_name) as fp:
             if not fp:
                 return "FileNotFound"
             try:
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index d5a15d7e..50261faa 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 open (filename, "r") as fp:
             while (True):
                 xml_base64 = binascii.b2a_base64(fp.read (size))
                 # finish upload
@@ -685,7 +685,7 @@ class UploadPackageAction(RepoAction):
         # Uploads file f into builddir in intivm
         size = 1024 * 1024
         part = 0
-        with file (f, "r") as fp:
+        with open (f, "r") as fp:
             while (True):
                 xml_base64 = binascii.b2a_base64(fp.read (size))
                 # finish upload
-- 
2.14.1




More information about the elbe-devel mailing list