[issue33231] Potential memory leak in normalizestring()

INADA Naoki report at bugs.python.org
Fri Apr 6 02:46:10 EDT 2018


INADA Naoki <songofacandy at gmail.com> added the comment:

> Only reason I can see to avoid this would be if the codec names could contain arbitrary Unicode encoded as UTF-8 (and therefore strlen wouldn't tell you the final length in Unicode ordinals), but I'm pretty sure that's not the case (if it is, we're not normalizing properly, since we only lower case ASCII). If Unicode codec names need to be handled, there are other options, though the easy savings go away.

Maybe, we can add "encoding name must be ascii" restriction in future version (3.8+).
But for now, I want to avoid any potential backward incompatibility.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33231>
_______________________________________


More information about the Python-bugs-list mailing list