You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
Description
when accessing URLs(URIs) in 'XML Mode' via the 'Load Wizard', the Accept header is set to application/xml instead of either nothing (to allow passing a GET param like f=application%2Fgml%2Bxml) or directly application/gml+xml
this may cause issues when content negociation happens with the server.
The GML content is properly fetched from the URL/I and added to the QGIS Layer
Additional context
QGIS 'Network Logger' (F12) shows an Accept header set to application/xml
querying that URI in a application such as PostMan with Accept header set to application/xml leads to the following error => {"code": "NoApplicableCode", "description": "Could not find acceptable representation"}
querying that URI in a application such as PostMan with Accept header set to application/gml+xml allows to fetch the GML representation
Logs
AttributeError: 'NoneType' object has no attribute 'close'
Traceback (most recent call last):
File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\core\load_gml_as_xml.py", line 386, in load_complex_gml
src = ComplexFeatureSource(xml_src, attributes, geometry_mapping, logger)
File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\core\load_gml_as_xml.py", line 249, in __init__
doc, _ = xml_parse(xml)
File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\core\xml_utils.py", line 118, in xml_parse
for event, elem in ET.iterparse(xml_file, ["start-ns", "start", "end"]):
File "C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\xml\etree\ElementTree.py", line 1243, in iterparse
source = open(source, "rb")
TypeError: expected str, bytes or os.PathLike object, not NoneType
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\gui\load_wizard_xml.py", line 79, in validatePage
swap_xy=self.swapXYCheck.isChecked(),
File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\core\load_gml_as_xml.py", line 71, in load_as_xml_layer
xml_uri, is_remote, attributes, geometry_mapping, logger, swap_xy
File "C:/Users/grellets/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\gml_application_schema_toolbox\core\load_gml_as_xml.py", line 468, in load_complex_gml
xml_src.close()
AttributeError: 'NoneType' object has no attribute 'close'
The text was updated successfully, but these errors were encountered:
sgrellet
changed the title
XML Mode forcing Accept header to application/xml
Load Wizard in XML Mode forcing Accept header to application/xml
Mar 11, 2021
Environment
Description
To Reproduce
Steps to reproduce the behavior:
-> Python error
Stack trace below
Expected behavior
Additional context
Logs
The text was updated successfully, but these errors were encountered: