Skip to content

Commit c599dc4

Browse files
committed
Fix Linux UTF-8 decoding
1 parent 7d4c63e commit c599dc4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/shared.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,20 @@ def get_finished_process():
144144
# then look again if any process has completed.
145145
try:
146146
out, err = processes[0][1].communicate(0.2)
147-
return (0, out, err)
147+
return (0, out.decode('UTF-8'), err.decode('UTF-8'))
148148
except subprocess.TimeoutExpired:
149149
pass
150150

151151
j, out, err = get_finished_process()
152152
idx, finished_process = processes[j]
153153
del processes[j]
154154
if pipe_stdout:
155-
std_outs += [(idx, out.decode('UTF-8'))]
155+
std_outs += [(idx, out)]
156156
if check and finished_process.returncode != 0:
157157
if out:
158-
logger.info(out.decode('UTF-8'))
158+
logger.info(out)
159159
if err:
160-
logger.error(err.decode('UTF-8'))
160+
logger.error(err)
161161
raise Exception('Subprocess %d/%d failed with return code %d! (cmdline: %s)' % (idx + 1, len(commands), finished_process.returncode, shlex_join(commands[idx])))
162162
num_completed += 1
163163

0 commit comments

Comments
 (0)