Open yohanboniface opened 3 years ago
Unfortunately, Python doesn't always emit the most helpful error messages when it comes to syntax errors such as unterminated constants, as that's just pointing at the end of the generated file.
To get a clearer picture of how Python sees your template, run: python3 -m cinje source source.py
E.g. from one of my own API service projects: python3 -m cinje source web/app/sanitize/template.py
If you have Pygments installed, the output will be pretty and syntax-colored when emitting to a terminal.
web/app/sanitize/template.py
raw sourceweb/app/sanitize/template.py
as seen by PythonIf you could Gist your source template, that'd greatly assist with debugging. 🙂 The likely culprit is an unterminated string much earlier in your code.
Updated to include raw source of sample template. Additionally, I have been able to reproduce locally and am investigating myself.
minimal.py
However, if the "empty" source file is read in, and run through the Unicode decoder, correctly translated source is produced:
minimal-translated.py
Written to a distinct file, this module imports perfectly fine.
Hey there,
Seems not to run on python 3.9:
or am I missing something ?
Thanks :)