aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/utils.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/utils.py b/scripts/utils.py
index f6a4720..ac7f6a3 100644
--- a/scripts/utils.py
+++ b/scripts/utils.py
@@ -79,12 +79,16 @@ def callsubprocess(process_name, process, show_output = True,
f.write('::' + time.strftime("%y-%m-%d-%H-%M-%S-%f") + '::\n')
for linen in sprc.stdout:
timerout.output()
- line = linen.decode(sys.getdefaultencoding())
- f.write(line)
- if show_output:
- print(line, end="")
- if return_output:
- rtn.append(line.rstrip())
+ try:
+ line = linen.decode(sys.getdefaultencoding())
+ f.write(line)
+ if show_output:
+ print(line, end="")
+ if return_output:
+ rtn.append(line.rstrip())
+ except UnicodeDecodeError:
+ if return_output:
+ rtn.append('DecodeError')
if timerout.exit():
raise exceptions.ProcessTimeout(process_name, rtn)
rtncode = sprc.wait()