Monday, 15 June 2015

arcpy - ArcGIS Python SearchCursor file locking?


I have a script that gets a value from a shapefile's field to return to the user.


It seems that only when the arcpy.SearchCursor is called ArcMap 10.0 locks the file and it doesn't get removed after the script is finished running. To get the lock off I have to close ArcMap. In the script I delete the SearchCursor object after using it as well as the row object.


The way I have the script working is that it tries to delete the workspace folder on subsequent runs but can't because of the lock...until of course I close ArcMap.


Is there any advice on getting this lock to go away?




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...