Allow mako-render script to take relative path filenames

Merged
#2 · Created  · Last updated

Merged pull request

Merged in dharland/mako/patch-fix-mako-render-relative-path (pull request #2)

9e1d236·Author: ·Closed by: ·2014-01-09

Description

Currently, using mako-render as follows

$ mako-render ../my-template.mako

will cause an exception

mako.exceptions.TemplateLookupException: Template uri "../my-template.mako" is invalid - it cannot be relative outside of the root path.

This is because mako-render passes both the template source and the template filename to Template (according to the documentation they are mutually exclusive). Thus the Template will never need to try and load the template itself, but will still complain about the path name.

This patch defers the path-name check until if and when it is actually needed.

0 attachments

0 comments

Loading commits...