From c36e3c622656de28fdb346a89ebbc29214b6cbda Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Fri, 4 Apr 2014 22:12:17 +0100 Subject: Use six.binary_type to produce a .decode()able string Python3 strings do not have a .decode() method. When clearing output for command-not-found case use binary_type("") instead of the empty string. This gives a bytestring on python3 which does support the decode() method. Signed-off-by: Bryn M. Reeves --- sos/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sos/utilities.py b/sos/utilities.py index fae424ad..1db23b63 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -145,7 +145,7 @@ def sos_get_command_output(command, timeout=300): # Required hack while we still pass shell=True to Popen; a Popen # call with shell=False for a non-existant binary will raise OSError. if p.returncode == 127: - stdout = "" + stdout = six.binary_type("") return {'status': p.returncode, 'output': stdout.decode('utf-8')} -- cgit