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.
yeah we can't go this route exactly, the validation you see for u_norm there is unconditional. See 5cd508ff. The mako-render script instead
should be adjusted. For one, yes i see it's passing "filename" and not "uri", it should probably be producing a correct URI on the outside and passing that (and even an exception message to indicate that "text" and "filename" are in fact exclusive, that would be fine as well). Also I see it's passed a TemplateLookup with "." as the path, perhaps when a ".." path is encountered, this lookup should be adjusted to start where the given template is located. The basic rule is that we can't have any includes or anything that go outside of the root of the TemplateLookup.
also just an FYI I wanted to do a release of 0.9.1 today, as we have some other fixes I want to get out. This isn't suggesting that you need to hurry, just that this pullreq might not be in this particular release, sorry I haven't reviewed this pullreq sooner.