From c49ce3c722c35324803e40efb88b1a3057c7f249 Mon Sep 17 00:00:00 2001 From: Jie Yang Date: Thu, 11 Apr 2019 15:40:19 -0400 Subject: [PATCH] fix tsv read error in Windows --- examples/run_classifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/run_classifier.py b/examples/run_classifier.py index 751d581ad9..4268c41ec6 100644 --- a/examples/run_classifier.py +++ b/examples/run_classifier.py @@ -95,7 +95,7 @@ class DataProcessor(object): @classmethod def _read_tsv(cls, input_file, quotechar=None): """Reads a tab separated value file.""" - with open(input_file, "r") as f: + with open(input_file, "r", encoding="utf-8") as f: reader = csv.reader(f, delimiter="\t", quotechar=quotechar) lines = [] for line in reader: