-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mako Lookup Exception for Namespace in 1.3.1 #606
Comments
Yep, me too in 1.3.2: https://gist.github.com/2766150 |
Overriding a template using asset specs no longer works :( |
FWIW, @aclark4life reported that pull #607 doesn't fix the issue for him. |
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? |
Just wanted to say that blaise's fix worked for me. |
I still get an error (on a clean build):
|
@aclark4life can you paste the last line of the exception, I want to see the path you get. Are you sure you're using my branch? |
@aclark4life according to pip docs you would need to do something like this in requirements.txt to install the right branch, because the fix is not applied to master: -e git://github.com/Pylons/[email protected]#egg=pyramid |
Sorry, was testing with master. Works for me too. |
Is this getting merged in anytime soon? |
I wanted @mcdonc to review it before |
@mcondc Thats it! I want a refund on my git tips! ;) |
or he needs more ;) |
Does anyone have enough zen about this to write a test or two to make sure a) it is actually fixed and b) it never breaks again? I dont use mako at all. |
ok will do |
This is fixed in current master and current 1.3-branch. |
Issue
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.
The text was updated successfully, but these errors were encountered: