arcpro 2.6 arcpy fgdb lock files not clearing

2860
10
08-03-2020 12:53 PM
KennethSmith1
New Contributor II

I recently upgraded to Arcpro 2.6 and am having issues with an ArcPy script that exported data to a file geodatabase and then zipped that fgdb.

res=arcpy.FeatureClassToFeatureClass_conversion(in_features=inFeature, out_path=I10_fgdb, out_name=FC)
del res

 shutil.make_archive(fgdbPath, 'zip', ZipPath,fgdb)

This worked just fine in 2.5.X, however, after the upgrade, the lock file in the FGDB directory is not going away and that causes the zip to fail. How can I get ArcPy to clear the lockfile in a FGDB?

Thanks

10 Replies
DonMorrison1
Occasional Contributor III

Excellent idea. I was already using similar code to zip the file so it was an easy modification to filter out the .lock files.  I was expecting have have problems deleting the file geodatabase after the zip but that seems to work OK even with the .lock file.

0 Kudos