diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-04-04 22:12:17 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-04-04 22:12:17 +0100 |
commit | c36e3c622656de28fdb346a89ebbc29214b6cbda (patch) | |
tree | ad70fee3505487b0445e1f3db9f2d7d16102886f | |
parent | 65d8fb5d30682dffffab1daf06662dafb9e303f2 (diff) | |
download | sos-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.py | 2 |
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')} |