Am 16.11.2006, 21:43 Uhr, schrieb Dieter Maurer <[EMAIL PROTECTED]>:
I am not surprised that you are formatting a database result.
I am surprised that in the byte code there is an "import time"
(or an import at all).
I tried to reproduce your problem and failed:
bin/zopectl debug
from datetime
Charlie Clark wrote at 2006-11-15 21:07 +0100:
> ...
>> 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
Am 15.11.2006, 21:01 Uhr, schrieb Dieter Maurer <[EMAIL PROTECTED]>:
Module None, line 31, in 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 t
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.
Am 06.11.2006, 23:12 Uhr, schrieb Dieter Maurer <[EMAIL PROTECTED]>:
Charlie Clark wrote at 2006-10-24 22:43 +0200:
Am 24.10.2006, 22:26 Uhr, schrieb Dieter Maurer <[EMAIL PROTECTED]>:
It does, but you need to use "allowType"...
Thanks for that.
import datetime
allow_type(datetime.datetime
Charlie Clark wrote at 2006-10-24 22:43 +0200:
>Am 24.10.2006, 22:26 Uhr, schrieb Dieter Maurer <[EMAIL PROTECTED]>:
>> It does, but you need to use "allowType"...
>
>Thanks for that.
>
>import datetime
>
>allow_type(datetime.datetime)
>
>do work but
>
>calling strftime() on a datetime object throw
Am 24.10.2006, 22:26 Uhr, schrieb Dieter Maurer <[EMAIL PROTECTED]>:
Charlie Clark wrote at 2006-10-23 16:03 +0200:
...
ah, the problem seems that Python datetime returns extension types and
not
classes and Zope's security does not work with extension types!
It does, but you need to use "al
Charlie Clark wrote at 2006-10-23 16:03 +0200:
> ...
>ah, the problem seems that Python datetime returns extension types and not
>classes and Zope's security does not work with extension types!
It does, but you need to use "allowType"...
--
Dieter
Am 23.10.2006, 15:13 Uhr, schrieb Charlie Clark <[EMAIL PROTECTED]>:
I still have the same problem:
import mx.DateTime, datetime
d1 = mx.DateTime.DateTime(2006, 10, 22)
print d1
print d1.strftime("%Y.%m.%d")
d2 = datetime.datetime(2006, 10, 22)
print d2
print d2.strftime("%Y.%m.%d")
return
Am 23.10.2006, 14:38 Uhr, schrieb Charlie Clark <[EMAIL PROTECTED]>:
Am 23.10.2006, 14:36 Uhr, schrieb Andreas Jung <[EMAIL PROTECTED]>:
-> lib/python/Products/PythonScripts/README.txt
Exactly the same mechanism? I'll give it a try.
I still have the same problem:
import mx.DateTime, datet
Am 23.10.2006, 14:36 Uhr, schrieb Andreas Jung <[EMAIL PROTECTED]>:
-> lib/python/Products/PythonScripts/README.txt
Exactly the same mechanism? I'll give it a try.
Charlie
--
Charlie Clark
eGenix.com
Professional Python Services directly from the Source
Python/Zope Consulting and Support
11 matches
Mail list logo