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
1 changed files with 1 additions and 0 deletions

View File

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