提交 742ae3b4 编写于 作者: T tianxin 提交者: pkpk

set encoding=utf8 for open (#3398)

* set encoding=utf8 for open

* set encoding=utf8 for open
上级 85110108
...@@ -228,7 +228,7 @@ class ClassifyReader(BaseReader): ...@@ -228,7 +228,7 @@ class ClassifyReader(BaseReader):
def _read_tsv(self, input_file, quotechar=None): def _read_tsv(self, input_file, quotechar=None):
"""Reads a tab separated value file.""" """Reads a tab separated value file."""
with open(input_file, "r") as f: with open(input_file, "r", encoding="utf8") as f:
reader = csv.reader(f, delimiter="\t", quotechar=quotechar) reader = csv.reader(f, delimiter="\t", quotechar=quotechar)
headers = next(reader) headers = next(reader)
text_indices = [ text_indices = [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册