[issue13916] disallow the "surrogatepass" handler for non utf-* encodings

STINNER Victor report at bugs.python.org
Fri May 16 14:54:46 CEST 2014


STINNER Victor added the comment:

> But an exception reports about CP_UTF8.

Oh, that's my fault! And it is a bug: "CP_UTF8" is the Windows constant, but it is not a valid Python codec name.

Attached patch cp_encoding_name.patch fixes this issue.

I don't think that Py_LOWER() is needed because the encoding name of Unicode errors from the code page codec is "cpXXX". It cannot be "CPXXX", except if you pass create manually an Unicode error exception.

What do you think? Py_LOWER or not?

----------
Added file: http://bugs.python.org/file35264/cp_encoding_name.patch

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


More information about the Python-bugs-list mailing list