From 9a843c518a6622b6b973dbcaa5e92f875a2d29d2 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Sat, 3 Feb 2018 13:35:22 -0800 Subject: [PATCH] ptl-tool: open githubmap with utf-8 code This resolves a decode error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 8: ordinal not in range(128) Signed-off-by: Patrick Donnelly --- src/script/ptl-tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/script/ptl-tool.py b/src/script/ptl-tool.py index 6ccbc4ee2c633..6c92bfae428f8 100755 --- a/src/script/ptl-tool.py +++ b/src/script/ptl-tool.py @@ -102,6 +102,7 @@ # redmine issue update: http://www.redmine.org/projects/redmine/wiki/Rest_Issues import argparse +import codecs import datetime import getpass import git @@ -139,7 +140,7 @@ INDICATIONS = [ CONTRIBUTORS = {} NEW_CONTRIBUTORS = {} -with open(".githubmap") as f: +with codecs.open(".githubmap", encoding='utf-8') as f: comment = re.compile("\s*#") patt = re.compile("([\w-]+)\s+(.*)") for line in f: -- 2.39.5