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 giampaolo.rodola
Recipients Nidan, giampaolo.rodola, josiahcarlson, python-dev, stutzbach
Date 2013-05-02.00:30:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
recv() returning an empty string has always been an alias for "connection lost" though, that is why it cannot be used and I was proposing returning a new type in Python 3.4.

Point is we're paying a bad design decision: asyncore shouldn't have asked the user to call recv() directly in the first place and call a data_received(chunk) callback method instead.

Deciding what's best to do at this point without breaking existent code is not easy, that is why I think that on python <= 3.3 we should fix *asynchat* in order to take EAGAIN/EWOULDBLOCK into account and leave asyncore's recv() alone.
The issue would still exist but it would be mitigated by the fact that who wants to write a protocol is likely to use asynchat, not asyncore.

As for Python 3.4 we can:

- make asyncore's recv() return None and document it
- deprecate recv()
- introduce data_received(chunk)
Date User Action Args
2013-05-02 00:30:50giampaolo.rodolasetrecipients: + giampaolo.rodola, josiahcarlson, stutzbach, python-dev, Nidan
2013-05-02 00:30:50giampaolo.rodolasetmessageid: <>
2013-05-02 00:30:50giampaolo.rodolalinkissue16133 messages
2013-05-02 00:30:49giampaolo.rodolacreate