Modify ↓
#3073 closed defect (fixed)
UnicodeDecodeError re.sub(r'URL="(.*?)"', self.expand_wiki_links, content)
| Reported by: | Zoran Regvart | Owned by: | Christian Boos |
|---|---|---|---|
| Priority: | normal | Component: | GraphvizPlugin |
| Severity: | normal | Keywords: | UnicodeDecodeError URL |
| Cc: | Trac Release: | 0.11 |
Description
Hi, I upgraded to latest for Trac 0.10 and found that URL links no longer support international characters. The changeset, as I see it, that caused this is [3382].
The exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 406, in dispatch_request
dispatcher.dispatch(req)
File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 237, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/local/lib/python2.5/site-packages/trac/wiki/web_ui.py", line 111, in process_request
self._render_editor(req, db, page, preview=True)
File "/usr/local/lib/python2.5/site-packages/trac/wiki/web_ui.py", line 385, in _render_editor
info['page_html'] = wiki_to_html(page.text, self.env, req, db)
File "/usr/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 1001, in wiki_to_html
Formatter(env, req, absurls, db).format(wikitext, out, escape_newlines)
File "/usr/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 795, in format
self.handle_code_block(line)
File "/usr/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 735, in handle_code_block
self.req, self.code_text)))
File "/usr/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 114, in process
text = self.processor(req, text)
File "/usr/local/lib/python2.5/site-packages/trac/wiki/formatter.py", line 102, in _macro_processor
return self.macro_provider.render_macro(req, self.name, text)
File "build/bdist.freebsd-6.3-STABLE-i386/egg/graphviz/graphviz.py", line 206, in render_macro
content = re.sub(r'URL="(.*?)"', self.expand_wiki_links, content)
File "/usr/local/lib/python2.5/re.py", line 150, in sub
return _compile(pattern, 0).sub(repl, string, count)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 73: ordinal not in range(128)
FreeBSD, Trac 0.10.4, Apache 2.2, mod_python 3.3.1, python 2.5.2
Attachments (1)
Change History (5)
comment:1 Changed 17 years ago by
Changed 17 years ago by
| Attachment: | traclinks-unicode-support.patch added |
|---|
More robust unicode support
comment:2 Changed 17 years ago by
| Trac Release: | 0.10 → 0.11 |
|---|
I just attached a patch for the 0.11 version of the plugin.
comment:3 Changed 17 years ago by
| Owner: | changed from Peter Kropf to Christian Boos |
|---|
traclinks-unicode-support.patch was applied in [4393].
comment:4 Changed 17 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
In [4395], some additional changes concerning expand_wiki_links and better unicode support were applied.
Note: See
TracTickets for help on using
tickets.



Same here. Probably depending on the server configuration. Here is my patch :
add
url = url.encode('utf-8')just after
in function