[Zope] Python import security problem

Dieter Maurer dieter at handshake.de
Sun Sep 3 14:01:48 EDT 2006


Ferhat Ayaz wrote at 2006-9-3 07:13 -0700:
>...
>I can not import python objects like 'time'. If I use
>
>import time
>
>I'll become the error message
>
>You are not allowed to access 'time' in this context
>
>Is it not possible to do this????

Please read the Zope Book (2.7 edition, online on "plope.org").

You will learn there the difference between trusted and untrusted
code.

Untrusted code (like "Script (Python)" and "FSPythonScript") can
import only a very small set of modules. As you observe, they
cannot import "time".

Reading the "README" in "Products/PythonScripts" will tell you how
to allow the import of additional modules.



-- 
Dieter


More information about the Zope mailing list