I am running ArcMap 10.4.1. I am running a script that uses a DA search cursor nested inside an update cursor to assign variables from values in a table. The script then writes those same variables to a feature class in the update cursor. I have done this many times in the past, but now I am getting a tuple assignment error when I try to assign row values in the update cursor. I know tuples aren't mutable and I am not trying to assign values in the search cursor. What is the problem here? This syntax has worked many times in the past.
The script fails on the first attempted row assignment after the search cursor:
row = tblAppAdd
TypeError: 'tuple' object does not support item assignment
Here is the script portion (edited for length):
with arcpy.da.UpdateCursor(u'lyr_patientsPts', fcFields) as fieldsCursor: for row in fieldsCursor: appID = unicode(row) # This is a custom function I found to simplify writing SQL search statements # for the where_clause in the search cursor. tblWhere = WhereClauseFromList(tblPatients, u'APPLICATION_ID', [appID]) # Get values of the fields in the table to put into the points feature class with arcpy.da.SearchCursor(tblPatients, tblFields, where_clause = tblWhere) as tblCursor: for row in tblCursor: tblAppAdd = unicode(row) tblAppCity = unicode(row) tblAppState = unicode(row) # ... etc there are ten more fields # Write values from table to points feature class row = tblAppAdd row = tblAppCity row = tblAppState # etc fieldsCursor.updateRow(row)