[QGIS-Developer] Cannot load WMS capabilities from WMS provider in QGIS3 from python

David Marteau dmarteau at 3liz.com
Tue Jan 16 00:18:53 PST 2018


Hi Alessandro

This is a weird bug, I have also found that once the first request failed, others requests succeed wathever the url or the provider is (tried with wcs and wms).
When failing, looking on what append wms server  side when we found that no request is sent.

I fill a ticket on this.


>> The point is: trying to instanciate  a  wmsprovider will issue a timeout when trying to request the capabilities: the code responsible for that creates its own QEventLoop and manage to do a blocking call (which is expected here). 
>> Please have a look at https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmscapabilities.cpp#L1964 <https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgswmscapabilities.cpp#L1964>.  What we do not understand is why, despite the call of loop.exec() in the c++ code, the request is not processed (my example with the  Q(gs)etworkAccessManager
>> shows that it should processed)
>> 
>> Actually you cannot instanciate properly a QgsProject with a WMS layer.
>> 
>> To convince yourself, try to instanciate a QgsProject in python (in a standalone python script) from a .qgs project having a single wms layer: it will fail to instanciate the layer.
>> 
> 
> 
> Hi David, 
> 
> I verified this issue, I'm sorry but I don't have an explanation right away and it looks like a bug, please file a ticket.
> 
> 
> -- 
> Alessandro Pasotti
> w3:   www.itopen.it <http://www.itopen.it/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180116/849f331e/attachment-0001.html>


More information about the QGIS-Developer mailing list