Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in util.py/testXMLValue, val.text.strip() throws an error on empty Element #44

Closed
ochriste opened this issue Dec 7, 2012 · 1 comment
Assignees
Milestone

Comments

@ochriste
Copy link
Contributor

ochriste commented Dec 7, 2012

for example,
< Abstract />

Traceback (most recent call last):
File "/home/admin/morges/buildout/eggs/c2cgeoportal-1.2-py2.6.egg/c2cgeoportal/views/entry.py", line 37, in _wms_getcap
wms = WebMapService(url, version='1.1.1')
File "/home/admin/morges/OWSLib/owslib/wms.py", line 86, in init
self._buildMetadata(parse_remote_metadata)
File "/home/admin/morges/OWSLib/owslib/wms.py", line 126, in _buildMetadata
gather_layers(caps, None)
File "/home/admin/morges/OWSLib/owslib/wms.py", line 120, in gather_layers
cm = ContentMetadata(elem, parent=parent_metadata, index=index+1, parse_remote_metadata=parse_remote_metadata)
File "/home/admin/morges/OWSLib/owslib/wms.py", line 489, in init
self.layers.append(ContentMetadata(child, self))
File "/home/admin/morges/OWSLib/owslib/wms.py", line 340, in init
self.abstract = testXMLValue(elem.find('Abstract'))
File "/home/admin/morges/OWSLib/owslib/util.py", line 148, in testXMLValue
return val.text.strip()
[Fri Dec 07 12:18:50 2012] [error] AttributeError: 'NoneType' object has no attribute 'strip'

@tomkralidis
Copy link
Member

Thanks @ochriste

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants