python-validators / validators

Python Data Validation for Humans™.
MIT License
977 stars 155 forks source link

validators.ipv6 fails to correctly validate compressed ipv6 addresses with trailing colon #176

Closed robbymeals closed 2 years ago

robbymeals commented 4 years ago
$ pip freeze | grep validators
validators==0.18.0
$ ipython
Loading .env environment variables…
Python 3.7.8 (default, Aug 25 2020, 19:28:30)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.17.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import validators

In [2]: import ipaddress

In [3]: validators.ipv6("0000:0000:0000:0000:0000::")
Out[3]: ValidationFailure(func=ipv6, args={'value': '0000:0000:0000:0000:0000::'})

In [4]: validators.ipv6(ipaddress.IPv6Address("0000:0000:0000:0000:0000::").exploded)
Out[4]: True