diff options
author | Stephano Cetola <stephano.cetola@linux.intel.com> | 2017-03-27 10:01:36 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-28 08:43:12 +0100 |
commit | 243693be544b1e2e72317af3c5884f655953f153 (patch) | |
tree | c2e7717a39e0ac90776934ac871998dfbd3c9083 | |
parent | 020e35cfd9ba76d43fe581abd2ef835f90700718 (diff) | |
download | poky-243693be544b1e2e72317af3c5884f655953f153.tar.gz |
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>
-rw-r--r-- | scripts/lib/devtool/standard.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 07c1400388..ffca2c9ec4 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -1223,7 +1223,7 @@ def _create_kconfig_diff(srctree, rd, outfile): | |||
1223 | stdout, stderr = pipe.communicate() | 1223 | stdout, stderr = pipe.communicate() |
1224 | if pipe.returncode == 1: | 1224 | if pipe.returncode == 1: |
1225 | logger.info("Updating config fragment %s" % outfile) | 1225 | logger.info("Updating config fragment %s" % outfile) |
1226 | with open(outfile, 'w') as fobj: | 1226 | with open(outfile, 'wb') as fobj: |
1227 | fobj.write(stdout) | 1227 | fobj.write(stdout) |
1228 | elif pipe.returncode == 0: | 1228 | elif pipe.returncode == 0: |
1229 | logger.info("Would remove config fragment %s" % outfile) | 1229 | logger.info("Would remove config fragment %s" % outfile) |