I am using the PyQGIS template from @underdark for showing the crash. Her script is running like a charm, but as soon as I add a print("finished...")
- call in her code, QGIS 3.4 Madeira crashes.
You can look up her code on this site: @underdarks class template for python processing scripts
And in the following code snippet you can see the part where I added the print()
-call:
def processAlgorithm(self, parameters, context, feedback):
source = self.parameterAsSource(parameters, self.INPUT, context)
(sink, dest_id) = self.parameterAsSink(parameters, self.OUTPUT, context,
source.fields(), source.wkbType(), source.sourceCrs())
features = source.getFeatures(QgsFeatureRequest())
for feat in features:
out_feat = QgsFeature()
out_feat.setGeometry(feat.geometry())
out_feat.setAttributes(feat.attributes())
sink.addFeature(out_feat, QgsFeatureSink.FastInsert)
print("finished ...") # QGIS3 crashes after this line
return {self.OUTPUT: dest_id}
The crash looks like this (please note that the string "finished..." has been printed into the console before QGIS crashed):
Any suggestions?