[QGIS-Developer] writeAsVectorFormatV2 fails in loop
Bourdon, Jean-François (DIF)
Jean-Francois.Bourdon at mffp.gouv.qc.ca
Mon Aug 3 09:57:36 PDT 2020
Update. Using the deprecated QgsVectorFileWriter.writeAsVectorFormat() instead of QgsVectorFileWriter.writeAsVectorFormatV2() solves the issue. So I suppose there is a bug somewhere in the new implementation.
Jean-François Bourdon, ing.f.
Analyste en télédétection
Direction des inventaires forestiers
Ministère des Forêts, de la Faune et des Parcs
5700, 4e Avenue Ouest, local A-108
Québec (Québec) G1H 6R1
Téléphone : 418 627-8669, poste 4304
jean-francois.bourdon at mffp.gouv.qc.ca
mffp.gouv.qc.ca<http://www.mffp.gouv.qc.ca/accueil.jsp>
De : QGIS-Developer [mailto:qgis-developer-bounces at lists.osgeo.org] De la part de Bourdon, Jean-François (DIF)
Envoyé : 3 août 2020 10:43
À : qgis-developer at lists.osgeo.org
Objet : [QGIS-Developer] writeAsVectorFormatV2 fails in loop
Hi all,
I have strange a bug when using QgsVectorFileWriter.writeAsVectorFormatV2() inside a lengthy loop (30 minutes between each cycle). The first run inside the loop goes well but it crashes at the second run when trying to write a GPKG with the error below:
options.driverName = "GPKG"
RuntimeError: wrapped C/C++ object of type SaveVectorOptions has been deleted
I tried with a much shorter loop and it has no problem at all writing the GPKG at each cycle. I'll try with the now deprecated QgsVectorFileWriter.writeAsVectorFormat() to see if it makes any differences. Any idea why it could happen? By the way, I'm defining options = QgsVectorFileWriter.SaveVectorOptions() just before options.driverName = "GPKG" each time.
Thanks
Jean-François Bourdon, ing.f.
Analyste en télédétection
Direction des inventaires forestiers
Ministère des Forêts, de la Faune et des Parcs
5700, 4e Avenue Ouest, local A-108
Québec (Québec) G1H 6R1
Téléphone : 418 627-8669, poste 4304
jean-francois.bourdon at mffp.gouv.qc.ca<mailto:jean-francois.bourdon at mffp.gouv.qc.ca>
mffp.gouv.qc.ca<http://www.mffp.gouv.qc.ca/accueil.jsp>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200803/eb76f0a7/attachment-0001.html>
More information about the QGIS-Developer
mailing list