[Zope] Trapping zope exceptions in python script

J Cameron Cooper zope-l at jcameroncooper.com
Wed Dec 14 16:33:09 EST 2005


Jonathan wrote:
> Thanks to everyone for the feedback... the bottom line seems to be that 
> you can NOT trap zope exceptions in a python script... which seems a bit 
> odd.

Of course you can. You just are restricted from importing certain 
things, which happens to include this class of exception. Probably it is 
safe for Zope to allow importing this in restricted code; feel free to 
file a bug report.

But you have easy avenues to deal with this: either declare that class 
safe for import or take a couple extra seconds and write it in an 
External Method.

		--jcc
-- 
"Building Websites with Plone"
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.com


More information about the Zope mailing list