mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-10-01 06:21:56 -09:00
utils/getdeveloperlib.py: fix check_output() return value decoding
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@bootlin.com>
(cherry picked from commit 53da6a7c05)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
ea1d65f9da
commit
a7d33fb53d
@@ -278,7 +278,7 @@ def check_developers(developers, basepath=None):
|
|||||||
if basepath is None:
|
if basepath is None:
|
||||||
basepath = os.getcwd()
|
basepath = os.getcwd()
|
||||||
cmd = ["git", "--git-dir", os.path.join(basepath, ".git"), "ls-files"]
|
cmd = ["git", "--git-dir", os.path.join(basepath, ".git"), "ls-files"]
|
||||||
files = subprocess.check_output(cmd).strip().split("\n")
|
files = subprocess.check_output(cmd).decode(sys.stdout.encoding).strip().split("\n")
|
||||||
unhandled_files = []
|
unhandled_files = []
|
||||||
for f in files:
|
for f in files:
|
||||||
handled = False
|
handled = False
|
||||||
|
|||||||
Reference in New Issue
Block a user