summaryrefslogtreecommitdiff
path: root/tools/patman/settings.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-10-31 07:42:51 -0600
committerSimon Glass <sjg@chromium.org>2019-11-04 18:15:32 -0700
commit272cd85deb714a9c9c1c30cb900c70a157dfa2e1 (patch)
tree098b089612396dae0135877542b65495b8116eba /tools/patman/settings.py
parent3b3e3c0f6c261a8c9f989d437dc261ba84467d4f (diff)
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 <sjg@chromium.org>
Diffstat (limited to 'tools/patman/settings.py')
-rw-r--r--tools/patman/settings.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index c98911d522..5dc83a8500 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -165,7 +165,7 @@ def ReadGitAliases(fname):
fname: Filename to read
"""
try:
- fd = open(fname, 'r')
+ fd = open(fname, 'r', encoding='utf-8')
except IOError:
print("Warning: Cannot find alias file '%s'" % fname)
return
@@ -259,7 +259,7 @@ def _ReadAliasFile(fname):
"""
if os.path.exists(fname):
bad_line = None
- with open(fname) as fd:
+ with open(fname, encoding='utf-8') as fd:
linenum = 0
for line in fd:
linenum += 1