1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

devtool: open kconfig fragment in binary mode

When devtool writes to the kconfig fragment, it writes the output of
the diff command returned from pipe.communicate(). This function
returns binary objects. We should open the kconfig fragment file in
binary mode if we expect to write binary objects to it.

[YOCTO #11171]

(From OE-Core rev: 72bec63ab0e78753fb6ed1794d11beef9485c014)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Stephano Cetola
2017-03-27 10:01:36 -07:00
committed by Richard Purdie
parent 020e35cfd9
commit 243693be54
+1 -1
View File
@@ -1223,7 +1223,7 @@ def _create_kconfig_diff(srctree, rd, outfile):
stdout, stderr = pipe.communicate()
if pipe.returncode == 1:
logger.info("Updating config fragment %s" % outfile)
with open(outfile, 'w') as fobj:
with open(outfile, 'wb') as fobj:
fobj.write(stdout)
elif pipe.returncode == 0:
logger.info("Would remove config fragment %s" % outfile)