[Buildroot] [PATCH 1/2] utils/getdeveloperlib.py: fix check_output() return value decoding

Peter Korsgaard peter at korsgaard.com
Wed Nov 3 21:15:42 UTC 2021


>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni at bootlin.com> writes:

 > In Python 3.x, check_output() returns a "bytes" array, and not a
 > string. Its result needs to be decoded to be turned into a
 > string. Without this fix, "get-developers -c" bails out with:

 > Traceback (most recent call last):
 >   File "/home/thomas/projets/buildroot/./utils/get-developers", line 105, in <module>
 >     __main__()
 >   File "/home/thomas/projets/buildroot/./utils/get-developers", line 53, in __main__
 >     files = getdeveloperlib.check_developers(devs)
 >   File "/home/thomas/projets/buildroot/utils/getdeveloperlib.py", line 280, in check_developers
 >     files = subprocess.check_output(cmd).strip().split("\n")
 > TypeError: a bytes-like object is required, not 'str'

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>

Alternatively we could use universal_newlines=True, but Ok - Committed
to 2021.02.x and 2021.08.x, thanks.

-- 
Bye, Peter Korsgaard


More information about the buildroot mailing list