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/patchstream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/patman/patchstream.py') diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index ef066062979..df3eb7483bb 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -511,8 +511,8 @@ def FixPatch(backup_dir, fname, series, commit): A list of errors, or [] if all ok. """ handle, tmpname = tempfile.mkstemp() - outfd = os.fdopen(handle, 'w') - infd = open(fname, 'r') + outfd = os.fdopen(handle, 'w', encoding='utf-8') + infd = open(fname, 'r', encoding='utf-8') ps = PatchStream(series) ps.commit = commit ps.ProcessStream(infd, outfd) -- cgit v1.2.3