From: Olaf Mandel Date: Mon, 17 Oct 2016 08:16:27 +0000 (+0000) Subject: combo-layer: fix crashes on wrong tempfile usage X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~23836 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d08f3882a35eec8a042d2501715684444e353605;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git combo-layer: fix crashes on wrong tempfile usage When calling tempfile.NamedTemporaryFile().write(str()), at least on Python 3.4.2 this fails with this error: TypeError: 'str' does not support the buffer interface Change the file-mode for all such files from binary to text mode. Signed-off-by: Olaf Mandel Signed-off-by: Ross Burton --- diff --git a/scripts/combo-layer b/scripts/combo-layer index b90bfc8800e..4a210fba634 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer @@ -329,7 +329,7 @@ def action_init(conf, args): # one. The commit should be in both repos with # the same tree, but better check here. tree = runcmd('git show -s --pretty=format:%%T %s' % rev).strip() - with tempfile.NamedTemporaryFile() as editor: + with tempfile.NamedTemporaryFile(mode='wt') as editor: editor.write('''cat >$1 <