diff options
author | Chris Johns <chrisj@rtems.org> | 2022-09-29 20:57:56 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2022-09-30 07:05:53 +1000 |
commit | d7fb57fa9fae3071793a57d92ff8e0f4adb8b819 (patch) | |
tree | 133f5183f7d7f30d4fe21de3a5907d0e83bfa87e /source-builder | |
parent | sb/set-builder: Fix staging and tar file generation with a single config build (diff) | |
download | rtems-source-builder-d7fb57fa9fae3071793a57d92ff8e0f4adb8b819.tar.bz2 |
sb/execute: Use a decoder that maintains state aross blocks
Update #4726
Diffstat (limited to 'source-builder')
-rwxr-xr-x | source-builder/sb/execute.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source-builder/sb/execute.py b/source-builder/sb/execute.py index 3db9abc..bdab373 100755 --- a/source-builder/sb/execute.py +++ b/source-builder/sb/execute.py @@ -27,6 +27,7 @@ from __future__ import print_function import functools +import codecs import io import os import re @@ -181,6 +182,7 @@ class execute(object): if trace_threads: print('execute:_readthread: start') + decoder = codecs.getincrementaldecoder(sys.stdout.encoding)() count = 0 line = '' try: @@ -201,7 +203,7 @@ class execute(object): break # str and bytes are the same type in Python2 if type(data) is not str and type(data) is bytes: - data = data.decode(sys.stdout.encoding) + data = decoder.decode(data) last_ch = data[-1] sd = (line + data).split('\n') if last_ch != '\n': |