While updating the field using update cursor. Getting the error:The requested operation is invalid on a closed state. Here is my code:
editor = arcpy.da.Editor(workspace)
editor.startEditing(False, True)
editor.startOperation()
cursor = arcpy.da.UpdateCursor(<>feature_class,[<fields>])
for row in cursor:
# updation stuff comes here
cursor.updateRow(row)
del row
del cursor
editor.stopOperation()
editor.stopEditing(True)
del editor
I appreciate any help or suggestions.