commit | 45c41494bf4992d6c2a0bd1fca3d0dff164ec4ba | [log] [tgz] |
---|---|---|
author | Philip Jenvey <pjenvey@underboss.org> | Fri Oct 26 17:01:53 2012 -0700 |
committer | Philip Jenvey <pjenvey@underboss.org> | Fri Oct 26 17:01:53 2012 -0700 |
tree | a9d7476ad71104566d8b3dc591450cb039f3d90f | |
parent | a20879ffc8dfebab5b6949bed9b13453c8a6cde3 [diff] [blame] |
bounds check for bad data (thanks amaury)
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index f342d88..42d0da3 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py
@@ -645,6 +645,8 @@ self.assertEqual(b"abc\xed\xa0\x80def".decode("utf-8", "surrogatepass"), "abc\ud800def") self.assertTrue(codecs.lookup_error("surrogatepass")) + with self.assertRaises(UnicodeDecodeError): + b"abc\xed\xa0".decode("utf-8", "surrogatepass") class UTF7Test(ReadTest): encoding = "utf-7"