Skip to content

Add error to socketpool.socket.recv_into when buffer is smaller than explicit size. #3421

Closed
@tannewt

Description

@tannewt

Standard Python signals an error when the specified size is nonzero and bigger than the buffer, which this code doesn't do (yet):

>>> b = bytearray(7)
>>> s = socket.socket()
>>> s.recv_into(b, 8)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: buffer too small for requested bytes```

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions