From 272cd85deb714a9c9c1c30cb900c70a157dfa2e1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 31 Oct 2019 07:42:51 -0600 Subject: patman: Use unicode for file I/O At present patman test fail in some environments which don't use utf-8 as the default file encoding. Add this explicitly. Signed-off-by: Simon Glass --- tools/patman/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/patman/test.py') diff --git a/tools/patman/test.py b/tools/patman/test.py index cc61c20606e..889e186606e 100644 --- a/tools/patman/test.py +++ b/tools/patman/test.py @@ -72,12 +72,12 @@ Signed-off-by: Simon Glass ''' out = '' inhandle, inname = tempfile.mkstemp() - infd = os.fdopen(inhandle, 'w') + infd = os.fdopen(inhandle, 'w', encoding='utf-8') infd.write(data) infd.close() exphandle, expname = tempfile.mkstemp() - expfd = os.fdopen(exphandle, 'w') + expfd = os.fdopen(exphandle, 'w', encoding='utf-8') expfd.write(expected) expfd.close() -- cgit v1.2.3