Skip to content

Commit 5b93077

Browse files
committed
fix #50: return correct error message strings
I was doing a spurious encode of the unicode input before constructing the error string, probably because I thought you couldn't hand a unicode string argument to the format of a non-unicode string, or else I thought assertions couldn't have unicode messages. No matter what I thought, it was wrong.
1 parent 551f55f commit 5b93077

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

umapi_client/functional.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,10 @@ def _validate(cls, email=None, username=None, domain=None):
7777
:param domain: a domain
7878
'''
7979
if email and not cls._email_regex.match(email):
80-
email = email.encode('utf-8')
8180
raise ValueError("'%s': Illegal email format (must be ascii, unquoted, with no comment part)" % (email,))
8281
if domain and not cls._domain_regex.match(domain):
83-
domain = domain.encode('utf-8')
8482
raise ValueError("'%s': Illegal domain format" % (domain,))
8583
if username and not cls._username_regex.match(username):
86-
username = username.encode('utf-8')
8784
raise ValueError("'%s': Illegal username format (must be unquoted email local part)" % (username,))
8885

8986
def __init__(self, id_type=IdentityTypes.adobeID, email=None, username=None, domain=None, **kwargs):

0 commit comments

Comments
 (0)