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

@ -314,7 +314,8 @@ def test_bug1728403(self):
f.write(b'\xa1')
finally:
f.close()
f = codecs.open(TESTFN, encoding='cp949')
with self.assertWarns(DeprecationWarning):
f = codecs.open(TESTFN, encoding='cp949')
try:
self.assertRaises(UnicodeDecodeError, f.read, 2)
finally: