From 9744003b6d22fc3d45338954d2637e265051b146 Mon Sep 17 00:00:00 2001 From: yashlamba Date: Wed, 11 Oct 2023 10:18:51 +0200 Subject: [PATCH] oai: marcxml: string encoding bug --- invenio_rdm_records/oai.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invenio_rdm_records/oai.py b/invenio_rdm_records/oai.py index a1c3c1391..c1632c7b6 100644 --- a/invenio_rdm_records/oai.py +++ b/invenio_rdm_records/oai.py @@ -42,7 +42,9 @@ def marcxml_etree(pid, record): # TODO: MARCXMLSerializer should directly be able to dump an etree instead # of internally creating an etree, then dump to xml, then parse into an # etree. See https://github.com/inveniosoftware/flask-resources/issues/117 - return etree.fromstring(MARCXMLSerializer().serialize_object(item.to_dict())) + return etree.fromstring( + MARCXMLSerializer().serialize_object(item.to_dict()).encode(encoding="utf-8") + ) def dcat_etree(pid, record):