[Trac-tickets] [The Trac Project] #1821: Accentuated characters prevent Trac from rendering the ticket

The Trac Project noreply at edgewall.com
Fri Jul 22 09:28:35 CDT 2005


#1821: Accentuated characters prevent Trac from rendering the ticket
---------------------------+------------------------------------------------
       Id:  1821           |      Status:  new                     
Component:  ticket system  |    Modified:  Fri Jul 22 09:28:34 2005
 Severity:  major          |   Milestone:  0.9                     
 Priority:  normal         |     Version:  devel                   
    Owner:  jonas          |    Reporter:  eblot                   
---------------------------+------------------------------------------------
 For example, if the 'a' character with a ^ accent (I won't submit the
 actual character here ;-)) is specified in a comment, Trac accepts the
 character, stores it in the SQL database, but then fails to render it:

 {{{
 Trac detected an internal error:

 'ascii' codec can't encode character u'\xe2' in position 0: ordinal not in
 range(128)
 }}}

 '''Python traceback'''
 {{{

 Traceback (most recent call last):
   File "/local/engine/trac/trac/web/modpython_frontend.py", line 274, in
 handler
     dispatch_request(mpr.path_info, mpr, env)
   File "/local/engine/trac/trac/web/main.py", line 425, in
 dispatch_request
     dispatcher.dispatch(req)
   File "/local/engine/trac/trac/web/main.py", line 285, in dispatch
     resp = chosen_handler.process_request(req)
   File "/local/engine/trac/trac/ticket/web_ui.py", line 194, in
 process_request
     self._insert_ticket_data(req, db, ticket, reporter_id)
   File "/local/engine/trac/trac/ticket/web_ui.py", line 379, in
 _insert_ticket_data
     changes[-1]['comment'] = wiki_to_html(new, self.env, req, db)
   File "/local/engine/trac/trac/wiki/formatter.py", line 668, in
 wiki_to_html
     Formatter(env, req, absurls, db).format(wikitext, out,
 escape_newlines)
   File "/local/engine/trac/trac/wiki/formatter.py", line 557, in format
     line = util.escape(line, False)
   File "/local/engine/trac/trac/util.py", line 55, in escape
     text = str(text).replace('&', '&') \
 UnicodeEncodeError: 'ascii' codec can't encode character u'\xe2' in
 position 0: ordinal not in range(128)
 }}}

 This means that once someone has submitted such a character, the ticket
 cannot be rendered anymore.

 I do not know if this issue also impacts other component (as it seems to
 occur when Wiki text is rendered)

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/1821>
The Trac Project <>


More information about the Trac-Tickets mailing list