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 BreamoreBoy, Nidan, giampaolo.rodola, josiahcarlson, python-dev, stutzbach, vstinner, xdegaye
Date 2014-06-27.21:01:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403902903.56.0.239377554183.issue16133@psf.upfronthosting.co.za>
In-reply-to
Content
Modifying recv() to return None doesn't look correct. I read it as: "you should always use recv() output, except if the result is None: in this case, do nothing". In Python, we use exceptions for that. BUT in fact, sock.recv() already raises an exception, so asyncore should not convert the exception to a magic value (None).

Modifying the behaviour of recv() in asyncore breaks the backward compatibility. Returning None makes it harder to write asyncore code working on Python 3.4 and 3.5 (if the change is done in Python 3.5).

I prefer EWOULDBLOCK.patch approach: document the issue in asyncore documentation and handle BlockingIOError in asynchat.
History
Date User Action Args
2014-06-27 21:01:43vstinnersetrecipients: + vstinner, josiahcarlson, giampaolo.rodola, stutzbach, BreamoreBoy, xdegaye, python-dev, Nidan
2014-06-27 21:01:43vstinnersetmessageid: <1403902903.56.0.239377554183.issue16133@psf.upfronthosting.co.za>
2014-06-27 21:01:43vstinnerlinkissue16133 messages
2014-06-27 21:01:43vstinnercreate