-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
seg fault when rendering template under Python 2.7 with Jinja2 2.5.5 #4
Comments
The template is not complete. Please provide a full testcase. |
The template code doesn't seem to be displaying properly above so I've put it here instead: |
That problem might be caused by having leftovers from Python 2.6 in your cache and now Python barks on broken bytecodes. You seem to have fixed it by changing the timestamp of the templates. To fix this you might just have to flush your cache. |
Ahhh, that makes sense, because the memory cache never got flushed. |
Can you confirm if this fixes the problem? If yes I will close the ticket. |
Yep, I cleared the cache and now it works with the old template. |
I'd like to make a suggestion that clearing the byte code cache after installing a new version of Python be made part of the documentation. I spent a half-day pulling my hair out on this one (not your fault) until I fell upon this posting. Thanks! |
The proper solution would be detecting that. I will try to see if that can be accomplished. |
Jinja 2.6 will detect that. For earlier versions I added a note to the changelog, I hope that Google picks it up. |
I have a template that starts out like this:
When it tries to render I get a seg fault. I switched to an older version of Jinja2 (2.2.1) that the template had previously rendered with and I got this error:
"/usr/local/lib/python2.7/site-packages/Jinja2-2.2.1-py2.7.egg/jinja2/environment.py",
TypeError: an integer is requiredline 839, in from_code
exec code in namespace
File "/var/www/templates/post_alert.html", line 1, in
And I also saw the same traceback but with the exception "ImportError: No module named division" but I'm not sure how to duplicate that. My setup uses a FileSystemLoader with a MemcachedBytecodeCache and autoescape=True, auto_reload=True, line_statement_prefix='#'
I had previously been using Python 2.6 to render this template with no problems using Jinja2 2.2.1.
In any case, my hack to fix this problem was to change the body style: font:13px/1.5
to just: font:13px
The text was updated successfully, but these errors were encountered: