mirror of
https://github.com/python/cpython.git
synced 2025-09-18 14:40:43 +00:00
(Merge 3.3) 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.
This commit is contained in:
commit
25c3053a4f
3 changed files with 12 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue