Skip to main content

I have an old but simple workspace with one private parameter defined as 

return FME_MacroValuesM'pEvent_Attributes'].replace(',',' ') + ' ' + FME_MacroValuesÂ'pEvent_Route_ID']

When I dug it up and run it under 2019.1.2.0 (20190829 - Build 19630 - linux-x64), it failed with the following msg:

Python version 3.6 loaded successfully
Traceback (most recent call last):
  File "<string>", line 5, in MF_Include_1574806112377
  File "<string>", line 4, in ParamFunc
KeyError: 'LRS_EventMerger_pEvent_Attributes'
INCLUDE -- failed to evaluate Python script `def ParamFunc():

  return 
FME_MacroValuesoFME_MacroValuesÂ'LRS_EventMerger_WORKSPACE_NAME'] + '_' +
 'pEvent_Attributes'].replace(',',' ') + ' ' + 
FME_MacroValues'FME_MacroValuese'LRS_EventMerger_WORKSPACE_NAME'] + '_' +
 'pEvent_Route_ID']
value = ParamFunc()
macroName = FME_MacroValues_'LRS_EventMerger_WORKSPACE_NAME'] + '_pAttributes_Merge'
if value == None:
  return { macroName : u'' }
else:
  import six
  try:
    value = six.text_type(value)
  except UnicodeDecodeError:
    value = six.text_type(value, 'utf-8')
  return { macroName : value }
'
Program Terminating
Translation FAILED.

I would like to know how I may fix this with the 3.x Python instead of using Python 2.7  Thanks for any comments.

Bo

Have you tried for instance:

https://www.pythonconverter.com/

?

 

I`m sure some other Python-entusiasts might give a better answer :)


The problem is that the dictionary FME_MacroValues does not know of a key called "LRS_EventMerger_pEvent_Attributes", I'm not sure it is tied to the Python version.

Is this inside a custom transformer, perhaps?


The problem is that the dictionary FME_MacroValues does not know of a key called "LRS_EventMerger_pEvent_Attributes", I'm not sure it is tied to the Python version.

Is this inside a custom transformer, perhaps?

@david_r, you are right. It turned out that the parameter name was changed. This is NOT python related afterall!


Reply