提交 44c62c2f 编写于 作者: K Kentaro Wada

Use codecs.open(encoding='utf-8') to support CJK label list file

上级 f61de735
import argparse
import codecs
import functools
import os.path
import re
......@@ -1231,8 +1232,8 @@ def main():
sys.exit(1)
else:
if os.path.isfile(args.labels):
args.labels = [l.strip() for l in open(args.labels, 'r')
if l.strip()]
with codecs.open(args.labels, 'r', encoding='utf-8') as f:
args.labels = [l.strip() for l in f if l.strip()]
else:
args.labels = [l for l in args.labels.split(',') if l]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册