Open paknorton opened 9 years ago
@paknorton when I try:
gml = etree.fromstring(feature)
this works as expected. etree.parse
expects a filepath.
So with 0.9.0 you should use etree.fromstring() for file handles and etree.parse() for filepaths?
@paknorton I think it's always been like this. See:
Now, it looks like OWSLib 0.8.13 was returning a StringIO
(file-like) object, where as now it returns owslib.util.ResponseWrapper
. I think this is rooted in https://github.com/geopython/OWSLib/commit/1ce3402f2520442126d540e640f2a23d9df70b14
@daf any idea/comments?
I've been working through a problem in pyGDP where scripts that used to work mysteriously started crashing. After digging further into the problem I narrowed it down to a problem with the current owslib library (0.9.0). I am using an Anaconda python-2.7 environment with the following library versions. lxml 3.4.4 libxml2 2.9.2 libxslt 1.1.28 owslib 0.9.0 pyGDP 1.3.3
The sample code below always results in the following error in from the xml parser:
TypeError: read() takes exactly 1 argument (2 given)
I should note that an error in etree.py with the import of the xml parser initially resulted in the lxml parser never being loaded. In etree.py at about line 36 the import looked like this: try: from lxml import etree, ParseError ....
I had to change it to the following to get lxml to load:
<>
Regardless, both xml and lxml parsers returned the same error. I downgraded owslib to 0.8.13 and the problem went away. I haven't had a chance to do a diff between to the two versions so I'm not sure what the exact problem is but I thought I would bring it to your attention. Let me know if you need further information.