cros_gdb: Specify utf-8 output encoding.
This resolves the error:
TypeError: a bytes-like object is required, not 'str'
BUG=None
TEST=manual test
Change-Id: Idfa2ddde6279ca7332f3a1d836de5c35cb87d608
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2073119
Commit-Queue: Allen Webb <allenwebb@google.com>
Tested-by: Allen Webb <allenwebb@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/cros_gdb.py b/scripts/cros_gdb.py
index 32e3275..81f8c29 100644
--- a/scripts/cros_gdb.py
+++ b/scripts/cros_gdb.py
@@ -227,7 +227,8 @@
# the debug info.
if sysroot_inf_cmd:
stripped_info = cros_build_lib.run(['file', sysroot_inf_cmd],
- capture_output=True).output
+ capture_output=True,
+ encoding='utf-8').stdout
if ' not stripped' not in stripped_info:
debug_file = os.path.join(self.sysroot, 'usr/lib/debug',
self.inf_cmd.lstrip('/'))
@@ -235,7 +236,8 @@
if not os.path.exists(debug_file):
equery = 'equery-%s' % self.board
package = cros_build_lib.run([equery, '-q', 'b', self.inf_cmd],
- capture_output=True).output
+ capture_output=True,
+ encoding='utf-8').stdout
# pylint: disable=logging-not-lazy
logging.info(self._MISSING_DEBUG_INFO_MSG % {
'board': self.board,