Charlie Clark wrote at 2006-11-15 20:15 +0100:
>>> import datetime
>>> do work but
>>> calling strftime() on a datetime object throws an import error
>>> Error Type: ImportError
>>> Error Value: import of "__doc__" from "time" is unauthorized. You are
>>> allowed to access '__doc__' in this context
> Module None, line 31, in generate
> - <PythonScript at /psytec/scripts/generate>
> - Line 31
> Module AccessControl.ZopeGuards, line 284, in guarded_import
>ImportError: import of "__doc__" from "time" is unauthorized. You are not
>allowed to access '__doc__' in this context
What code do you see in line 31 of "psytec/scripts/generate".
I expect an "import time" there and would be really surprised
when it would contain "someDateTimeObject.strftime(...)".
If I am wrong, then the "RestrictedPython" compiler would
probably generate wrong code.
ZPT mailing list