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

quote & apostrophe chars inside comments in python blocks #23

Closed
sqlalchemy-bot opened this Issue Mar 1, 2007 · 2 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Mar 1, 2007

Migrated issue, originally created by Anonymous

A simple template file:

<%
# it's a comment
%>

will raise a Syntax exception, because of the apostrophe character in the comment text. The same happens if there is a quotation mark.

-style comments outside python blocks are not affected.

Traceback:

Traceback (most recent call last):
  File "wsgiref/handlers.py", line 92, in run
  File "/usr/local/myapp/lib/myapp/wsgiapp.py", line 85, in application
    template = templatelookup.get_template(templateuri)
  File "/usr/local/myapp/lib/mako/lookup.py", line 60, in get_template
    return self.__check(uri, self.__collection[uri])
  File "/usr/local/myapp/lib/mako/lookup.py", line 126, in __check
    return self.__load(template.filename, uri)
  File "/usr/local/myapp/lib/mako/lookup.py", line 110, in __load
    self.__collection[uri] = Template(uri=uri, filename=posixpath.normpath(filename), lookup=self, module_filename=(self.modulename_callable is not None and self.modulename_callable(filename, uri) or None), **self.template_args)
  File "/usr/local/myapp/lib/mako/template.py", line 68, in __init__
    _compile_module_file(self, file(filename).read(), filename, path)
  File "/usr/local/myapp/lib/mako/template.py", line 186, in _compile_module_file
    node = Lexer(text, filename, input_encoding=template.input_encoding, preprocessor=template.preprocessor).parse()
  File "/usr/local/myapp/lib/mako/lexer.py", line 139, in parse
    if self.match_python_block():
  File "/usr/local/myapp/lib/mako/lexer.py", line 251, in match_python_block
    (text, end) = self.parse_until_text(r'%>')
  File "/usr/local/myapp/lib/mako/lexer.py", line 66, in parse_until_text
    raise exceptions.SyntaxException("Unmatched '%s'" % match.group(1), self.matched_lineno, self.matched_charpos, self.filename)
SyntaxException: Unmatched ''' in file '/usr/local/myapp/templates/bug.html' at line: 3 char: 5
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 1, 2007

Michael Bayer (@zzzeek) wrote:

[changeset:222]

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 1, 2007

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