STINNER Victor added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16133>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to