Skip to content

Incorrect message when non-ascii char appears in template #258

Open

Description

@sqlalchemy-bot

Migrated issue, originally created by Glenn WIkle

You might think it is minor to have default values in an exception message but given that Mako is a parsing system, users need more help figuring out where the incorrect syntax is in their input files.

In the current version of lexer.py line 215 is this:

                  0, 0, filename)

i think the two zeros here result in the message which looks like

Unicode decode operation of encoding 'ascii' failed in file 'templates/summary.html' at line: 0 char: 0

So any non-ascii char anywhere in the input file template will generate this same message.

I spent quite a while looking for unprintable characters in my template at 0,0 before I dug into the code to find that the non-ascii character was really in a different position.

(Next I'll have to figure out why it's restricting the character set to ascii)

Activity

  1. sqlalchemy-bot commented on Jun 28, 2016

    @sqlalchemy-bot
    Author

    Michael Bayer (@zzzeek) wrote:

    feel free to supply a PR with tests.

  2. sqlalchemy-bot commented on Jun 28, 2016

    @sqlalchemy-bot
    Author

    Changes by Michael Bayer (@zzzeek):

    • removed milestone (was: "0.5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions