]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-88886: Remove excessive encoding name normalization (GH-137167)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 9 Sep 2025 18:07:21 +0000 (21:07 +0300)
committerGitHub <noreply@github.com>
Tue, 9 Sep 2025 18:07:21 +0000 (21:07 +0300)
commitaf58a6f883108f02996c784de010df62e75f5e13
tree06e22fb9f720d4653f7dbfa187436dee6a94db7f
parent6b7b9d00a9dd9cf66e3ec38b4c4b8a385b16b453
gh-88886: Remove excessive encoding name normalization (GH-137167)

The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.

Excessive normalization broke third-party codecs providers, like
python-iconv.

Revert "bpo-37751: Fix codecs.lookup() normalization (GH-15092)"

This reverts commit 20f59fe1f7748ae899aceee4cb560e5e1f528a1f.
Doc/library/codecs.rst
Lib/test/test_capi/test_codecs.py
Lib/test/test_codecs.py
Misc/NEWS.d/next/Core_and_Builtins/2025-07-28-17-01-05.gh-issue-88886.g4XFPb.rst [new file with mode: 0644]
Python/codecs.c