Open cefn opened 6 years ago
Connecting to an IPv6 network from python3 currently triggers the following error
File "/home/cefn/Documents/shrimping/git/medea/medea/https.py", line 18, in byteGeneratorFactory s.connect(addr) TypeError: getsockaddrarg() takes exactly 2 arguments (4 given)
Which is to do with socket.getaddrinfo(host, 443) not returning the same structure from an IPv6 lookup that it does from IPv4, and the line...
addr = socket.getaddrinfo(host, 443)[0][-1]
...bakes in assumptions about IPv4 address records.
See http://docs.micropython.org/en/latest/wipy/library/usocket.html#socket-address-format-s for details of address format. Probably the use of -1 rather than 1 is the issue
Connecting to an IPv6 network from python3 currently triggers the following error
Which is to do with socket.getaddrinfo(host, 443) not returning the same structure from an IPv6 lookup that it does from IPv4, and the line...
...bakes in assumptions about IPv4 address records.