[issue35302] create_connection with local_addr misses valid socket bindings

2018-12-20 Thread twisteroid ambassador
twisteroid ambassador added the comment: I don't have a Mac, so I have not tested Ronald's workaround. Assuming it works, we will have to either i) implement platform-specific behavior and only apply IPV6_V6ONLY on macOS for each AF_INET6 socket created, or ii) apply it to all AF_INET6

[issue35302] create_connection with local_addr misses valid socket bindings

2018-12-19 Thread Ronald Oussoren
Ronald Oussoren 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

[issue35302] create_connection with local_addr misses valid socket bindings

2018-12-19 Thread twisteroid ambassador
Change by twisteroid ambassador : -- keywords: +patch pull_requests: +10471 stage: -> patch review ___ Python tracker ___ ___

[issue35302] create_connection with local_addr misses valid socket bindings

2018-12-19 Thread twisteroid ambassador
twisteroid ambassador added the comment: IMO macOS is at fault here, for even allowing an IPv6 socket to bind to an IPv4 address. ;-) I have given some thought about this issue when writing my happy eyeballs library. My current solution is closest to Neil's first suggestion, i.e. each pair

[issue35302] create_connection with local_addr misses valid socket bindings

2018-11-23 Thread Neil Booth
New submission from Neil Booth : I run a machine with IPv4 and IPv6 interfaces on MacOSX Mojave. I try to loop.create_connection() to a remote machine whose domain resolves to an IPv6 address only, with a local_addr domain name argument that resolves to two local addresses: an IPv4 one first