IN-CORE / pyincore

pyIncore is a component of IN-CORE. It is a python package consisting of two primary components: 1) a set of service classes to interact with the IN-CORE web services, and 2) IN-CORE analyses . The pyIncore allows users to apply various hazards to infrastructure in selected areas, propagating the effect of physical infrastructure damage and loss of functionality to social and economic impacts.
Mozilla Public License 2.0
25 stars 7 forks source link

Fix permission error #545

Closed ywkim312 closed 7 months ago

ywkim312 commented 7 months ago

The thing happens when trying to delete the shapefile that involved in creating new dataset by using the following function

DatasetUtil.construct_updated_inventories

I suspect that the permission error might happen in just simply using the dataset by downloading from data service. However, in that case, it will just be saved in the cache directly and will not try to delete the file like this case. I have tried to close the dataset but it did not work because .shp, and .dbf files are being used by some windows process. So instead of trying to deleted it, I am just pushing the proper try and catch logic so the process go till the end instead of being interrupted and stopped in the middle of the process.

Things that are tested in the PR before commit (nothing worked)