Skip to content

Conversation

@yassam
Copy link
Contributor

@yassam yassam commented Sep 21, 2021

There's a bug in method __eq__() of ValidatedEmail. It doesn't check whether other is an instance of type ValidatedEmail, so the following fails:

>>> from email_validator import validate_email
>>> v = validate_email('foo@test.com')
>>> v == "hello"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yhassan/source/deferit/deferit/.env/lib/python3.8/site-packages/email_validator/__init__.py", line 146, in __eq__
    self.email == other.email
AttributeError: 'str' object has no attribute 'email'

Now checks parameter other is an instance of ValidatedEmail before checking all its members are equal to self's members.

Check parameter `other` is an instance of ValidatedEmail before
checking all its members are equal to self's members.
@JoshData JoshData merged commit fbcf145 into JoshData:primary Sep 22, 2021
@JoshData
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants