Skip to content

SSLSocket.recv_into(None) returns a bytes object #112457

Open
@serhiy-storchaka

Description

@serhiy-storchaka

Normally, SSLSocket.recv_into(buffer) returns an integer -- the number of bytes read into buffer. But if buffer is None and the SSL connection is opened (self._sslobj is not None), it is equivalent to SSLSocket.read(1024) -- read up to 1024 bytes and return the read bytes.

It looks weird and I wonder whether there is a use case for this. This behavior was from the start, from 6e027db where this method was added, so I do not see some obvious error that was introduced later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions