summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-07-26 06:01:22 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-07-26 06:01:22 (GMT)
commit83236f7a8b638454ea74743e1103faa0545e9a62 (patch)
treec5aa126ac3d23fd73dcd592c5c60076eb0a90fb2 /Lib
parent5a294d822b7f5732135662907ec1a1d4a7b0fc9a (diff)
downloadcpython-83236f7a8b638454ea74743e1103faa0545e9a62.zip
cpython-83236f7a8b638454ea74743e1103faa0545e9a62.tar.gz
cpython-83236f7a8b638454ea74743e1103faa0545e9a62.tar.bz2
Issue #24683: Fixed crashes in _json functions called with arguments of
inappropriate type.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_json/test_separators.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_json/test_separators.py b/Lib/test/test_json/test_separators.py
index 84a2be9..8ca5174 100644
--- a/Lib/test/test_json/test_separators.py
+++ b/Lib/test/test_json/test_separators.py
@@ -39,6 +39,12 @@ class TestSeparators:
self.assertEqual(h2, h)
self.assertEqual(d2, expect)
+ def test_illegal_separators(self):
+ h = {1: 2, 3: 4}
+ self.assertRaises(TypeError, self.dumps, h, separators=(b', ', ': '))
+ self.assertRaises(TypeError, self.dumps, h, separators=(', ', b': '))
+ self.assertRaises(TypeError, self.dumps, h, separators=(b', ', b': '))
+
class TestPySeparators(TestSeparators, PyTest): pass
class TestCSeparators(TestSeparators, CTest): pass