Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Mako Lookup Exception for Namespace in 1.3.1 #606
When I attempt to load a page, and it's respective template includes a <%namespace>, I receive the following error https://gist.github.com/2732756. I looked into it, and it definitely has something to do with this recent change:
-We now replace the colon in the Mako module filename with a dollar sign, so it can work on Windows. See #512 for more information.
The template lookup works fine for the base template, but somehow the template.uri gets changed to an asset spec, where the ':' is replaced with a '$'. Then on subsequent lookups for the base template's resources(inherited templates and namespaces), mako attempts to use the modified asset spec and doesn't know what to do with it.
How to Reproduce
I haven't tested this, but I'm pretty sure it can be reproduced simply by including a namespace within a template and attaching that template to a view.
referenced this issue
May 22, 2012
Sorry, I should have added a comment here. I pip installed my pyramid 1.3 site, then:
Then ran pyramid and loaded a page. I still get:
The problem seems to be related with the inherited template who already get the myproject$templates/base.mako format instead of the original uri so the conditional is not called and then it tries to render immediately. Switching back $ for : at the beginning solves the problem with inherited templates, if we assume we always switch : for $ for windows. The problem probably also exists on windows too, wouldn't be better to look for windows and then apply the $ hack instead of using it for all platforms?
I still get an error (on a clean build):