summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_json
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-07-26 06:02:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-07-26 06:02:23 (GMT)
commitf002225f7e0b82af64f5f524ed870b83a226557c (patch)
treec4f24d4771ff8fc15750eb177cbd535552fd56cf /Lib/test/test_json
parent940d69d4441393fc15f3418364d305cd683ad983 (diff)
parent83236f7a8b638454ea74743e1103faa0545e9a62 (diff)
downloadcpython-f002225f7e0b82af64f5f524ed870b83a226557c.zip
cpython-f002225f7e0b82af64f5f524ed870b83a226557c.tar.gz
cpython-f002225f7e0b82af64f5f524ed870b83a226557c.tar.bz2
Issue #24683: Fixed crashes in _json functions called with arguments of
inappropriate type.
Diffstat (limited to 'Lib/test/test_json')
-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