Re: Using alternatives to Zope's DateTime module in PageTemplates
"Dieter Maurer" <[email protected]> Wed, 15 Nov 2006 21:01:40 +0100
| Newsgroups | gmane.comp.web.zope.page-templates |
|---|---|
| Message-ID | <[email protected]> |
Charlie Clark wrote at 2006-11-15 20:15 +0100: > .. >>> import datetime >>> >>> allow_type(datetime.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 >>> not >>> 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. -- Dieter