I am trying to migrate a software to python2 to python3. I am not experienced with Mako templates. In my case, everything works in python2. However, python3 fails with the following error message:
Traceback (most recent call last):
File "test.py", line 16, in <module>
calibration.trigger_overall_calibration(**d)
File "/home/vikas/Desktop/RevealCX3/smd/views/calibration.py", line 1370, in trigger_overall_calibration
return calc_overall_calibration(_request, requested_from_server)
File "/home/vikas/Desktop/RevealCX3/smd/views/calibration.py", line 1423, in calc_overall_calibration
job = diff_overall_calibration(session_id,
File "/home/vikas/Desktop/RevealCX3/smd/lib/asynch/calibration.py", line 209, in diff_overall_calibration
html = tmp.render(**{'orientation': orientation, 'calibrators': clb,
File "/home/vikas/Desktop/RevealCX3/env/lib/python3.8/site-packages/mako/template.py", line 476, in render
return runtime._render(self, self.callable_, args, data)
File "/home/vikas/Desktop/RevealCX3/env/lib/python3.8/site-packages/mako/runtime.py", line 881, in _render
_render_context(
File "/home/vikas/Desktop/RevealCX3/env/lib/python3.8/site-packages/mako/runtime.py", line 924, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/home/vikas/Desktop/RevealCX3/env/lib/python3.8/site-packages/mako/runtime.py", line 952, in _exec_template
callable_(context, *args, **kwargs)
File "/tmp/mako_modules/v2/
base.mak.py", line 110, in render_body
__M_writer(str(next.body()))
File "_home_vikas_Desktop_RevealCX3_smd_templates", line 215, in render_body
TypeError: 'Undefined' object is not callable
I am concerned with __M_writer(str(next.body())), which is failing in writing the body. it also returns the same error if I do print(next.body()).
You received this message because you are subscribed to the Google Groups "Mako Templates for Python" group.