[Zope] restricted execution

Tuttle, Gene cetuttle at rottlundhomes.com
Tue Feb 22 11:14:13 EST 2005


I am trying to get the re module into zope

I have created a folder in the products folder called GlobalModules
I have created a __init__.py in this folder it contains:

from Products.PythonScripts.Utility import allow_module

allow_module('re')

This allows the import to work and the line:
matchstr = re.compile(r"""\D""")  # search for non numbers
Zope does not error on the above line.
however it does not like:
phone_primary = matchstr.sub(r'',phone_primary)  # remove non numbers for
the string

The error is 
Error Type: Unauthorized
Error Value: You are not allowed to access 'sub' in this context
How do I get the  matchstr.sub to work?

Thanks
Gene Tuttle


More information about the Zope mailing list