When writing output to stdout we want to ensure that the data is a string not bytes. Under py2 the salt.utils.data.encode function results in a string but under py3 the result is a bytestring. Swapping out salt.utils.data.encode for salt.utils.stringutils.to_str.

This commit is contained in:
Gareth J. Greenaway 2019-01-04 10:57:21 -08:00 committed by Ch3LL
parent dda1ebbabc
commit ffdae27877
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -686,7 +686,7 @@ class Terminal(object):
stdout = None
else:
if self.stream_stdout:
self.stream_stdout.write(salt.utils.data.encode(stdout))
self.stream_stdout.write(salt.utils.stringutils.to_str(stdout))
self.stream_stdout.flush()
if self.stdout_logger: