laptop and a wrench

Bug

A searchcursor will cause PythonWin and Idle to crash when used with Add Field in a File Geodatabase.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM006126
SubmittedJanuary 17, 2007
Last ModifiedApril 2, 2025
Applies toNo Product Found
Version found9.2
StatusWill Not Be Addressed

Additional Information

We apologize that we were unable to address this issue within the current product support cycle. If the issue continues to affect your work in a supported release, please contact Technical Support.

Workaround

This sample stores all the OID's in a python list while in the cursor, and then accesses the list and adds the fields after the cursor has been put to bed.#~~~~~~~~rows = gp.searchcursor(fc)row = rows.next()OIDList = []while row: OIDList.append(row.OBJECTID) row = rows.next()del rowdel rows for OID in OIDList: gp.AddField_management(fc, "TK" + str(OID), "TEXT", "", "", "", "", "NULLABLE", "NON_REQUIRED", "") #~~~~~~~~

Steps to Reproduce

Bug ID: NIM006126

Software:

  • No Product Found

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