Yes I'm on Windows.
On Linux the code works fine.
P
Il Mar 22 Feb 2022, 18:25 Etienne Trimaille
ha scritto:
> Hi,
>
> Are you on Windows ?
>
> It's long-standing issue on Windows IIRC :
>
> https://gis.stackexchange.com/questions/365713/deleting-shapefile-python-lock-qgis-3-10
> or other links.
Hi,
Are you on Windows ?
It's long-standing issue on Windows IIRC :
https://gis.stackexchange.com/questions/365713/deleting-shapefile-python-lock-qgis-3-10
or other links.
Maybe
lyr = QgsProject.instance().mapLayersByName(diff_layer)[0]
QgsProject.instance().removeMapLayer(lyr.id())
lyr = None
Dear all,
I have some troubles wher I use in a pyqgis the function
QgsVectorFileWriter.deleteShapeFile(file_path)
here below the example:
def removeLayer(path_layer):
# remove layer from TOC if already loaded
basefile = os.path.basename(path_layer)
diff_layer = os.path.splitext(basefi