gh-133036: Deprecate codecs.open (#133038)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Inada Naoki 2025-04-30 10:11:09 +09:00 committed by GitHub
parent 732d1b0241
commit 4e294f6feb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 58 additions and 37 deletions

View file

@ -2056,8 +2056,7 @@ class TextIOWrapper(TextIOBase):
raise ValueError("invalid encoding: %r" % encoding)
if not codecs.lookup(encoding)._is_text_encoding:
msg = ("%r is not a text encoding; "
"use codecs.open() to handle arbitrary codecs")
msg = "%r is not a text encoding"
raise LookupError(msg % encoding)
if errors is None: