From a641de826af46a105bd656ec2f2dd5539132997f Mon Sep 17 00:00:00 2001 From: Dan Voiculeasa Date: Thu, 5 Aug 2021 21:13:54 +0300 Subject: [PATCH] py3: Fix subprocess py3 compatibility Subprocess.Popen.communicate returns a string object on python2 and a bytes object on python3. Add universal_newlines=True parameter to keep backwards compatibility and to return a string object on python3 also. Story: 2008454 Task: 42930 Depends-On: Ie3921c4ae6211a8b0d290bdbdb195ce07036afbc Signed-off-by: Dan Voiculeasa Change-Id: I73f75dba4113af3022ad2277556c547b5afebe61 --- ceph/ceph/files/ceph-manage-journal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ceph/ceph/files/ceph-manage-journal.py b/ceph/ceph/files/ceph-manage-journal.py index 3215978fa..427e7cdab 100644 --- a/ceph/ceph/files/ceph-manage-journal.py +++ b/ceph/ceph/files/ceph-manage-journal.py @@ -25,6 +25,7 @@ def command(arguments, **kwargs): arguments, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True, **kwargs) out, err = process.communicate() return out, err, process.returncode