Author serhiy.storchaka
Recipients David.Edelsohn, serhiy.storchaka, vstinner
Date 2013-11-18.08:15:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384762557.67.0.713342529405.issue19633@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-11-18 08:15:57serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, David.Edelsohn
2013-11-18 08:15:57serhiy.storchakasetmessageid: <1384762557.67.0.713342529405.issue19633@psf.upfronthosting.co.za>
2013-11-18 08:15:57serhiy.storchakalinkissue19633 messages
2013-11-18 08:15:57serhiy.storchakacreate