Monday 31 October 2016

shapefile - QGIS: Release file lock on file used in a processing algorithm at the end of script


I am using runalg (qgis:joinattributesbylocation) on two QgsVectorLayer objects. At the end of my script I'm trying to delete all the files created during the script. I can delete everything except the .shp and .dbf files from the two input vector layers for the process algorithm above. I remove all layers from the QgsMapRegistry before I try to delete the files. I've tried deleting all variables pointing to the layers, still doesn't work. The file lock remains until I exit QGIS. I tried the workaround posted here and it doesn't work for me, re-adding and removing the layers from the registry doesn't work. I also created new layers with the same files, added those to the registry, and then remove those, still no luck. The only way I can delete the files is to close QGIS.





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...