[issue7827] recv_into() argument 1 must be pinned buffer, not bytearray

Mark Nottingham report at bugs.python.org
Sat Feb 4 09:18:53 CET 2012


Mark Nottingham <mnot at mnot.net> added the comment:

Seems to be fixed in 2.7, although I'm not sure when exactly :

Python 2.7.2 (default, Oct 21 2011, 22:13:39) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> sock = socket.socket()
>>> sock.connect( ("python.org", 80) )
>>> sock.send(b"GET / HTTP/1.0\r\n\r\n")
18
>>> buf = bytearray(b" " * 10)
>>> sock.recv_into(buf)
10
>>> print buf
HTTP/1.1 3

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7827>
_______________________________________


More information about the Python-bugs-list mailing list