-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6 addresses do not quite work as advertised #124
Comments
[] format is the (only) correct way to enter IP only IPv6 as a URI. |
Indeed. But user of convenience api should not care. Or alternatively it should be documented. |
before this is implemented and added, are there any 1) ambiguous strings that are both valid IPv6 literals and valid hostnames, or 2) surprising IPv6 literals that look confusingly like a valid hostname (or vice versa)? none come to my mind If none, I agree: furl should implicitly accept @fingon do you have time to submit a PR to fix this? py3 has the handy https://docs.python.org/3/library/ipaddress.html module to help a dependency may be needed for py2 |
Well, the support is not uniform at all: >>> import socket
>>> socket.inet_pton(socket.AF_INET6,'::')
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
>>> socket.inet_pton(socket.AF_INET6,'[::]')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: illegal IP address string passed to inet_pton On python it seems that some of the builtin features based on libc will depend on how libc handles brackets in IPV6. |
Sure an api that does not accept url does not accept url style IPs. But is that unexpected? Socket deals with ips directly. |
As the documentation says 'host' can accept IPv6 address, it is not quite right :)
At least as user I'd be happier if []s just showed up, and IPv6 address was compressed automatically (e.g.
str(ip_address.ipaddress(addr))
)The text was updated successfully, but these errors were encountered: