Update codecs from v3.14.2

This commit is contained in:
CPython Developers authored and Jeong, YunWon committed 2026-01-31 10:11:58 +09:00
1 parent 0c174624b4
commit 31ee8b593f
2 files changed
+252 -173

No files matched your search

+11 -18
View File
@@ -884,7 +884,6 @@ class StreamRecoder:
### Shortcuts
def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):
""" Open an encoded file using the given mode and return
a wrapped version providing transparent encoding/decoding.
@@ -912,8 +911,11 @@ def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):
.encoding which allows querying the used encoding. This
attribute is only available if an encoding was specified as
parameter.
"""
import warnings
warnings.warn("codecs.open() is deprecated. Use open() instead.",
DeprecationWarning, stacklevel=2)
if encoding is not None and \
'b' not in mode:
# Force opening of the file in binary mode
@@ -1109,24 +1111,15 @@ def make_encoding_map(decoding_map):
### error handlers
try:
strict_errors = lookup_error("strict")
ignore_errors = lookup_error("ignore")
replace_errors = lookup_error("replace")
xmlcharrefreplace_errors = lookup_error("xmlcharrefreplace")
backslashreplace_errors = lookup_error("backslashreplace")
namereplace_errors = lookup_error("namereplace")
except LookupError:
# In --disable-unicode builds, these error handler are missing
strict_errors = None
ignore_errors = None
replace_errors = None
xmlcharrefreplace_errors = None
backslashreplace_errors = None
namereplace_errors = None
strict_errors = lookup_error("strict")
ignore_errors = lookup_error("ignore")
replace_errors = lookup_error("replace")
xmlcharrefreplace_errors = lookup_error("xmlcharrefreplace")
backslashreplace_errors = lookup_error("backslashreplace")
namereplace_errors = lookup_error("namereplace")
# Tell modulefinder that using codecs probably needs the encodings
# package
_false = 0
if _false:
import encodings
import encodings # noqa: F401
+241 -155
View File
File diff suppressed because it is too large. Load diff