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
IPAddress validator return False for valid IPv6 address. #385
Comments
How about to use a default ipaddress module for validation purposes in this case or something like this: |
Yes, I'd like to do that. |
So we can implement checks by means socket module that available on both versions of Python and reduce the length of the code significantly. |
I'm using a custom validator based on the |
The dependency needs to be optional: try:
import ipaddress
except ImportError:
ipaddress = None
class SomeValidator:
def __init__(self, ...):
if ipaddress is None:
raise Exception("Install 'ipaddress' for Python 2 support.")
... PRs welcome. |
Thanks @davidism then I will prepare one :) I have to rewrite the tests, to fit in the WTForms test suite, because I'm using slightly different environment for my tests. |
We're using PyTest now, so feel free to ignore the existing unittest layout, I just haven't got around to rewriting them yet. |
That's good, because I'm using pytest fixtures and mock. So I will use it in the PR and we can discuss necessary changes later. |
The PR was created. Please let me know if anything needs to be changed. |
Hello,
the address "2001:718:1C01:1111::" is valid IPv6 address, however, the IPAddress validator returns False for it.
The text was updated successfully, but these errors were encountered: