Message77095
| Author |
gumpy |
| Recipients |
gumpy, pitrou |
| Date |
2008年12月06日.02:10:22 |
| SpamBayes Score |
4.762752e-08 |
| Marked as misclassified |
No |
| Message-id |
<1228529424.11.0.233407832971.issue4509@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|