summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-07-16 22:04:20 (GMT)
committerGeorg Brandl <georg@python.org>2008-07-16 22:04:20 (GMT)
commitb9b68ae7a5176605ec482420cd8030bc56b144e1 (patch)
treec22ec878ba350076a314d8026177ebdfcfb1cc7f /Lib/test
parent86cbf81b47d8eca31ade71f8d6b0653167ffd922 (diff)
downloadcpython-b9b68ae7a5176605ec482420cd8030bc56b144e1.zip
cpython-b9b68ae7a5176605ec482420cd8030bc56b144e1.tar.gz
cpython-b9b68ae7a5176605ec482420cd8030bc56b144e1.tar.bz2
#3305: self->stream can be NULL.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_multibytecodec.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py
index f2b042c..090374c 100644
--- a/Lib/test/test_multibytecodec.py
+++ b/Lib/test/test_multibytecodec.py
@@ -8,6 +8,7 @@ from test import test_support
from test import test_multibytecodec_support
from test.test_support import TESTFN
import unittest, StringIO, codecs, sys, os
+import _multibytecodec
ALL_CJKENCODINGS = [
# _codecs_cn
@@ -53,6 +54,14 @@ class Test_MultibyteCodec(unittest.TestCase):
finally:
os.unlink(TESTFN)
+ def test_init_segfault(self):
+ # bug #3305: this used to segfault
+ self.assertRaises(AttributeError,
+ _multibytecodec.MultibyteStreamReader, None)
+ self.assertRaises(AttributeError,
+ _multibytecodec.MultibyteStreamWriter, None)
+
+
class Test_IncrementalEncoder(unittest.TestCase):
def test_stateless(self):