Message77095
I found another related bug. In bytes_setslice, when the buffer is
resized to a smaller size, a memmove happens regardless of whether the
resize is successful or not.
>>> b = bytearray(range(10))
>>> m = memoryview(b)
>>> b[1:8] = b'X'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
BufferError: Existing exports of data: object cannot be re-sized
>>> b
bytearray(b'\x00\x01\x08\t\x04\x05\x06\x07\x08\t')
The same problem also applies to bytes_remove:
>>> b
bytearray(b'\x02\x03\x04\x05\x06\x07\x08\t')
>>> b.remove(2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
BufferError: Existing exports of data: object cannot be re-sized
>>> b
bytearray(b'\x03\x04\x05\x06\x07\x08\t\x00')
There may be other places this can happen but I haven't checked yet. |
|
Date |
User |
Action |
Args |
2008-12-06 02:10:24 | gumpy | set | recipients:
+ gumpy, pitrou |
2008-12-06 02:10:24 | gumpy | set | messageid: <1228529424.11.0.233407832971.issue4509@psf.upfronthosting.co.za> |
2008-12-06 02:10:23 | gumpy | link | issue4509 messages |
2008-12-06 02:10:22 | gumpy | create | |
|