Re: [TurboGears] #2453: Error when logging out with non-ascii user name

11 views
Skip to first unread message

TurboGears

unread,
Feb 1, 2010, 4:46:48 PM2/1/10
to turbogear...@googlegroups.com
#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 | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Comment (by Gustavo):

Replying to [ticket:2453 chrisz]:
> 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.

Just a quick correction: It's a repoze.who built-in plugin (auth_tkt) the
one in charge of that. ;-)

--
Ticket URL: <http://trac.turbogears.org/ticket/2453#comment:1>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

TurboGears

unread,
Feb 1, 2010, 11:10:45 AM2/1/10
to turbogear...@googlegroups.com
#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

unread,
Feb 22, 2010, 7:44:30 PM2/22/10
to turbogear...@googlegroups.com
#2453: Error when logging out with non-ascii user name
------------------------+---------------------------------------------------
Reporter: chrisz | Owner:
Type: defect | Status: new
Priority: high | Milestone: 2.1b2
Component: TurboGears | Version: trunk
Severity: normal | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Changes (by mramm):

* milestone: 2.1 => 2.1b2

--
Ticket URL: <http://trac.turbogears.org/ticket/2453#comment:2>

TurboGears

unread,
Feb 23, 2010, 7:17:59 PM2/23/10
to turbogear...@googlegroups.com
#2453: Error when logging out with non-ascii user name
------------------------+---------------------------------------------------
Reporter: chrisz | Owner:
Type: defect | Status: closed
Priority: high | Milestone: 2.1b2
Component: TurboGears | Version: trunk
Severity: normal | Resolution: fixed
Keywords: |
------------------------+---------------------------------------------------
Changes (by percious):

* status: new => closed
* resolution: => fixed

--
Ticket URL: <http://trac.turbogears.org/ticket/2453#comment:3>

TurboGears

unread,
Feb 23, 2010, 8:06:42 PM2/23/10
to turbogear...@googlegroups.com
#2453: Error when logging out with non-ascii user name
------------------------+---------------------------------------------------
Reporter: chrisz | Owner:
Type: defect | Status: reopened
Priority: high | Milestone: 2.1b2
Component: TurboGears | Version: trunk
Severity: normal | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Comment (by chrisz):

Sorry, I overlooked that you reopened this again, so I guess this was only
a mistake.

--
Ticket URL: <http://trac.turbogears.org/ticket/2453#comment:6>

TurboGears

unread,
Feb 23, 2010, 7:18:43 PM2/23/10
to turbogear...@googlegroups.com
#2453: Error when logging out with non-ascii user name
------------------------+---------------------------------------------------
Reporter: chrisz | Owner:
Type: defect | Status: reopened
Priority: high | Milestone: 2.1b2
Component: TurboGears | Version: trunk
Severity: normal | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Changes (by percious):

* status: closed => reopened
* resolution: fixed =>

--
Ticket URL: <http://trac.turbogears.org/ticket/2453#comment:4>

TurboGears

unread,
Feb 23, 2010, 8:03:50 PM2/23/10
to turbogear...@googlegroups.com
#2453: Error when logging out with non-ascii user name
------------------------+---------------------------------------------------
Reporter: chrisz | Owner:
Type: defect | Status: reopened
Priority: high | Milestone: 2.1b2
Component: TurboGears | Version: trunk
Severity: normal | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Comment (by chrisz):

Where and how has this been solved? Please always record a hint for us
when closing a ticket.

--
Ticket URL: <http://trac.turbogears.org/ticket/2453#comment:5>

TurboGears

unread,
Mar 1, 2010, 4:20:02 PM3/1/10
to turbogear...@googlegroups.com
#2453: Error when logging out with non-ascii user name
------------------------+---------------------------------------------------
Reporter: chrisz | Owner:
Type: defect | Status: reopened
Priority: high | Milestone: 2.1b2
Component: TurboGears | Version: trunk
Severity: blocker | Resolution:
Keywords: |
------------------------+---------------------------------------------------
Changes (by percious):

* severity: normal => blocker

--
Ticket URL: <http://trac.turbogears.org/ticket/2453#comment:7>

Reply all
Reply to author
Forward
0 new messages