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.

Author vstinner
Recipients asvetlov, vstinner, yselivanov
Date 2020-08-03.22:19:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org>
In-reply-to
Content
The proactor event loop of asyncio returns b'' on recv_into() if the socket/pipe is closed:

    def recv_into(self, conn, buf, flags=0):
        ...
        try:
            ...
        except BrokenPipeError:
            return self._result(b'')
        ...

But a socket recv_into() must always return a number: the number of written bytes. Example with socket.socket.recv_into() method:
https://docs.python.org/3/library/socket.html#socket.socket.recv_into

IMHO zero must be returned here. This bug may be the root cause of bpo-38912 bug.

Attached PR fix the issue.
History
Date User Action Args
2020-08-03 22:19:50vstinnersetrecipients: + vstinner, asvetlov, yselivanov
2020-08-03 22:19:49vstinnersetmessageid: <1596493189.98.0.797069593692.issue41467@roundup.psfhosted.org>
2020-08-03 22:19:49vstinnerlinkissue41467 messages
2020-08-03 22:19:49vstinnercreate