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 martin.panter
Recipients SilentGhost, martin.panter, nascheme
Date 2016-07-17.23:52:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468799573.49.0.783421887988.issue27377@psf.upfronthosting.co.za>
In-reply-to
Content
The Windows problem, error 10022 = WSAEINVAL from getsockname(), seems to be documented at <https://msdn.microsoft.com/en-us/library/windows/desktop/ms738543%28v=vs.85%29.aspx>: “The socket has not been bound”.

Regarding the SCTP problem, raising an error seems like an OS bug to  me. However, according to POSIX <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getsockname.html>, we cannot rely on getsockname() indicating any particular address family if the socket is unbound.

So on some platforms, it seems like it will only work with bound sockets, or you have to use less-standard options like SO_PROTOCOL_INFO or SO_DOMAIN. Although SO_DOMAIN won’t help on Free BSD. The simplest solution may be to document and test that it only works with bound sockets.

For the problem with SO_PROTOCOL being unsupported at run-time, I think it would be better to anticipate EINVAL now, rather than wait for someone to complain. But it is not a big deal.
History
Date User Action Args
2016-07-17 23:52:53martin.pantersetrecipients: + martin.panter, nascheme, SilentGhost
2016-07-17 23:52:53martin.pantersetmessageid: <1468799573.49.0.783421887988.issue27377@psf.upfronthosting.co.za>
2016-07-17 23:52:53martin.panterlinkissue27377 messages
2016-07-17 23:52:53martin.pantercreate