From 7e757b19a4f88ec2639008bfffbe50894674d28d Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Thu, 28 Oct 2021 15:10:30 +0200 Subject: tasks: fix write encoding --- python/refcat/tasks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 7cf346b..086dbc4 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -1571,8 +1571,11 @@ class UnmatchedRefsReparse(Refcat): citations = grobid_tei_xml.parse_citations_xml(grobid_resp.text) if len(citations) == 0: continue - json.dump(citations[0].to_dict(), output) - output.write("\n") + # self.logger.debug("[parsing] {} sent, {} from grobid, for {}, {}".format( + # len(unstructured), len(grobid_resp.text), unstructured, citations)) + data = json.dumps(citations[0].to_dict()) + output.write(data.encode("utf-8")) + output.write(b"\n") def output(self): -- cgit v1.2.3