Public bug reported:

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))

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.

** Affects: trac (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  Binary package hint: trac
  
- I get the following error when calling http://trac.lawyer-
- web.org/wiki/CamelCase:
+ 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))
  
  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

Reply via email to