summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_codecs.py
diff options
context:
space:
mode:
authorPhilip Jenvey <pjenvey@underboss.org>2012-10-27 00:01:53 (GMT)
committerPhilip Jenvey <pjenvey@underboss.org>2012-10-27 00:01:53 (GMT)
commit45c41494bf4992d6c2a0bd1fca3d0dff164ec4ba (patch)
treea9d7476ad71104566d8b3dc591450cb039f3d90f /Lib/test/test_codecs.py
parenta20879ffc8dfebab5b6949bed9b13453c8a6cde3 (diff)
downloadcpython-45c41494bf4992d6c2a0bd1fca3d0dff164ec4ba.zip
cpython-45c41494bf4992d6c2a0bd1fca3d0dff164ec4ba.tar.gz
cpython-45c41494bf4992d6c2a0bd1fca3d0dff164ec4ba.tar.bz2
bounds check for bad data (thanks amaury)
Diffstat (limited to 'Lib/test/test_codecs.py')
-rw-r--r--Lib/test/test_codecs.py2
1 files changed, 2 insertions, 0 deletions
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 @@ class UTF8Test(ReadTest):
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"