Ticket #766 (closed defect: fixed)

Opened 7 years ago

Last modified 5 years ago

AddComment does not manage Unicode strings

Reported by: anonymous Assigned to: athomas
Priority: normal Component: AddCommentMacro
Severity: normal Keywords: unicode, 0.10
Cc: Trac Release: 0.10

Description

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:

Attachments

AddComment-utf8.patch (1.1 kB) - added by tonin on 01/08/07 15:44:47.
UTF-8 patch

Change History

10/05/06 10:31:24 changed by anonymous

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)

UnicodeDecodeError?: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) }}}

10/05/06 10:32:47 changed by anonymous

Workaround: If you use utf-8, substitute the following line:

comment = Markup(hdf.getValue("args.addcomment", "")).unescape()

by

comment = Markup(unicode(hdf.getValue("args.addcomment", ""), 'utf-8')).unescape()

01/08/07 15:33:21 changed by anonymous

Correction also needs to be done on the authname and authoraddcomment values.

See patched attached.

01/08/07 15:44:47 changed by tonin

  • attachment AddComment-utf8.patch added.

UTF-8 patch

11/24/07 01:44:40 changed by osimons

  • status changed from new to closed.
  • resolution set to fixed.

(In [2817]) AddCommentMacro: Fixing some unicode issues with 0.10 version.

Fixes #766


Add/Change #766 (AddComment does not manage Unicode strings)




Change Properties
Action