OWSLib
OWSLib copied to clipboard
WFS Service: error in get_schema if _get_remote_describefeaturetype returns exception XML
This should never happen where a layer is listed as existing in GetCapabilities, but has an error response when DescribeFeatureType is requested. Still, some servers can be mis-configured, and this can cause a crash in _get_schema at line 55 in schema.py:
type_element = root.find("./{%s}element" % XS_NAMESPACE)
complex_type = type_element.attrib["type"].split(":")[1]
The fix is to test for None:
type_element = root.find("./{%s}element" % XS_NAMESPACE)
if type_element is None:
return None
complex_type = type_element.attrib["type"].split(":")[1]