I have a script that was previously working but just started throwing an error out of the blue. Here is the traceback:
Traceback (most recent call last):
File "<ipython-input-68-be384b1c4968>", line 4, in <module>
nfhl_selectorz = [row[0] for row in arcpy.da.SearchCursor(S_FIRM_Pan, firm_field)]
File "<ipython-input-68-be384b1c4968>", line 4, in <listcomp>
nfhl_selectorz = [row[0] for row in arcpy.da.SearchCursor(S_FIRM_Pan, firm_field)]
RuntimeError: General function failure
I have checked the code at every step and the paths and workspace all seem valid. Is there anything obvious that might be causing my code to throw this error? Everything works correctly up to the line where I run SearchCursor
:
import arcpy, sys, os
path = "T:/CCSI/TECH/FEMA/Datasets/NFHL/NFHL_06122018"
masterdict = {'13': ['13245'], '06': ['06007'] }
for k, v in masterdict.items():
stateFips = k #1st iteration is '13'
fipsList = v # first iteration is ['13245']
for root, dirs, filename in os.walk(path):
for dir in dirs:
if('NFHL_' + stateFips in dir and '.gdb' in dir):
temp_path = os.path.join(root, dir)
arcpy.env.workspace = temp_path
featureclasses = arcpy.ListFeatureClasses()
for fc in featureclasses:
if fc == 'S_FIRM_Pan':
S_FIRM_Pan = fc
arcpy.env.workspace = S_FIRM_Pan
field_names = [f.name for f in arcpy.ListFields(S_FIRM_Pan)]
for fip in fipsList:
fipC = fip + 'C'
firm_field = "DFIRM_ID"
nfhl_selectorz = [row[0] for row in arcpy.da.SearchCursor(S_FIRM_Pan, firm_field)]