From 791be1a8177f9f85f17e7755436222a60831839d Mon Sep 17 00:00:00 2001 From: nakamichi Date: Mon, 17 May 2021 18:58:43 +0900 Subject: [PATCH] Do not use ascii encode (#8) --- netcleanser/email.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netcleanser/email.py b/netcleanser/email.py index 2ba3022..6205a37 100644 --- a/netcleanser/email.py +++ b/netcleanser/email.py @@ -6,7 +6,7 @@ DOMAIN_NAME_REGEX: Final[str] = re.compile(r'(([\da-zA-Z])([_\w-]{,62})\.){,127}(([\da-zA-Z])[_\w-]{,61})?([\da-zA-Z]\.((xn\-\-[a-zA-Z\d]+)|([a-zA-Z\d]{2,})))', re.IGNORECASE) def _looks_domain(x: str) -> bool: - domain_name = x.lower().strip().encode('ascii') + domain_name = x.lower().strip() return True if re.match(DOMAIN_NAME_REGEX, x) else False def _automatic_correction(email: str) -> str: