Opened 7 years ago
Last modified 5 years ago
In new version of trac 0.10 the management of strings have changed. Now the unicode python class is used. AddComment? needs to be updated.
More info:
Error messages:
Error: Macro AddComment(None) failed asciió01ordinal not in range(128)
and in trac-env/log/trac.log: {{{2006-10-05 10:30:30,821 Trac[formatter] ERROR: Macro AddComment?(None) failed Traceback (most recent call last):
File "/var/lib/python-support/python2.3/trac/wiki/formatter.py", line 439, in _macro_formatter return macro.process(self.req, args, True) File "/var/lib/python-support/python2.3/trac/wiki/formatter.py", line 112, in process text = self.processor(req, text) File "/var/lib/python-support/python2.3/trac/wiki/formatter.py", line 100, in _macro_processor return self.macro_provider.render_macro(req, self.name, text) File "/var/lib/python-support/python2.3/trac/wiki/macros.py", line 453, in render_macro return module.execute(req and req.hdf, content, self.env) File "/var/lib/trac/projects/sistemas/wiki-macros/AddComment.py", line 39, in execute comment = Markup(hdf.getValue("args.addcomment", "")).unescape() File "/var/lib/python-support/python2.3/trac/util/html.py", line 46, in new return unicode.new(self, text)
File "/var/lib/python-support/python2.3/trac/wiki/formatter.py", line 439, in _macro_formatter
return macro.process(self.req, args, True)
File "/var/lib/python-support/python2.3/trac/wiki/formatter.py", line 112, in process
text = self.processor(req, text)
File "/var/lib/python-support/python2.3/trac/wiki/formatter.py", line 100, in _macro_processor
return self.macro_provider.render_macro(req, self.name, text)
File "/var/lib/python-support/python2.3/trac/wiki/macros.py", line 453, in render_macro
return module.execute(req and req.hdf, content, self.env)
File "/var/lib/trac/projects/sistemas/wiki-macros/AddComment.py", line 39, in execute
comment = Markup(hdf.getValue("args.addcomment", "")).unescape()
File "/var/lib/python-support/python2.3/trac/util/html.py", line 46, in new
return unicode.new(self, text)
UnicodeDecodeError?: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) }}}
Workaround: If you use utf-8, substitute the following line:
by
comment = Markup(unicode(hdf.getValue("args.addcomment", ""), 'utf-8')).unescape()
Correction also needs to be done on the authname and authoraddcomment values.
See patched attached.
UTF-8 patch
(In [2817]) AddCommentMacro: Fixing some unicode issues with 0.10 version.
Fixes #766