Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed May 10, 2021
1 parent c1c2dfe commit b0d8367
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions owslib/catalogue/csw2.py
Expand Up @@ -334,7 +334,7 @@ def getrecords2(self, constraints=[], sortby=None, typenames='csw:Record', esn='
"""

if xml is not None:
if str(xml).startswith('<'):
if xml.startswith(b'<'):
self.request = etree.fromstring(xml)
val = self.request.find(util.nspath_eval('csw:Query/csw:ElementSetName', namespaces))
if val is not None:
Expand Down Expand Up @@ -680,7 +680,7 @@ def _invoke(self):
self.request, None, 'Get', timeout=self.timeout, auth=self.auth
).read()
else:
self.request = cleanup_namespaces(etree.fromstring(self.request))
self.request = cleanup_namespaces(self.request)
# Add any namespaces used in the "typeNames" attribute of the
# csw:Query element to the query's xml namespaces.
for query in self.request.findall(util.nspath_eval('csw:Query', namespaces)):
Expand Down
4 changes: 2 additions & 2 deletions owslib/catalogue/csw3.py
Expand Up @@ -222,7 +222,7 @@ def getrecords(self, constraints=[], sortby=None, typenames='csw30:Record', esn=
"""

if xml is not None:
if str(xml).startswith('<'):
if xml.startswith(b'<'):
self.request = etree.fromstring(xml)
val = self.request.find(util.nspath_eval('csw30:Query/csw30:ElementSetName', namespaces))
if val is not None:
Expand Down Expand Up @@ -571,7 +571,7 @@ def _invoke(self):
self.request, None, 'Get', timeout=self.timeout, auth=self.auth, headers={'Accept': outputformat}
).read()
else:
self.request = cleanup_namespaces(etree.fromstring(self.request))
self.request = cleanup_namespaces(self.request)
# Add any namespaces used in the "typeNames" attribute of the
# csw30:Query element to the query's xml namespaces.
for query in self.request.findall(util.nspath_eval('csw30:Query', namespaces)):
Expand Down

0 comments on commit b0d8367

Please sign in to comment.