mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #13774: json: Fix a SystemError when a bogus encoding is passed to
json.loads().
This commit is contained in:
parent
44765e58b0
commit
dee76e627d
3 changed files with 15 additions and 1 deletions
|
@ -80,6 +80,10 @@ class TestUnicode(object):
|
|||
# Issue 10038.
|
||||
self.assertEqual(type(self.loads('"foo"')), unicode)
|
||||
|
||||
def test_bad_encoding(self):
|
||||
self.assertRaises(UnicodeEncodeError, self.loads, '"a"', u"rat\xe9")
|
||||
self.assertRaises(TypeError, self.loads, '"a"', 1)
|
||||
|
||||
|
||||
class TestPyUnicode(TestUnicode, PyTest): pass
|
||||
class TestCUnicode(TestUnicode, CTest): pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue