Index: usr/share/python-support/trac/trac/wiki/formatter.py
===================================================================
--- usr/share/python-support/trac/trac/wiki/formatter.py.orig 2008-08-20
08:28:20.000000000 -0400
+++ usr/share/python-support/trac/trac/wiki/formatter.py 2008-08-20
08:28:37.000000000 -0400
@@ -821,7 +821,7 @@
self.in_list_item = False
self.in_quote = False
# Throw a bunch of regexps on the problem
- result = re.sub(self.wiki.rules, self.replace, line)
+ result = re.sub(self.wiki.rules, self.replace, to_unicode(line))
if not self.in_list_item:
self.close_list()
** Description changed:
Binary package hint: trac
I get the following error when calling
http://some.trac.site/wiki/CamelCase:
Traceback (most recent call last):
File "/var/lib/python-support/python2.5/trac/web/main.py", line 406, in
dispatch_request
dispatcher.dispatch(req)
File "/var/lib/python-support/python2.5/trac/web/main.py", line 237, in
dispatch
resp = chosen_handler.process_request(req)
File "/var/lib/python-support/python2.5/trac/wiki/web_ui.py", line 135, in
process_request
self._render_view(req, db, page)
File "/var/lib/python-support/python2.5/trac/wiki/web_ui.py", line 444, in
_render_view
'page_html': wiki_to_html(page.text, self.env, req),
File "/var/lib/python-support/python2.5/trac/wiki/formatter.py", line 1001,
in wiki_to_html
Formatter(env, req, absurls, db).format(wikitext, out, escape_newlines)
File "/var/lib/python-support/python2.5/trac/wiki/formatter.py", line 824,
in format
result = re.sub(self.wiki.rules, self.replace, line)
File "/usr/lib/python2.5/re.py", line 150, in sub
return _compile(pattern, 0).sub(repl, string, count)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 151:
ordinal not in range(128)
- This can be solved when patching line 824 in /var/lib/python-
- support/python2.5/trac/wiki/formatter.py like this:
-
- - result = re.sub(self.wiki.rules, self.replace, line)
- + result = re.sub(self.wiki.rules, self.replace, to_unicode(line))
+ This can be solved when explicitly converting "line" to unicode in
+ /var/lib/python-support/python2.5/trac/wiki/formatter.py, line 824 (see
+ full patch below).
I however didn't fully understand the problem. Maybe my patch is only
symptomatic. It seems strange to me that "line" is not unicode encoded
anyway.
--
UnicodeDecodeError on http://trac.lawyer-web.org/wiki/CamelCase
https://bugs.launchpad.net/bugs/259730
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs