Ronald Oussoren <ronaldousso...@mac.com> added the comment:
A better workaround is IMHO to force the socket to be IPV6 only: sd = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0) sd.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1) That avoids the ordering problem as well as having to try all possible combinations of source and destination addreses. I've tested that setting this option makes it impossible to bind a IPv6 socket to an IPv4 address. This is on macOS 10.14.2, I haven't checked other versions of macOS. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35302> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com