Address python3 string issues with subprocess

This patch updates our Popen call to enable
newlines for calls that we parse or consume the output for.
Without universal_newlines=True, the output is treated as bytes
under python3 which leads to issues later where we are using it as
strings.

See https://docs.python.org/3/glossary.html#term-universal-newlines

Story: 2006796
Task: 42696

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I9b93907c05486b1f76aebe181af812c243285d6a
This commit is contained in:
Charles Short 2021-06-25 11:57:03 -04:00
parent 8e84309624
commit 3cec8b6ac9

View File

@ -25,6 +25,7 @@ def command(arguments, **kwargs):
arguments, arguments,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True,
**kwargs) **kwargs)
out, err = process.communicate() out, err = process.communicate()
return out, err, process.returncode return out, err, process.returncode