File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 DOT_ATOM_TEXT = DOT_ATOM_TEXT .decode ("ascii" )
4040 ATEXT_HOSTNAME = ATEXT_HOSTNAME .decode ("ascii" )
4141
42+ DEFAULT_TIMEOUT = 15 # secs
43+
4244class EmailNotValidError (ValueError ):
4345 """Parent class of all exceptions raised by this module."""
4446 pass
@@ -56,7 +58,7 @@ def validate_email(
5658 allow_smtputf8 = True ,
5759 allow_empty_local = False ,
5860 check_deliverability = True ,
59- timeout = 0 ):
61+ timeout = DEFAULT_TIMEOUT ):
6062
6163 """Validates an email address, raising an EmailNotValidError if the address is not valid or returning a dict of information
6264 when the address is valid. The email argument can be a str or a bytes instance, but if bytes it must be ASCII-only."""
@@ -234,7 +236,7 @@ def validate_email_domain_part(domain):
234236 "domain_i18n" : domain_i18n ,
235237 }
236238
237- def validate_email_deliverability (domain , domain_i18n , timeout = 0 ):
239+ def validate_email_deliverability (domain , domain_i18n , timeout = DEFAULT_TIMEOUT ):
238240 # Check that the domain resolves to an MX record. If there is no MX record,
239241 # try an A or AAAA record which is a deprecated fallback for deliverability.
240242
You can’t perform that action at this time.
0 commit comments