mako
mako copied to clipboard
Incorrect message when non-ascii char appears in template
Migrated issue, originally created by Glenn WIkle
You might think it is minor to have default values in an exception message but given that Mako is a parsing system, users need more help figuring out where the incorrect syntax is in their input files.
In the current version of lexer.py line 215 is this:
0, 0, filename)
i think the two zeros here result in the message which looks like
Unicode decode operation of encoding 'ascii' failed in file 'templates/summary.html' at line: 0 char: 0
So any non-ascii char anywhere in the input file template will generate this same message.
I spent quite a while looking for unprintable characters in my template at 0,0 before I dug into the code to find that the non-ascii character was really in a different position.
(Next I'll have to figure out why it's restricting the character set to ascii)