sqlalchemy/mako

Persistence of *.html.py file in temporary directory

ggemmill opened this issue · 1 comments

Environment Linux, Mageia 7 x86_64
Mako assumes incorrectly that if a .html.py file exists in the specified temporary directory:
tmpl = Template(filename='weather.html', module_directory='/tmp/mako_modules')
that the template does not need to be re-compiled. I have been testing a development version of a python script alongside the production version, with a slight difference in the template. Mako just uses whichever version was last compiled.

hi there -

mako uses the last modification time of the template file + the py file to determine if a recompile is needed. the code that does this is here: https://github.com/sqlalchemy/mako/blob/master/mako/template.py#L404

so check the modification time of your .py file is not perhaps in the future relative to your machine's clock, or something like that.