Ticket #2452 (closed defect: fixed)
Error when logging in with non-ascii password
| Reported by: | chrisz | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 2.1rc1 |
| Component: | TurboGears | Version: | trunk |
| Severity: | major | Keywords: | login |
| Cc: |
Description
When I login to a quickstarted app and enter a non-ascci character in the password, I get exceptions like this one
URL: http://localhost:8080/login_handler?__logins=0&came_from=%2F File '.../weberror-0.10.1-py2.6.egg/weberror/evalexception.py', line 431 in respond app_iter = self.application(environ, detect_start_response) File '.../turbogears/hg/tg-dev/tg/configuration.py', line 760 in remover return app(environ, start_response) File '.../repoze.tm2-1.0a5-py2.6.egg/repoze/tm/__init__.py', line 23 in __call__ result = self.application(environ, save_status_and_headers) File '.../repoze.who-1.0.18-py2.6.egg/repoze/who/middleware.py', line 69 in __call__ auth_ids = self.authenticate(environ, classification, ids) File '.../repoze.who-1.0.18-py2.6.egg/repoze/who/middleware.py', line 201 in authenticate userid = plugin.authenticate(environ, identity) File '.../repoze.who.plugins.sa-1.0rc2_r3742-py2.6.egg/repoze/who/plugins/sa.py', line 118 in authenticate if validator(identity['password']): File '.../myapp/myapp/model/auth.py', line 194 in validate_password hashed_pass.update(password + self.password[:40]) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 1: ordinal not in range(128)
Mind you, this happens independent of whether the user has an ascii or non-ascii password. When this is fixed, we should also ensure that a user really can have a non-ascii password.
Change History
Note: See
TracTickets for help on using
tickets.
This could be fixed easily in dda7868fed3d.