Checking support for network connections from Python client to IPv6 server

Markus Elfring Markus.Elfring at web.de
Sun Jun 2 03:15:28 EDT 2019


>> How would like to explain the error message “socket.gaierror: [Errno -9]
>> Address family for hostname not supported” on my Linux test system then?
>
> Can you supply a tiny standalone piece of code demonstrating this error please?

The following script part would be relevant.

…
def send_data(x):
   with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as so:
       global args
       so.connect((args.server_id, args.server_port))
…


If the address family “AF_INET6” was passed instead, the identification “::1”
can work also as a command parameter.
The data transmission seems to succeed by my script “socket-send_json_data2.py” then.

Regards,
Markus



More information about the Python-list mailing list