According the ArcGIS 10.2.2 help this should work:
inZoneData = sys.argv[1] # This is a shapefile
fieldList = arcpy.ListFields(inZoneData)
for field in fieldList:
if field.name.upper() == 'STATUS': # rename status
arcpy.AlterField_management(inZoneData, field, 'status')
but it does not. What I get is invalid parameter. If I try this:
for field in arcpy.ListFields(inZoneData):
if field.name() == 'STATUS': # rename status
arcpy.AlterField_management(inZoneData, 'STATUS', 'status')
I get invalid unicode error. I understand that error at least.
Can anyone shine some light on how AlterField actually works? I’ve tried several other things but cannot get this tool working. Is it a shapefile bug?