STINNER Victor added the comment:

Guido wrote:
"This still leaves case (1), where the FD is already bad when we register it.  
I am actually fine with sometimes raising and sometimes not; I don't want to 
pay the extra overhead of doing an fstat() or some other syscall just to verify 
that it is valid.  (Although this would make the argument about wanting to 
choose a selector class that doesn't make extra syscalls less compelling. :-)  
And neither do I want to ignore the error in register() and pretend success."

The asyncio has a debug mode which can execute expensive checks. These checks 
would not be acceptable in release mode since they are an impact on 
performances. In debug mode, asyncio can explicitly call fstat() before calling 
selector.register() or selector.modify().

This solution may be suggested in the documentation if someone wants a portable 
behaviour for all selector.

----------

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

Reply via email to