New submission from Matt Gattis :
This code works in 3.1.2 but not in 2.7:
>>> import mmap
>>> m = mmap.mmap(-1,20)
>>> v = memoryview(m)
Traceback (most recent call last):
File "", line 1, in
TypeError: cannot make memory view because objec
New submission from Matt Gattis :
>>> view = memoryview(bytearray(bufsize))
>>> while len(view):
...view = view[sock.recv_into(view,1024):]
...
Traceback (most recent call last):
File "", line 2, in
TypeError: recv_into() argument 1 must be p
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 c