Christian Heimes <[email protected]> added the comment:
> inet_pton() requires an address family. Should we iterate on all supported
> address families until one works?
No, that is not necessary. inet_aton() only accepts IPv4 addresses. Therefore
an emulation with inet_pton() would look like this:
>>> import functools, socket
>>> inet_aton = functools.partial(socket.inet_pton, socket.AF_INET)
>>> inet_aton('127.0.0.1')
b'\x7f\x00\x00\x01'
> inet_pton() doesn't accept IPv4 "short format" like "127"
Yes, that might be a problem.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37495>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com