From f6288d8cf90ad0782129b9e6780da1fa0c8c6fa0 Mon Sep 17 00:00:00 2001 From: Yann 'Ze' Richard Date: Tue, 25 Feb 2020 18:15:41 +0100 Subject: [PATCH] Fix: use rpartition to parse emails with '@' in the local part exemple : "joh@n.smith"@example.org who are RFC compliant. --- email_split/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email_split/__init__.py b/email_split/__init__.py index 6421c58..6eca9ca 100644 --- a/email_split/__init__.py +++ b/email_split/__init__.py @@ -11,7 +11,7 @@ def split_email(cls, email): """Break up an email and initialize a new class""" # Break up our email at its `@` # https://docs.python.org/2/library/stdtypes.html#str.partition - local, _, domain = email.partition('@') + local, _, domain = email.rpartition('@') # Initialize and return our class return Email(local=local, domain=domain)