mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +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
|
@ -1,5 +1,4 @@
|
|||
# regression test for SAX 2.0
|
||||
# $Id$
|
||||
|
||||
from xml.sax import make_parser, ContentHandler, \
|
||||
SAXException, SAXReaderNotAvailable, SAXParseException
|
||||
|
@ -832,8 +831,9 @@ class StreamReaderWriterXmlgenTest(XmlgenTest, unittest.TestCase):
|
|||
fname = os_helper.TESTFN + '-codecs'
|
||||
|
||||
def ioclass(self):
|
||||
writer = codecs.open(self.fname, 'w', encoding='ascii',
|
||||
errors='xmlcharrefreplace', buffering=0)
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
writer = codecs.open(self.fname, 'w', encoding='ascii',
|
||||
errors='xmlcharrefreplace', buffering=0)
|
||||
def cleanup():
|
||||
writer.close()
|
||||
os_helper.unlink(self.fname)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue