This is the error I receive from the PythonCaller:
Python Exception <ValueError>: 'L' is not in list
Traceback (most recent call last):
File "<string>", line 22, in input
ValueError: 'L' is not in list
Error encountered while calling method `input'
PythonCaller_3 (PythonFactory): PythonFactory failed to process feature
Here is the python in the PythonCaller: it's reading two attributes from the ListBuilder. This runs on the same data without error in FME 2017
# Template Class Interface:
# When using this class, make sure its name is set as the value of
# the 'Class or Function to Process Features' transformer parameter
class FeatureProcessor(object):
def __init__(self):
pass
def input(self,feature):
self.listC = feature.getAttribute('_list{}.c')
self.listL = feature.getAttribute('_list{}.l')
self.list = zip(self.listC,self.listL)
#
if self.list != None:
self.check = =]
for i,e in enumerate(self.list):
if e 1] == 'M':
self.check.append(e(0])
if not self.check:
self.add = =]
for i,e in enumerate(self.list):
self.add.append(e(1])
val = self.add.index('L') + 1
for i,e in enumerate(self.list):
x = i + 1
if x == val:
feature.setAttribute('_list{%d}.l' %i,'M')
self.pyoutput(feature)
def close(self):
pass