Skip to content
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

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

Open
sqlalchemy-bot opened this issue Jun 28, 2016 · 2 comments
Open

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

sqlalchemy-bot opened this issue Jun 28, 2016 · 2 comments
Labels
bug Something isn't working lexer low priority

Comments

@sqlalchemy-bot
Copy link

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)

@sqlalchemy-bot
Copy link
Author

Michael Bayer (@zzzeek) wrote:

feel free to supply a PR with tests.

@sqlalchemy-bot
Copy link
Author

Changes by Michael Bayer (@zzzeek):

  • removed milestone (was: "0.5")

@sqlalchemy-bot sqlalchemy-bot added bug Something isn't working low priority lexer labels Nov 26, 2018
@bourke bourke added this to Backlog in Mako prioritization Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lexer low priority
Projects
Development

No branches or pull requests

1 participant