Hello!

I am working on a plugin that uses a temporary folder to load layer filers on 
that can end up having the same name so it is needed to have qgis closing the 
files to allow deleting them. I tested this on qgis 3.8.3 and for linux it 
worked fine but on windows still gives "error 32 , cannot remove because the 
file is in use".

process(l)
l.commitChanges()
l.endEditCommand()
QgsProject.instance().removeMapLayer(l.id())
path=l.dataProvider().dataSourceUri().split("|layername=")[0]
Path(path).unlink() #remove file returns file being used error on this line

_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to