]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: open kconfig fragment in binary mode
authorStephano Cetola <stephano.cetola@linux.intel.com>
Mon, 27 Mar 2017 17:01:36 +0000 (10:01 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Mar 2017 07:41:08 +0000 (08:41 +0100)
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]

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/standard.py

index 07c1400388b3f4a2d4d3d45f1a6de6b5b58173b5..ffca2c9ec47e0644a8dce9dae65208ece3628efc 100644 (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)