Skip to content

String strangely turned into mako expression #20

@ghost

Description

hi

In this environment setup:

  1. A py3.4 virtual-env
  2. Created a Pyramid application (www.pylonsproject.org) using sqlalchemy starterkit.
  3. Manually replaced chamelion templating system with mako (everything works fine so far and the page is rendering in browser with no problem).
  4. Converted PyHAML using 2to3 (everything went fine).
  5. Added "mako.preprocessor = haml.preprocessor" to application's .ini file which will be picked up by mako later.
  6. Running (in virtual-env) pserve development.ini
  7. Visiting application's web page will raise a mako exception.

I put a open('/tmp/x', 'w').write(generate_mako(parse_string(source))) in init.py file to investigate it more, looking at the file 'x' I can see this comment which is by default in pyramid's page has turned to Mako expression:

Original in mytemplate.mako:

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

Output by PyHAML:

<!-- Bootstrap core JavaScript -->
${================================================== -->}
<!-- Placed at the end of the document so the pages load faster -->

Simply removing the offending line like this:

fixed the problem (for now).

is this really an issue or did I miss something in the docs? That 2to3 thing seems fishy though.
best wishes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions