]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ptl-tool: open githubmap with utf-8 code 20288/head
authorPatrick Donnelly <pdonnell@redhat.com>
Sat, 3 Feb 2018 21:35:22 +0000 (13:35 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Sat, 3 Feb 2018 21:38:37 +0000 (13:38 -0800)
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 <pdonnell@redhat.com>
src/script/ptl-tool.py

index 6ccbc4ee2c633589e4182513c2fcbb26ab17cdb7..6c92bfae428f8fdb492b54b9d8336b0f0fb89d7d 100755 (executable)
 # 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: