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

IndentationError in template.py #94

Closed
sqlalchemy-bot opened this Issue Dec 7, 2008 · 4 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Dec 7, 2008

Migrated issue, originally created by Anonymous

When I compile a syntactically invalid (or perhaps just strange) template, I get an indentation error in template.py. I'm using Python 2.5, mako 0.2.3. Minimalist recreation code below.

As one might expect, the error goes away if I add text (non-whitespace) before the %endif.

>>> import mako.template
>>> t=mako.template.Template("%if not None:\n%endif\n")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Mako-0.2.3-py2.5.egg/mako/template.py", line 62, in __init__
    (code, module) = _compile_text(self, text, filename)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Mako-0.2.3-py2.5.egg/mako/template.py", line 257, in _compile_text
    code = compile(source, cid, 'exec')
  File "memory:0x76150", line 21
    return ''
         ^
IndentationError: expected an indented block
>>> 
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Jan 19, 2010

Changes by Michael Bayer (@zzzeek):

  • set milestone to "0.3"
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Feb 8, 2010

Anonymous wrote:

I got this error recently.

Here is a template that reproduces the problem

Trailer

% if x:
% endif

Prolog
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 4, 2010

Michael Bayer (@zzzeek) wrote:

63cec67

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 4, 2010

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment