Message203251
array's constructor interprets its second memoryview argument as an iterable of integers.
>>> import array
>>> array.array('h', b'abcd')
array('h', [25185, 25699])
>>> array.array('h', memoryview(b'abcd'))
array('h', [97, 98, 99, 100])
array.frombytes() always interpret its argument as bytes-like object.
>>> a = array.array('h')
>>> a.frombytes(memoryview(b'abcd'))
>>> a
array('h', [25185, 25699])
First patch fixes only a half of the issue. test_unseekable_incompleted_write() still failed because array.fromfile() fails read incomplete data. Second patch also adds unittest.expectedFailure decorators for these tests. |
|
Date |
User |
Action |
Args |
2013-11-18 08:15:57 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, vstinner, David.Edelsohn |
2013-11-18 08:15:57 | serhiy.storchaka | set | messageid: <1384762557.67.0.713342529405.issue19633@psf.upfronthosting.co.za> |
2013-11-18 08:15:57 | serhiy.storchaka | link | issue19633 messages |
2013-11-18 08:15:57 | serhiy.storchaka | create | |
|