inconshreveable/sqltap

Can't print stack trace containing UTF-8 characters

tflorac opened this issue · 1 comments

Hi,
I use SQLTap and noticed a small problem: if my source code (encoded in UTF-8) contains hard-coded accentuated characters as SQLAlchemy query arguments, an encoding error is raised in Mako template when displaying the trace...
I quickly corrected by typing "${trace.decode('utf-8')}" in "html.mako" template, but this fix is probably not usable for people using other encodings...

Hmmm interesting. I wonder whether the trace is encoded in utf-8 regardless of what the sourcefile is in. This will require some additional learning and testing just to understand.

That being said, I'm willing to bet that 99.9% of everyone's source files are in ASCII or UTF-8, so I'd be amenable to taking a patch that assumes UTF-8 just so long as we understand the consequences of what happens if they're not.