aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-10-28 15:10:30 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-10-28 15:10:30 +0200
commit7e757b19a4f88ec2639008bfffbe50894674d28d (patch)
tree7b8d8bd7c486dfc1278dcc2a175ca6588f308722
parentd65fdd7c6bb7be78d0eca4ba23771f3fca3282d3 (diff)
downloadrefcat-7e757b19a4f88ec2639008bfffbe50894674d28d.tar.gz
refcat-7e757b19a4f88ec2639008bfffbe50894674d28d.zip
tasks: fix write encoding
-rw-r--r--python/refcat/tasks.py7
1 files 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):