OWSLib is a Python package for client programming with Open Geospatial Consortium (OGC) web service (hence OWS) interface standards, and their related content models.
If using 0.13.0, 0.14.0, all the things goes fine.
when using 0.15.0, 0.16.0, got the following error:
File "/home/bk/vpy_rre/lib/python3.5/site-packages/owslib/csw.py", line 376, in getrecords2
self._invoke()
File "/home/bk/vpy_rre/lib/python3.5/site-packages/owslib/csw.py", line 680, in _invoke
self._exml = etree.parse(BytesIO(self.response))
File "src/lxml/etree.pyx", line 3426, in lxml.etree.parse
File "src/lxml/parser.pxi", line 1856, in lxml.etree._parseDocument
File "src/lxml/parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
File "src/lxml/parser.pxi", line 1764, in lxml.etree._parseDoc
File "src/lxml/parser.pxi", line 1126, in lxml.etree._BaseParser._parseDoc
File "src/lxml/parser.pxi", line 600, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 710, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 639, in lxml.etree._raiseParseError
File "<string>", line 6
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: hr line 5 and body, line 6, column 8
I add following lines at line 680 in csw.py (owslib 0.16.0).
# parse result see if it's XML
print('x' * 40)
print(self.response)
self._exml = etree.parse(BytesIO(self.response))
When running my programe, got( yes, It seems running twice by one accessing):
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
b'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<!-- pycsw 2.3.dev0 -->\n ... ... ... ...</csw:Capabilities>'
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
b'<html>\r\n<head><title>404 Not Found</title></head>\r\n<body bgcolor="white">\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.10.3</center>\r\n</body>\r\n</html>\r\n'
However, in oswlib 0.14.0, it would be( also running twice):
First, I have build the pycsw server. Second, I write programe using oswlib to access pycsw server from another computer. The codes just as following:
If using 0.13.0, 0.14.0, all the things goes fine. when using 0.15.0, 0.16.0, got the following error:
I add following lines at line 680 in csw.py (owslib 0.16.0).
When running my programe, got( yes, It seems running twice by one accessing):
However, in oswlib 0.14.0, it would be( also running twice):