buildroot: don't specify encoding for popen
Since low-level primitives (os.read) are used to read from the stdout pipe, manual text decoding was necessary there anyway. The `encoding` argument meant that we could forgo the manual decoding for the call to `communicate`. But this meant that text handling is not uniform. Therefore, remove the `encoding` argument from the `Popen` call and manual decode all the text.
This commit is contained in:
parent
13e629ba72
commit
7f50d2b57f
1 changed files with 2 additions and 2 deletions
|
|
@ -235,7 +235,6 @@ class BuildRoot(contextlib.AbstractContextManager):
|
|||
stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
encoding="utf-8",
|
||||
close_fds=True)
|
||||
|
||||
data = io.StringIO()
|
||||
|
|
@ -250,7 +249,8 @@ class BuildRoot(contextlib.AbstractContextManager):
|
|||
data.write(txt)
|
||||
monitor.log(txt)
|
||||
|
||||
txt, _ = proc.communicate()
|
||||
buf, _ = proc.communicate()
|
||||
txt = buf.decode("utf-8")
|
||||
monitor.log(txt)
|
||||
data.write(txt)
|
||||
output = data.getvalue()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue