[Zope-Coders] Re: [Zope-Checkins] CVS: Zope/lib/python/AccessControl - PermissionMapping.py:1.12 Role.py:1.54

Florent Guillaume fg@nuxeo.com
01 Aug 2002 18:22:01 +0200


On Thu, 2002-08-01 at 18:14, Martijn Pieters wrote:
> On Thu, Aug 01, 2002 at 04:07:01PM +0000, Florent Guillaume wrote:
> > Martijn Pieters  <mj@zope.com> wrote:
> > > -        raise AttributeError, name
> > > +        raise AttributeError, escape(name)
> > 
> > I don't understand why the escaping is done at that place. Surely, it
> > should be the role of the stuff that displays the error to do the
> > escaping.
> 
> The current error handling mechanism expects some error messages to contain
> HTML; the form a complete message to be displayed. in
> standard_error_message, this is found in the variable error_message. Because
> of this, any HTML found in error_type will cause it to be copied to
> error_message as well.

Ok, so the reason is that we have too much legacy code that expects HTML
in the raised messages and won't quote it. Fine.

A lot of CMF raises things without quoting them though, not sure what's
the best plan there.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com