[Python-Dev] Re: Capabilities

Jim Fulton jim@ZOPE.COM
Mon, 10 Mar 2003 06:26:35 -0500


Samuele Pedroni wrote:
> From: "Jim Fulton" <jim@zope.com>
> 
>>For example, you can't proxy exceptions without
>>breaking exception handling. In Zope, we rely on restricted execution to
> 
> prevent
> 
>>certian kinds of introspection on exceptions and exception classes.  In Zope,
> 
> we
> 
>>also don't proxy None, because None is usually checked for identity. We also
> 
> don't
> 
>>proxy strings, and numbers.
>>
> 
> That was a question I was asking myself about proxies: exception handling.
> But I never had the time to play with it to check.
> 
> Does that mean that restricted code can get unproxied instances of classic
> classes as caught exceptions?

Right. What we can (and will do) is intercept the exceptions and proxy the
exception's instance data. So we'll be relying on restricted execution
to protect the exception method meta data and on proxies to protect the
exception data. Of course, we'd prefer to be able to proxy the the
exception instances themselves.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org