#655: Unicode error rendering widget
---------------------+---------------
Reporter: olemis | Owner:
Type: defect | Status: new
Priority: major | Version:
Resolution: |
---------------------+---------------
I've got the following error when trying to render third-party widgets .
[[span(Log entry, class=label label-important)]]
{{{
2013-09-04 15:22:51,460 Trac[formatter] ERROR: Macro
Widget(HighStockTimeline, width=600, height=550, title=Apache Bloodhound
commits during March 2013, type=area, leg_enabled=true,
pl_stacking=normal, product=bhnet, data_source=/gviz/timeline/log,
data_query="select `toDate(date)`\, count(timestamp) group by
toDate(`date`) pivot author where kind = 'changeset' and (author starts
with 'Ryan Ollos' or author starts with 'Jure Žitnik') and year(`date`) =
2013 and month(`date`) = 2 label `toDate(date)` 'Date'") failed:
}}}
[[span(Traceback, , class=label label-important)]]
{{{#!py
Traceback (most recent call last):
File "/path/to/bloodhound/trac/trac/wiki/formatter.py", line 765, in
_macro_formatter
return macro.ensure_inline(macro.process(args))
File "/path/to/bloodhound/trac/trac/wiki/formatter.py", line 380, in
ensure_inline
text = _markup_to_unicode(text)
File "/path/to/bloodhound/trac/trac/wiki/formatter.py", line 107, in
_markup_to_unicode
markup = stream.render('xhtml', encoding=None, strip_whitespace=False)
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 183, in render
return encode(generator, method=method, encoding=encoding, out=out)
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/output.py", line 57, in encode
return _encode(''.join(list(iterator)))
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/output.py", line 371, in __call__
yield _emit(kind, data, escape(data, quotes=False))
File "/usr/local/lib/python2.6/dist-
packages/Genshi-0.6-py2.6.egg/genshi/core.py", line 517, in escape
return cls(text)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 167:
ordinal not in range(128)
}}}
`Widget` macro must handle such errors gracefully
Page is not rendered, only error message.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/655>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker