Message107744
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. |
|
Date |
User |
Action |
Args |
2010-06-13 19:42:55 | tjollans | set | recipients:
+ tjollans |
2010-06-13 19:42:54 | tjollans | set | messageid: <1276458174.59.0.784735349158.issue8990@psf.upfronthosting.co.za> |
2010-06-13 19:42:52 | tjollans | link | issue8990 messages |
2010-06-13 19:42:52 | tjollans | create | |
|