You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
sorry, I need a lot more detail here. I've created a test scenario exactly like yours which includes a similar subdirectory layout and all module files are written as they are supposed to be - when you say "extend the policy embodied", I've no idea where exactly this policy is to be extended ? There's no stack trace here so I actually am not sure what file cannot be written, I would assume the module file but that's not the case AFAICT.
A run of my test illustrates the following file layout generating the subsequent module layout:
Today was a very busy day and the next few days may be too, but I'll write myself a TODO note and get you a clear test case against a fresh pip install and a clearer explanation as soon as I can spare an hour.
Oh. Heh. The bug here is that Mako is letting you do something its not designed to do. You're setting your template root way into the directory tree, then trying to include a file that's outside of it using ".." to trick it. That wasn't made clear in your initial ticket where you just called it "fldr".
The "uri" of the Template shouldn't ever have any ".." in it - by the time the include tag builds up the Template the URL should be absolute. Otherwise if you have ten different templates that all include "common.incl" using a different relative scheme then you have "common.incl" in the template lookup ten times with different uris.
The correct way to load includes outside of the directory tree is to use a second path within the lookup, and include templates relative to that.
That it can very easily write the .py file all over the place here is such a big deal I may have to put a hard block on this and just release. It'll break some setups that are doing the same thing here but I almost feel like that's just how it has to be. Because it's writing files arbitrarily with this practice.
I sort of realized that was probably the case shortly after I posted the bug report (and solved it by using os.path.relpath to make os.walk(root) output relative to root so I could create one TemplateLookup instance for my entire static templating run).
My primary concern is ensuring that Mako can't unexpectedly put junk in unexpected places on my filesystem.