Closes #23247: Fix a crash in the StreamWriter.reset() of CJK codecs

This commit is contained in:
Victor Stinner 2015-07-16 22:17:31 +02:00
parent b37f43f94b
commit 579db160b3
3 changed files with 12 additions and 0 deletions

View file

@ -270,6 +270,13 @@ class TestBase:
self.assertEqual(ostream.getvalue(), self.tstring[0])
def test_streamwriter_reset_no_pending(self):
# Issue #23247: Calling reset() on a fresh StreamWriter instance
# (without pending data) must not crash
stream = BytesIO()
writer = self.writer(stream)
writer.reset()
class TestBase_Mapping(unittest.TestCase):
pass_enctest = []