Roundup Tracker - Issues

Issue 2032526

classification
unicode/string mismatch in cgi/TranslationService.py
Type: Severity: normal
Components: None Versions:
process
Status: closed accepted
:
: : catucci, richard
Priority: normal : patch

Created on 2008-07-30 09:56 by catucci, last changed 2008-08-07 05:51 by richard.

Files
File name Uploaded Description Edit Remove
roundupUnicodeTranslations.patch catucci, 2008-07-30 09:56
Messages
msg2936 Author: [hidden] (catucci) Date: 2008-07-30 09:56
When the browser requires a language different from
"en", the web interface doesn't start at all, and all
I get is a

EXCEPTION AT Wed Jul 30 06:13:17 2008
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/roundup/scripts/roundup_server.py", line 188, in run_cgi
    self.inner_run_cgi()
  File "/usr/lib/python2.4/site-packages/roundup/scripts/roundup_server.py", line 362, in inner_run_cgi
    tracker.Client(tracker, self, env).main()
  File "/usr/lib/python2.4/site-packages/roundup/cgi/client.py", line 252, in main
    self.inner_main()
  File "/usr/lib/python2.4/site-packages/roundup/cgi/client.py", line 384, in inner_main
    return self.write_html(self._(error_message))
  File "/usr/lib/python2.4/site-packages/roundup/cgi/TranslationService.py", line 40, in gettext
    return unicode(self.ugettext(msgid),'utf8').encode(self.OUTPUT_ENCODING)
TypeError: decoding Unicode is not supported

exception.

The enclosed patch does normalise incoming arguments
and outgoing results both for both translators (while
testing, I've seen 'str' and 'unicode' types both as
incoming arguments and as a result coming out from ugettext and ungettext.
msg2937 Author: [hidden] (richard) Date: 2008-08-07 05:51
Applied, thanks.
History
Date User Action Args
2008-07-30 09:56:23catuccicreate