Grrr... Python Scripts
Hi Evan & zope-dev'ers, Hope you can help, and pre-emptive apologies for the bad mood I'm in :-S I want to do: try: acatalog.searchResults(aDict) except CatalogError,e: print "Something bad happened: ",e Where should I import CatalogError from? And _please_ don't tell me I have to go through some convoluted security process to do this :-( cheers, Chris
From: "Chris Withers" <chrisw@nipltd.com>
Where should I import CatalogError from? And _please_ don't tell me I have to go through some convoluted security process to do this :-(
# After adding security decls from Catalog import CatalogError Use the same security process as providing access to anything Zope doesn't already expose. We should expose exceptions like this by default, but we haven't yet. Sorry. Cheers, Evan @ digicool
Evan Simpson wrote:
Use the same security process as providing access to anything Zope doesn't already expose.
Waaaagh! :~(
We should expose exceptions like this by default, but we haven't yet. Sorry.
No worries, where should I be looking to implement this? Woudl a patch eb likely to make it into the next version? If so, what exceptions should be exposed? My list so far: Exception (all the default Python ones would be cool, dunno if theyr'e in there already...) CatalogError sys.exc_type sys.exc_value Any others? cheers, Chris
Here Chris, I'll try to solve your pain (untested): from AccessControl import ModuleSecurityInfo ModuleSecurityInfo('Products').declarePublic('Catalog') ModuleSecurityInfo('Products.Catalog').declarePublic('CatalogError') It's not so bad. - C ----- Original Message ----- From: "Chris Withers" <chrisw@nipltd.com> To: "Evan Simpson" <evan@digicool.com> Cc: <zope-dev@zope.org> Sent: Tuesday, May 08, 2001 9:02 AM Subject: Re: [Zope-dev] Re: Grrr... Python Scripts
Evan Simpson wrote:
Use the same security process as providing access to anything Zope
doesn't
already expose.
Waaaagh! :~(
We should expose exceptions like this by default, but we haven't yet. Sorry.
No worries, where should I be looking to implement this? Woudl a patch eb likely to make it into the next version? If so, what exceptions should be exposed?
My list so far: Exception (all the default Python ones would be cool, dunno if theyr'e in there already...) CatalogError sys.exc_type sys.exc_value
Any others?
cheers,
Chris
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Chris McDonough wrote:
Here Chris, I'll try to solve your pain (untested):
from AccessControl import ModuleSecurityInfo ModuleSecurityInfo('Products').declarePublic('Catalog') ModuleSecurityInfo('Products.Catalog').declarePublic('CatalogError')
Could that we added to PythonScripts/standard.py so I don't have to do it all the time? Is it a patch worthy of the collector? ;-) cheers, Chris
We actually need to do something to make a whole bunch of default stuff importable and usable from within Python Scripts, it's just a matter of which modules/classes to add security declarations for. It's also a matter of when, and who. This needs to go through the fishbowl, likely. Now if only we could manufacture some more time... - C Chris Withers wrote:
Chris McDonough wrote:
Here Chris, I'll try to solve your pain (untested):
from AccessControl import ModuleSecurityInfo ModuleSecurityInfo('Products').declarePublic('Catalog') ModuleSecurityInfo('Products.Catalog').declarePublic('CatalogError')
Could that we added to PythonScripts/standard.py so I don't have to do it all the time? Is it a patch worthy of the collector? ;-)
cheers,
Chris
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Chris McDonough wrote:
We actually need to do something to make a whole bunch of default stuff importable and usable from within Python Scripts, it's just a matter of which modules/classes to add security declarations for.
Maybe this could be bundled into the RestrictedPython work?
It's also a matter of when, and who. This needs to go through the fishbowl, likely. Now if only we could manufacture some more time...
There's a feeling I know too well :-S cheers, Chris
From: "Chris Withers" <chrisw@nipltd.com>
Could that we added to PythonScripts/standard.py so I don't have to do it all the time?
This is just part of a general security review that needs to happen. I suppose we need a place to collect suggestions about objects that ought to be exposed to restricted Python. Cheers, Evan @ digicool
Evan Simpson wrote:
From: "Chris Withers" <chrisw@nipltd.com>
Could that we added to PythonScripts/standard.py so I don't have to do it all the time?
This is just part of a general security review that needs to happen.
I thought that happened in 2.2?
I suppose we need a place to collect suggestions about objects that ought to be exposed to restricted Python.
Yup :-) Chris
participants (3)
-
Chris McDonough -
Chris Withers -
Evan Simpson