diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-02-25 23:27:38 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-02-25 23:27:38 (GMT) |
commit | 29ec595c6a705428784d24eb7e03681637c4eb03 (patch) | |
tree | d63517b2a435e09cbdf6126c6509b5a74a1cea06 /Lib/test/test_array.py | |
parent | d21b58c05d5e187bb736dc913da6ddefd9c9d8b3 (diff) | |
download | cpython-29ec595c6a705428784d24eb7e03681637c4eb03.zip cpython-29ec595c6a705428784d24eb7e03681637c4eb03.tar.gz cpython-29ec595c6a705428784d24eb7e03681637c4eb03.tar.bz2 |
Issue #17223: array module: Fix a crasher when converting an array containing
invalid characters (outside range [U+0000; U+10ffff]) to Unicode: repr(array),
str(array) and array.tounicode(). Patch written by Manuel Jacob.
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-x | Lib/test/test_array.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index a532a9f..bfef4fa 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -1069,6 +1069,12 @@ class UnicodeTest(StringTest, unittest.TestCase): self.assertRaises(TypeError, a.fromunicode) + def test_issue17223(self): + # this used to crash + a = array.array('u', b'\xff' * 4) + self.assertRaises(ValueError, a.tounicode) + self.assertRaises(ValueError, str, a) + class NumberTest(BaseTest): def test_extslice(self): |