[issue33450] unexpected EPROTOTYPE returned by sendto on MAC OSX

Ronald Oussoren report at bugs.python.org
Thu May 10 05:50:58 EDT 2018


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

The second link contains an explanation of what's going on, and that this is unexpected behaviour of the macOS kernel.

I'm not sure what we could do about this, the blog post explains that this error can happen when send(2) is called while the socket is teared down. A possible workaround (based on reading the blog post and without fully analysing the side effects) is to treat EPROTOTYPE the same as EGAIN in the python wrappers for send/write/sendto. 

That's easier said than done though, socketmodule.c indirectly calls socket functions through a helper function that does some bookkeeping (including handling EGAIN) and is used for more than just the send calls.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33450>
_______________________________________


More information about the Python-bugs-list mailing list