auth.login_bare with unicode

20 views
Skip to first unread message

Arthur Schneider

unread,
Sep 26, 2022, 7:12:59 AM9/26/22
to web2py-users
Hello Guys,
i need some help with a login_bare issue on our production server. We are running:

2.18.5-stable+timestamp.2019.04.08.04.22.03
( gunicorn/19.7.1, Python 2.7.15+)

We are getting an 
   UnicodeEncodeError'ascii' codec can't encode character
Error with login_bare(...)

The user password contains german characters ("ö","ü","ä")

Here is some trace output:
login_success = auth.login_bare(username, password)
File "/root/web2py/gluon/tools.py", line 2280, in login_bare
settings.passfield].validate(password)[0]
File "/root/web2py/gluon/packages/dal/pydal/objects.py", line 1996, in validate
(value, error) = validator(value)
File "/root/web2py/gluon/packages/dal/pydal/validators.py", line 145, in __call__
return self.validate(value), None
File "/root/web2py/gluon/packages/dal/pydal/validators.py", line 3031, in validate
v = value and str(value)[:self.max_length]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 7: ordinal not in range(128)

Is there a workaround without changing the user password?

Best regards
Arthur

Reply all
Reply to author
Forward
0 new messages