[Grok-dev] grok.templatedir path restriction

Jan-Wijbrand Kolman janwijbrand at gmail.com
Fri Apr 16 06:05:09 EDT 2010


Wichert Akkerman <wichert at wiggy.net> wrote:
 
> I just filed this bug as https://bugs.launchpad.net/grok/+bug/562262 :
> 
> I want to organize my templates by type, but all in a single templates 
> subdirectory. That means the paths to the templates relative to the 
> python source look like templates/category/template.pt. Unfortunately 
> the grok.templatedir directive does not allow this: it prevents any 
> occurrence of os.path.sep in the pathname.
> 
> I can not think of a good reason for that restriction. It does not help 
> with security since the person writing that directive can already write 
> python code to do anything.
> 
> Are there any objections to simply removing that test?

Besides that it is fundamental __conceptual__ change in how Grok behaves, I 
cannot really think of an objection.

Note that Martijn and I have been discussing how directives work in Grok 
for a long time already, including issues like you raise.

Would it be possible for you, or others, to experiment with changing the 
template and templatedir directives so that they allow "real" paths on a 
branch? To see how that would work out, what the semantics would be?

Note that it is also very easy to implement directives yourself, if only to 
demonstrate their usefulness to others.

kind regards,
jw




More information about the Grok-dev mailing list