[elbe-devel] [PATCH 4/5] Python3: use os.write() instead of write()

Christian Teklenborg chris at linutronix.de
Fri Jan 10 15:46:01 CET 2020


In Python3 binascii.a2b() returns a binary string, but the write function
needs unicode strings. Therefore use os.write() to get the necessary unicode
string in Python2 and Python3.

Signed-off-by: Christian Teklenborg <chris at linutronix.de>
---
 elbepack/soapclient.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index cb8dbd8f..d5b18c2c 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -518,7 +518,7 @@ class DumpFileAction(ClientAction):
             if ret == "EndOfFile":
                 return
 
-            sys.stdout.write(binascii.a2b_base64(ret))
+            os.write(sys.stdout.fileno(), binascii.a2b_base64(ret))
             part = part + 1
 
 
-- 
2.20.1




More information about the elbe-devel mailing list