[elbe-devel] [PATCH 02/25] soapclient: open files in binary mode

Torben Hohn torben.hohn at linutronix.de
Tue Dec 5 17:31:33 CET 2017


On Fri, Dec 01, 2017 at 04:50:59PM +0100, Manuel Traut wrote:
> binascii.bs2a_base64 expects binary data
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>

Reviewed-by: Torben Hohn <torbenh 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
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Mit freundlichen Grüßen
Torben Hohn

Linutronix GmbH

Standort: Bremen

Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Firmensitz / Registered Office: D-88690 Uhldingen, Bahnhofstr. 3
Registergericht / Local District Court: Amtsgericht Freiburg i. Br.; HRB
Nr. / Trade register no.: 700 806

Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner

Eine Bitte von uns: Sollten Sie diese E-Mail irrtümlich erhalten haben,
benachrichtigen Sie uns in diesem Falle bitte sobald wie es Ihnen
möglich ist, durch Antwort-Mail. Vielen Dank!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20171205/14ca0a4f/attachment-0001.sig>


More information about the elbe-devel mailing list