#2453: Error when logging out with non-ascii user name
------------------------+---------------------------------------------------
Reporter: chrisz | Owner:
Type: defect | Status: new
Priority: high | Milestone: 2.1
Component: TurboGears | Version: trunk
Severity: normal | Keywords:
------------------------+---------------------------------------------------
After some patches for #2438 it is now possible to log in with a non-ascii
username. However, when I try to log out, I get exceptions like this one:
{{{
URL: http://localhost:8080/logout_handler
File '.../weberror-0.10.1-py2.6.egg/weberror/evalexception.py', line 431
in respond
app_iter = self.application(environ, detect_start_response)
File '.../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 133
in __call__
app_iter = challenge_app(environ, start_response)
File '.../paste/httpexceptions.py', line 269 in wsgi_application
headers, content = self.prepare_content(environ)
File '.../paste/trunk/paste/httpexceptions.py', line 244 in
prepare_content
content = self.html(environ)
File '.../paste/trunk/paste/httpexceptions.py', line 229 in html
body = self.make_body(environ, self.template, html_quote, no_quote)
File '.../paste/trunk/paste/httpexceptions.py', line 205 in make_body
args[k] = escfunc(v)
File '.../paste/trunk/paste/util/quoting.py', line 37 in html_quote
return cgi.escape(unicode(v).encode(encoding), 1)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 330:
ordinal not in range(128)
}}}
This seems to be caused by Paste trying to get a unicode representation of
a webob.Request which has utf-8 chars in it. Unfortunately, Paste cannot
deal with such requests (see [http://groups.google.de/group/paste-
users/browse_thread/thread/a5de15e6b46873ea here]).
In this case, the utf-8 char is in the cookie set by repoze.what.authtkt
which includes the utf-8 encoded user name in the 'authtkt' cookie. (Maybe
repoze.what.authtkt should better convert the cookie to a pure 7-bit
representation like the standard Python Cookie lib does?)
The reason why Paste tries to get a representation of the request seems to
have something to do with the add_dbsession_remover_middleware method in
turbogears.configuration.
--
Ticket URL: <http://trac.turbogears.org/ticket/2453>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en