summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-02-01 22:59:49 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-02-01 22:59:49 (GMT)
commit3675cd9db1d7eda965df81357a11dd40e41090f7 (patch)
tree7736103010ac82c41b4a51eb5c4121dca198fb74 /Lib
parent3a43d063213f221436ec00afca1d74b4a3b28c15 (diff)
parente3bfe19358f9d6747676fcdb9af415972d276671 (diff)
downloadcpython-3675cd9db1d7eda965df81357a11dd40e41090f7.zip
cpython-3675cd9db1d7eda965df81357a11dd40e41090f7.tar.gz
cpython-3675cd9db1d7eda965df81357a11dd40e41090f7.tar.bz2
merge 3.3 (#23369)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_json/test_encode_basestring_ascii.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_json/test_encode_basestring_ascii.py b/Lib/test/test_json/test_encode_basestring_ascii.py
index 480afd6..3c014d3 100644
--- a/Lib/test/test_json/test_encode_basestring_ascii.py
+++ b/Lib/test/test_json/test_encode_basestring_ascii.py
@@ -1,5 +1,6 @@
from collections import OrderedDict
from test.test_json import PyTest, CTest
+from test.support import bigaddrspacetest
CASES = [
@@ -41,4 +42,10 @@ class TestEncodeBasestringAscii:
class TestPyEncodeBasestringAscii(TestEncodeBasestringAscii, PyTest): pass
-class TestCEncodeBasestringAscii(TestEncodeBasestringAscii, CTest): pass
+class TestCEncodeBasestringAscii(TestEncodeBasestringAscii, CTest):
+ @bigaddrspacetest
+ def test_overflow(self):
+ s = "\uffff"*((2**32)//6 + 1)
+ with self.assertRaises(OverflowError):
+ self.json.encoder.encode_basestring_ascii(s)
+