https://github.com/python/cpython/commit/30f849250b7bac871bb9b7361833ea921585d659
commit: 30f849250b7bac871bb9b7361833ea921585d659
branch: main
author: Stan Ulbrych <[email protected]>
committer: malemburg <[email protected]>
date: 2025-09-24T10:38:57+02:00
summary:
gh-83336: Add alias for consistency to `utf-8-sig` (#136530)
Closes #83336
files:
A Misc/NEWS.d/next/Library/2025-07-11-08-15-17.gh-issue-83336.ptpmq7.rst
M Doc/library/codecs.rst
M Lib/encodings/aliases.py
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index 90a695ef937f75..8c5c87a7ef16e4 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 474d74ea3dc191..f4b1b8dd43f920 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 @@
'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 00000000000000..022ff664ed94df
--- /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`
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]