laptop and a wrench

Bug

In ArcGIS Pro, MakeFeatureLayer_management() creates a lock which unable to be deleted.

Last Published: January 25, 2021 ArcGIS Pro
Bug ID Number BUG-000136135
SubmittedDecember 14, 2020
Last ModifiedJuly 1, 2024
Applies toArcGIS Pro
Version found2.7 Beta
Operating SystemWindows OS
Operating System Version10.0
StatusWill Not Be Addressed

Additional Information

This behavior is by design. Running arcpy.management.MakeFeatureLayer creates two objects which reference the feature class inside the FGDB (thus the .lock file). These two objects are the result object, and the internal gp layer object.

Workaround

To successfully remove the locks, add arcpy.Delete_management(res[0].name) and del res . Then the lock is released.

Steps to Reproduce

Bug ID: BUG-000136135

Software:

  • ArcGIS Pro

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options