on render, encoding issues do not show which line caused the Exception
If a template is opened with incompatible encoding (such as unicode text but no UTF-8 identification on PY2, or potential encoding mismatches on PY3), a Unicode error will be raised that notes the offending character position but no line is identified.
A potential way to address this is to return a mako.exceptions.RuntimeException that includes the debug information and the original exception.
see https://github.com/sqlalchemy/mako/blob/master/mako/util.py#L169
Michael Bourke has proposed a fix for this issue in the main branch:
Capture more info for template RuntimeExceptions https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/3406
https://github.com/sqlalchemy/mako/issues/333 on a pattern it blame, on get