[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 string.

--
messages: 100308
nosy: Matt.Gattis
severity: normal
status: open
title: mmap buffer implementation does not respect seek pos
versions: Python 2.6

___
Python tracker 
<http://bugs.python.org/issue8042>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8104] socket.recv_into doesn't support a memoryview as an argument

2010-03-09 Thread Matt Gattis

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 pinned buffer, not memoryview

--
components: IO
messages: 100773
nosy: Matt.Gattis
severity: normal
status: open
title: socket.recv_into doesn't support a memoryview as an argument
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue8104>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9229] memoryview of mmap object not working in 2.7

2010-07-11 Thread Matt Gattis

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 object does not have the buffer 
interface

--
components: Extension Modules, IO
messages: 110063
nosy: Matt.Gattis
priority: normal
severity: normal
status: open
title: memoryview of mmap object not working in 2.7
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue9229>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com