aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2014-04-04 22:12:17 +0100
committerBryn M. Reeves <bmr@redhat.com>2014-04-04 22:12:17 +0100
commitc36e3c622656de28fdb346a89ebbc29214b6cbda (patch)
treead70fee3505487b0445e1f3db9f2d7d16102886f
parent65d8fb5d30682dffffab1daf06662dafb9e303f2 (diff)
downloadsos-c36e3c622656de28fdb346a89ebbc29214b6cbda.tar.gz
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 <bmr@redhat.com>
-rw-r--r--sos/utilities.py2
1 files changed, 1 insertions, 1 deletions
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')}