[elbe-devel] [PATCH] python3: Fix get_archive file mode

bage at linutronix.de bage at linutronix.de
Mon Mar 8 11:44:03 CET 2021


From: Bastian Germann <bage at linutronix.de>

elbe get_archive fails because bytes are tried to be written to a str file
object. Fix that by opening the file in binary mode.

Signed-off-by: Bastian Germann <bage at linutronix.de>
---
 elbepack/commands/get_archive.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elbepack/commands/get_archive.py b/elbepack/commands/get_archive.py
index 7dd86ee78..438bb8c29 100644
--- a/elbepack/commands/get_archive.py
+++ b/elbepack/commands/get_archive.py
@@ -14,7 +14,7 @@ from elbepack.treeutils import etree
 
 
 def unbase(s, fname):
-    outfile = open(fname, "w")
+    outfile = open(fname, "w+b")
     outfile.write(standard_b64decode(s))
     outfile.close()
 
-- 
2.30.1



More information about the elbe-devel mailing list