summaryrefslogtreecommitdiffstats
path: root/Lib/test/multibytecodec_support.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-07-16 20:17:31 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-07-16 20:17:31 (GMT)
commit579db160b392404b6dd9608ce5f5bef29a9885a4 (patch)
tree453ae087910ea944efe5eed000d99c5d277e4cbe /Lib/test/multibytecodec_support.py
parentb37f43f94b693468d8b3b9dfc84b1930c52a1b61 (diff)
downloadcpython-579db160b392404b6dd9608ce5f5bef29a9885a4.zip
cpython-579db160b392404b6dd9608ce5f5bef29a9885a4.tar.gz
cpython-579db160b392404b6dd9608ce5f5bef29a9885a4.tar.bz2
Closes #23247: Fix a crash in the StreamWriter.reset() of CJK codecs
Diffstat (limited to 'Lib/test/multibytecodec_support.py')
-rw-r--r--Lib/test/multibytecodec_support.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py
index bc1cfc8..f9884c6 100644
--- a/Lib/test/multibytecodec_support.py
+++ b/Lib/test/multibytecodec_support.py
@@ -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 = []