[Qgis-user] QgsBlockingNetworkRequest causes SIGSEGV

Andrea Giudiceandrea andreaerdna at libero.it
Thu May 27 06:44:23 PDT 2021


Frank Broniewski-6 wrote
> 1) open a Python3 shell
> 2) >>> import qgis
>>>> from qgis.core import QgsBlockingNetworkRequest as bnr
>>>> r = bnr()
> fish: Job 1, 'python' terminated by signal SIGSEGV (Adressbereichsfehler)
> 
> I did look at the unittest Testcases  [1] for the class, e.g the 
> testFetchEmptyUrl class method and do not see anything that I could have 
> changed to avoid the SIGSEGV.

Hi Frank,
AFAIK you need to first initialise an instance of QgsApplication.

In fact, if you look at the the test_qgsblockingnetworkrequest.py, it begins
with app = start_app()
start_app (and stop_app) is defined in qgis.testing.

So you could try

import qgis
from qgis.core import QgsApplication
from qgis.core import QgsBlockingNetworkRequest as bnr

qgs = QgsApplication([], False)
qgs.initQgis()

r = bnr()

Does it crash?

Best regards.

Andrea



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html


More information about the Qgis-user mailing list