[Bug 259730] Re: UnicodeDecodeError on http://trac.lawyer-web.org/wiki/CamelCase
I assume that this is fixed in the Trac 0.11 series, which is now available in Ubuntu repositories. ** Changed in: trac (Ubuntu) Status: New = Fix Released -- 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 ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 259730] Re: UnicodeDecodeError on http://trac.lawyer-web.org/wiki/CamelCase
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.0 -0400 +++ usr/share/python-support/trac/trac/wiki/formatter.py2008-08-20 08:28:37.0 -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 ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 259730] Re: UnicodeDecodeError on http://trac.lawyer-web.org/wiki/CamelCase
Hi, What version of Trac are you using? Usually an error like that is caused by an external tool manually inserting records in the db. Have you done such a thing? Assuming you're using sqlite, can you run: sqlite3 db/trac.db 'select text from wiki where name=CamelCase;' | hexdump -C and check the line starting with 90. Here's mine from 0.11-dev, with no strange characters: 0090 68 20 74 68 65 20 61 64 64 69 74 69 6f 6e 61 6c |h the additional| 00a0 20 72 65 71 75 69 72 65 6d 65 6e 74 20 74 68 61 | requirement tha| -- 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 ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 259730] Re: UnicodeDecodeError on http://trac.lawyer-web.org/wiki/CamelCase
Hi Tim, I am using the current Ubuntu Hardy trac version (0.10.4-2). The error occured on a fresh install when calling the CamelCase wiki page (which is in its original state). I am using a local mysql db backend accessed over local tcp. The offending characters are the four typographic that you'll see on the page, namely ... “AlabamA” and “ABc” ... Those are obviously no ASCII characters and therefore lead to an error message when it is tried to convert them to ascii. Best regards, Florian -- 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 ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 259730] Re: UnicodeDecodeError on http://trac.lawyer-web.org/wiki/CamelCase
Did you create the database in utf8 mode? See http://trac.edgewall.org/wiki/MySqlDb#MySQL -- 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 ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 259730] Re: UnicodeDecodeError on http://trac.lawyer-web.org/wiki/CamelCase
Hi Tim, Tim Hatch schrieb: Did you create the database in utf8 mode? See http://trac.edgewall.org/wiki/MySqlDb#MySQL yes, I executed exactly this statement. Florian -- 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 ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs