From e81833c631cbcf1fb3ebe18aae00594ef19638a6 Mon Sep 17 00:00:00 2001 From: huberrob Date: Tue, 19 Mar 2024 17:13:58 +0100 Subject: [PATCH] fixed deprecated lxml.etree.XPathElementEvaluator evaluate call --- fuji_server/helper/metadata_provider_oai.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fuji_server/helper/metadata_provider_oai.py b/fuji_server/helper/metadata_provider_oai.py index 72cca687..e1528b54 100644 --- a/fuji_server/helper/metadata_provider_oai.py +++ b/fuji_server/helper/metadata_provider_oai.py @@ -61,7 +61,7 @@ def getMetadataStandards(self): namespaces=OAIMetadataProvider.oai_namespaces, ) for node in metadata_nodes: - ele = etree.XPathEvaluator(node, namespaces=OAIMetadataProvider.oai_namespaces).evaluate + ele = etree.XPathEvaluator(node, namespaces=OAIMetadataProvider.oai_namespaces) # .evaluate metadata_prefix = ele( "string(oai:metadataPrefix/text())" ) # oai_dc @@ -79,8 +79,11 @@ def getMetadataStandards(self): self.metric_id, metadata_prefix ) ) - except: - self.logger.info(f"{self.metric_id} : Could not parse XML response retrieved from OAI-PMH endpoint") + except Exception as e: + self.logger.info( + f"{self.metric_id} : Could not parse XML response retrieved from OAI-PMH endpoint: " + str(e) + ) + print("OAI-PMH Parsing Error: ", e) return schemas