STINNER Victor <vstin...@redhat.com> added the comment:
test_c_locale_coerce should use "codecs.lookup(encoding).name" to get the normalized name of an encoding, rather than fragile: data = data.replace(b"ANSI_X3.4-1968", b"ascii") data = data.replace(b"US-ASCII", b"ascii") the proposed pattern is even more dangerous: data = data.replace(b"646", b"ascii") I'm not sure where encodings should be normalized. Maybe around _check_child_encoding_details(). For the PR, please write it for the master branch. ---------- nosy: +vstinner _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37335> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com