This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: socket.recv_into doesn't support a memoryview as an argument
Type: enhancement Stage: resolved
Components: IO Versions: Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pitrou Nosy List: Matt.Gattis, pitrou
Priority: normal Keywords: patch

Created on 2010-03-10 00:29 by Matt.Gattis, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
recvinto.patch pitrou, 2010-03-12 18:51
Messages (4)
msg100773 - (view) Author: Matt Gattis (Matt.Gattis) Date: 2010-03-10 00:29
>>> view = memoryview(bytearray(bufsize))
>>> while len(view):
...    view = view[sock.recv_into(view,1024):]
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
TypeError: recv_into() argument 1 must be pinned buffer, not memoryview
msg100941 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-03-12 16:10
I suppose recvfrom_into() should also be converted.
msg100953 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-03-12 18:51
Here is a patch.
msg101246 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-03-17 22:51
Committed in trunk, and additional tests ported to py3k.
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52351
2010-03-17 22:51:09pitrousetstatus: open -> closed
resolution: fixed
messages: + msg101246

stage: patch review -> resolved
2010-03-12 18:51:20pitrousetfiles: + recvinto.patch
priority: normal
messages: + msg100953

keywords: + patch
type: enhancement
stage: patch review
2010-03-12 16:10:16pitrousetmessages: + msg100941
2010-03-11 07:47:02georg.brandlsetassignee: pitrou

nosy: + pitrou
2010-03-10 00:29:58Matt.Gattiscreate