[issue22746] cgitb html: wrong encoding for utf-8

Wolfgang Rohdewald report at bugs.python.org
Tue Oct 28 10:32:36 CET 2014


Wolfgang Rohdewald added the comment:

> What about
>  open(..., encoding='latin-1', errors='xmlcharrefreplace')

That works fine. I tested with a chinese character 与

But I do not think the application should work around something that cgitb is supposed to handle. More so since the documentation is dead silent about this. You need to use codecs.open instead of open and add those kw arguments. As long as this is not explained in the documentation, I guess it is a bug for everyone not using latin-1.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22746>
_______________________________________


More information about the Python-bugs-list mailing list