[issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores.

STINNER Victor report at bugs.python.org
Tue Jan 14 08:11:13 EST 2020


STINNER Victor <vstinner at python.org> added the comment:

> Please note that external codec packages should not rely on the semantics of the Python stdlib encodings package's search function.

latexcodec does register a search function.

> It's good practice to always only use ASCII lower case chars and the underscore for codec names.

latexcodec uses encoding names like "latex+ascii" and their search function used "+" as a separator.

Don't worry, I just fixed latexcodec, my fix is already merged upstream! I simply changed the search function to split on "_" if the name contains "_".

* https://github.com/mcmtroffaes/latexcodec/commit/a30ae2cf061d7369b1aaa8179ddd1b486974fdad
* https://github.com/mcmtroffaes/latexcodec/pull/76
* https://github.com/mcmtroffaes/latexcodec/issues/75

----------

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


More information about the Python-bugs-list mailing list