mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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:
parent
732d1b0241
commit
4e294f6feb
11 changed files with 58 additions and 37 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue