From d08f3882a35eec8a042d2501715684444e353605 Mon Sep 17 00:00:00 2001 From: Olaf Mandel Date: Mon, 17 Oct 2016 08:16:27 +0000 Subject: 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 --- scripts/combo-layer | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/combo-layer b/scripts/combo-layer index b90bfc8800..4a210fba63 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 <