patman: Provide a way to get program output in binary mode
authorSimon Glass <sjg@chromium.org>
Tue, 14 May 2019 21:53:44 +0000 (15:53 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 10 Jul 2019 22:52:57 +0000 (16:52 -0600)
commita92939a4aa65700c3cdfa230fa986d40c508c5e6
treea45fd979c1c7809fa4ced00e4870cf0bf1a29df5
parent3e4b51e8d6dc86c0ea80552a1d2e19756b19e4a1
patman: Provide a way to get program output in binary mode

At present cros_subprocess and the tools library use a string to obtain
stdout from a program. This works fine on Python 2. With Python 3 we end
up with unicode errors in some cases. Fix this by providing a binary mode,
which returns the data as bytes() instead of a string.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/patman/cros_subprocess.py
tools/patman/tools.py