Skip to content

Commit 86b6533

Browse files
committed
kbuild: Decode CIP fragment properly, not over str()
CIP configurations was not working, as they was not decoded properly, looking like `b:'content\notherline\n' instead of properly formatted kernel config. Decode() should fix that. Signed-off-by: Denys Fedoryshchenko <[email protected]>
1 parent cfc9b20 commit 86b6533

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kernelci/kbuild.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,11 @@ def _getcipfragment(self, fragment):
474474
buffer = self._download_file(url)
475475
if not buffer:
476476
raise FileNotFoundError("Error reading {}".format(url))
477-
return str(buffer)
477+
try:
478+
plain_str = buffer.decode('utf-8')
479+
except UnicodeDecodeError:
480+
raise ValueError("Error decoding {}".format(url))
481+
return plain_str
478482

479483
def _getcrosfragment(self, fragment):
480484
""" Get ChromeOS specific configuration fragments """

0 commit comments

Comments
 (0)