laptop and a wrench

Bug

Deleting multiple feature classes using the ArcPy Delete function fails with the error message, "RuntimeError: Object: Error in executing tool."

Last Published: January 14, 2020 ArcGIS Pro
Bug ID Number BUG-000121616
SubmittedApril 10, 2019
Last ModifiedJune 5, 2024
Applies toArcGIS Pro
Version found2.3
Operating SystemN/A
Operating System VersionN/A
Version Fixed2.6
StatusFixed

Workaround

The Delete tool fails with ["a", "b", "c"] but succeeds with ["a;b;c"]. As a workaround follow the steps below:

 

## Use ListFeatureClasses with wildcard to obtain a list of feature classes to be deleted

fclist = arcpy.ListFeatureClasses(...)

arcpy.management.Delete(";".join(fclist))

This works in Python IDLE and standalone script, but does not work in the Python window of ArcGIS Pro.

Steps to Reproduce

Bug ID: BUG-000121616

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