From: Alfredo Deza Date: Fri, 20 Jul 2018 13:48:38 +0000 (-0400) Subject: ceph-volume process encode stdin with utf-8 to prevent bytes TypeError X-Git-Tag: v13.2.2~123^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4a665bc84db3748e1df52fa79612836c5e60d581;p=ceph.git ceph-volume process encode stdin with utf-8 to prevent bytes TypeError Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/process.py b/src/ceph-volume/ceph_volume/process.py index 872bd093041..2c8467fc4c0 100644 --- a/src/ceph-volume/ceph_volume/process.py +++ b/src/ceph-volume/ceph_volume/process.py @@ -196,8 +196,11 @@ def call(command, **kw): close_fds=True, **kw ) + if stdin: - stdout_stream, stderr_stream = process.communicate(stdin) + stdout_stream, stderr_stream = process.communicate( + stdin.encode(encoding='utf-8', errors='ignore') + ) else: stdout_stream = process.stdout.read() stderr_stream = process.stderr.read()