#2118: UnicodeDecodeError when using unicode in URLs
-------------------------+--------------------------------------------------
Reporter: streawkceur | Owner: faide
Type: defect | Status: new
Priority: normal | Milestone: 1.1
Component: TurboGears | Version: 1.0.7
Severity: normal | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Comment (by streawkceur):
I just quickstarted a new project and added a default method to the Root
controller:
{{{
@expose()
def default(self, *args, **kwargs):
return 'default'
}}}
When I open this URL http://localhost:8080/%C3%BC (UTF-8 "ΓΌ") I get a 500:
{{{
Unrecoverable error in the server.
Page handler: 'ordinal not in range(128)'
Traceback (most recent call last):
File "/Library/Python/2.5/site-
packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cpwsgi.py", line 125, in
wsgiApp
environ['wsgi.input'])
File "/Library/Python/2.5/site-
packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cphttptools.py", line 88, in
run
_cputil.get_special_attribute("_cp_log_access", "_cpLogAccess")()
File "/Library/Python/2.5/site-
packages/TurboGears-1.0.7-py2.5.egg/turbogears/controllers.py", line 507,
in _cp_log_access
self.accesslog.info(s.encode('utf8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11:
ordinal not in range(128)
}}}
OS X 10.5.5, Firefox 3.0.5, Python 2.5.1 (r251:54863, Jan 17 2008,
19:35:17), TG 1.0.7.
!CherryPy only passes byte strings for referer and the request line.
This seems to cause problems when trying to log them as I believe that
Python doesn't know how to print >7 bit characters when not
decoding/encoding them.
--
Ticket URL: <http://trac.turbogears.org/ticket/2118#comment:2>
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
-~----------~----~----~----~------~----~------~--~---