Open mithunmanohar opened 5 years ago
Try adding:
from functools import reduce
def ilen(iterable):
return reduce(lambda sum, element: sum + 1, iterable, 0)
Then change the lookup_domain method in validate.py:
len_mx_hosts = ilen(_get_dns_lookup()[fqdn])
if len_mx_hosts == 0:
return None
+1
Getting the same issue when trying to validate. The validate_address
method seems like a pretty essential api method and it is completely broken.
from flanker.addresslib import address
print(address.validate_address('robbymurphy@gmail.com'))
...
File "/Users/rmurphy/.pyenv/versions/3.6.0/lib/python3.6/site-packages/flanker/addresslib/validate.py", line 210, in lookup_domain
if len(mx_hosts) == 0:
TypeError: object of type 'filter' has no len()
+1 Python (CPython 3.7.3), Flask 1.0.2, same line as above (@robbymurphy ). TypeError: object of type 'filter' has no len()
if len(mx_hosts) == 0:
I am having the exact same issue... Can anyone help.... I tried the option suggested by @amk5.. still no luck
Updating to 0.9.11 fix this issue for me.
When I am trying to validate a email, getting the below error both in python 2 and 3.