#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 | Keywords:
-------------------------+--------------------------------------------------
When requesting a URL with Unicode characters in it (e.g. the Umlaut "ΓΌ"
encoded as "%C3%BC") the logging in
turbogears.controllers.RootController._cp_log_access fails with a
UnicodeDecodeError.
It works when changing
'r': request.requestLine,
to
'r': request.requestLine.decode('utf8'),
'f': request.headers.get('referer', ''),
to
'f': request.headers.get('referer', '').decode('utf8'),
and
self.accesslog.info(s)
to
self.accesslog.info(s.encode('utf8'))
Might be a bit more difficult if your app uses a different encoding.
Cheers
--
Ticket URL: <http://trac.turbogears.org/ticket/2118>
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
-~----------~----~----~----~------~----~------~--~---