#3058: Bug of the wiki compiler
-----------------------------------+----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: cboos
Type: defect | Status: new
Priority: highest | Milestone: 0.9.6
Component: general | Version: 0.9.5
Severity: normal | Resolution:
Keywords: unicode |
-----------------------------------+----------------------------------------
Changes (by cboos):
* priority: normal => highest
* owner: jonas => cboos
* milestone: => 0.9.6
* keywords: => unicode
Old description:
> When compiling a page of a project of mine, the compiler crashes without
> any reason. By seeveral tests, I isolated the problem: it happens when I
> add to the page the following string:
> " === Indice di Priorità ==="
>
> In the following is the python traceback:
>
> Traceback (most recent call last):
> File "C:\Python24\lib\site-packages\trac\web\standalone.py", line 303,
> in _do_trac_req
> dispatch_request(path_info, req, env)
> File "C:\Python24\lib\site-packages\trac\web\main.py", line 139, in
> dispatch_request
> dispatcher.dispatch(req)
> File "C:\Python24\lib\site-packages\trac\web\main.py", line 107, in
> dispatch
> resp = chosen_handler.process_request(req)
> File "C:\Python24\lib\site-packages\trac\wiki\web_ui.py", line 92, in
> process_request
> self._render_editor(req, db, page, preview=True)
> File "C:\Python24\lib\site-packages\trac\wiki\web_ui.py", line 311, in
> _render_editor
> info['page_html'] = wiki_to_html(page.text, self.env, req, db)
> File "C:\Python24\lib\site-packages\trac\wiki\formatter.py", line 744,
> in wiki_to_html
> Formatter(env, req, absurls, db).format(wikitext, out,
> escape_newlines)
> File "C:\Python24\lib\site-packages\trac\wiki\formatter.py", line 599,
> in format
> result = re.sub(self.rules, self.replace, line)
> File "C:\Python24\lib\sre.py", line 142, in sub
> return _compile(pattern, 0).sub(repl, string, count)
> File "C:\Python24\lib\site-packages\trac\wiki\formatter.py", line 221,
> in replace
> return getattr(self, '_' + itype + '_formatter')(match, fullmatch)
> File "C:\Python24\lib\site-packages\trac\wiki\formatter.py", line 389,
> in _heading_formatter
> anchor = self._anchor_re.sub('', sans_markup.decode('utf-8'))
> File "C:\Python24\lib\encodings\utf_8.py", line 16, in decode
> return codecs.utf_8_decode(input, errors, True)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 17:
> unexpected end of data
New description:
When compiling a page of a project of mine, the compiler crashes without
any reason. By seeveral tests, I isolated the problem: it happens when I
add to the page the following string:
" === Indice di Priorità ==="
In the following is the python traceback:
{{{
Traceback (most recent call last):
File "C:\Python24\lib\site-packages\trac\web\standalone.py", line 303,
in _do_trac_req
dispatch_request(path_info, req, env)
File "C:\Python24\lib\site-packages\trac\web\main.py", line 139, in
dispatch_request
dispatcher.dispatch(req)
File "C:\Python24\lib\site-packages\trac\web\main.py", line 107, in
dispatch
resp = chosen_handler.process_request(req)
File "C:\Python24\lib\site-packages\trac\wiki\web_ui.py", line 92, in
process_request
self._render_editor(req, db, page, preview=True)
File "C:\Python24\lib\site-packages\trac\wiki\web_ui.py", line 311, in
_render_editor
info['page_html'] = wiki_to_html(page.text, self.env, req, db)
File "C:\Python24\lib\site-packages\trac\wiki\formatter.py", line 744,
in wiki_to_html
Formatter(env, req, absurls, db).format(wikitext, out,
escape_newlines)
File "C:\Python24\lib\site-packages\trac\wiki\formatter.py", line 599,
in format
result = re.sub(self.rules, self.replace, line)
File "C:\Python24\lib\sre.py", line 142, in sub
return _compile(pattern, 0).sub(repl, string, count)
File "C:\Python24\lib\site-packages\trac\wiki\formatter.py", line 221,
in replace
return getattr(self, '_' + itype + '_formatter')(match, fullmatch)
File "C:\Python24\lib\site-packages\trac\wiki\formatter.py", line 389,
in _heading_formatter
anchor = self._anchor_re.sub('', sans_markup.decode('utf-8'))
File "C:\Python24\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 17:
unexpected end of data
}}}
Comment:
Right, I can reproduce this.
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/3058>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets