Edgewall Software
Modify

Opened 5 years ago

Last modified 14 months ago

#13197 new defect

Redundant escaping exception messages from INavigationContributor components

Reported by: Jun Omae Owned by:
Priority: normal Milestone: next-stable-1.6.x
Component: rendering Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Exception messages from INavigationContributor components are redundantly escaped when showing as a warning.

  • trac/web/chrome.py

    diff --git a/trac/web/chrome.py b/trac/web/chrome.py
    index 1bbb5f665..619d325d6 100644
    a b from trac.util.datefmt import (  
    6565    get_day_names_jquery_ui, get_timezone_list_jquery_ui,
    6666    get_first_week_day_jquery_ui, get_timepicker_separator_jquery_ui,
    6767    get_period_names_jquery_ui, localtz)
    68 from trac.util.translation import _, get_available_locales
     68from trac.util.translation import _, get_available_locales, tag_
    6969from trac.web.api import IRequestHandler, ITemplateStreamFilter, HTTPNotFound
    7070from trac.web.href import Href
    7171from trac.wiki import IWikiSyntaxProvider
    def component_guard(env, req, component):  
    411411        try:
    412412            yield
    413413        except Exception as e:
    414             add_warning(req, _("%(component)s failed with %(exc)s",
    415                                component=component.__class__.__name__,
    416                                exc=exception_to_unicode(e)))
     414            add_warning(req, tag_("%(component)s failed with %(exc)s",
     415                                  component=component.__class__.__name__,
     416                                  exc=tag(e.__class__.__name__, ': ',
     417                                          to_fragment(e))))
    417418            raise
    418419
    419420

Attachments (2)

configuration-error-1.4-stable.png (157.8 KB ) - added by Jun Omae 5 years ago.
after-the-patch.png (133.5 KB ) - added by Jun Omae 5 years ago.

Download all attachments as: .zip

Change History (5)

by Jun Omae, 5 years ago

by Jun Omae, 5 years ago

Attachment: after-the-patch.png added

comment:1 by Jun Omae, 5 years ago

After the patch:

Last edited 5 years ago by Jun Omae (previous) (diff)

comment:2 by Jun Omae, 5 years ago

Component: generalrendering
Milestone: next-stable-1.4.x

comment:3 by Ryan J Ollos, 14 months ago

Milestone: next-stable-1.4.xnext-stable-1.6.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.