Author tjollans
Recipients tjollans
Date 2010-06-13.19:42:51
SpamBayes Score 0.000152113
Marked as misclassified No
Message-id <1276458174.59.0.784735349158.issue8990@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, the array constructor, if given a bytearray, detects this with PyByteArray_Check, and hands it on to array_fromstring, which does not support bytearray (by using "s#" with PyArg_ParseTuple) and raises TypeError.

>>> array('h', bytearray(b'xyxyxyxyxyxyxyxyxy'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: must be bytes or read-only buffer, not bytearray
>>>  


I see no reason to insist on read-only buffers. I'm attaching a patch that I think fixes this.
History
Date User Action Args
2010-06-13 19:42:55tjollanssetrecipients: + tjollans
2010-06-13 19:42:54tjollanssetmessageid: <1276458174.59.0.784735349158.issue8990@psf.upfronthosting.co.za>
2010-06-13 19:42:52tjollanslinkissue8990 messages
2010-06-13 19:42:52tjollanscreate