[issue8042] mmap buffer implementation does not respect seek pos

2010-08-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: If you want to slice into a writable buffer, you can use a memoryview: >>> b = io.BytesIO(b"abc") >>> m = mmap.mmap(-1, 10) >>> b.readinto(memoryview(m)[5:]) 3 >>> m[:] b'\x00\x00\x00\x00\x00abc\x00\x00' This only works on 3.x, though. As for changing the mmap

[issue8042] mmap buffer implementation does not respect seek pos

2010-08-01 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: -> pitrou nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8042] mmap buffer implementation does not respect seek pos

2010-03-02 Thread Matt Gattis
New submission from Matt Gattis : If you do: import io,mmap b = io.BytesIO("abc") m = mmap.mmap(-1,10) m.seek(5) b.readinto(m) M is now: 'abc\x00\x00\x00\x00\x00\x00\x00' Basically there is no way to readinto/recv_into an arbitary position in an mmap object without creating a middle-man stri