From 30f849250b7bac871bb9b7361833ea921585d659 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 24 Sep 2025 09:38:57 +0100 Subject: [PATCH] gh-83336: Add alias for consistency to `utf-8-sig` (#136530) Closes #83336 --- Doc/library/codecs.rst | 2 +- Lib/encodings/aliases.py | 5 ++++- .../Library/2025-07-11-08-15-17.gh-issue-83336.ptpmq7.rst | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2025-07-11-08-15-17.gh-issue-83336.ptpmq7.rst diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index 90a695ef937f..8c5c87a7ef16 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1339,7 +1339,7 @@ particular, the following variants typically exist: +-----------------+--------------------------------+--------------------------------+ | utf_8 | U8, UTF, utf8, cp65001 | all languages | +-----------------+--------------------------------+--------------------------------+ -| utf_8_sig | | all languages | +| utf_8_sig | utf8-sig | all languages | +-----------------+--------------------------------+--------------------------------+ .. versionchanged:: 3.4 diff --git a/Lib/encodings/aliases.py b/Lib/encodings/aliases.py index 474d74ea3dc1..f4b1b8dd43f9 100644 --- a/Lib/encodings/aliases.py +++ b/Lib/encodings/aliases.py @@ -17,7 +17,7 @@ """ aliases = { - # Please keep this list sorted alphabetically by value ! + # Please keep this list sorted alphabetically by value! # ascii codec '646' : 'ascii', @@ -554,6 +554,9 @@ aliases = { 'utf8_ucs4' : 'utf_8', 'cp65001' : 'utf_8', + # utf_8_sig codec + 'utf8_sig' : 'utf_8_sig', + # uu_codec codec 'uu' : 'uu_codec', diff --git a/Misc/NEWS.d/next/Library/2025-07-11-08-15-17.gh-issue-83336.ptpmq7.rst b/Misc/NEWS.d/next/Library/2025-07-11-08-15-17.gh-issue-83336.ptpmq7.rst new file mode 100644 index 000000000000..022ff664ed94 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-07-11-08-15-17.gh-issue-83336.ptpmq7.rst @@ -0,0 +1 @@ +``utf8_sig`` is now aliased to :mod:`encodings.utf_8_sig` -- 2.47.3