From: Patrick Donnelly Date: Sat, 3 Feb 2018 21:35:22 +0000 (-0800) Subject: ptl-tool: open githubmap with utf-8 code X-Git-Tag: v13.0.2~334^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9a843c518a6622b6b973dbcaa5e92f875a2d29d2;p=ceph.git 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 --- 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: