[Zope] localtime and unauthorized

Andreas Jung Andreas Jung <lists@andreas-jung.com>
Mon, 24 Feb 2003 09:31:20 +0100


This is an FAQ. Check lib/python/Products/PythonScripts/README.txt.

-aj

--On Montag, 24. Februar 2003 09:29 +0100 hohage <hohage@muenster.de> wrote:

> I' m testing a website on my local Windows XP Zope 2.3.3 machine.
> For a python script that evaluates the current day, I get a authorization
> popup.
> I'm logged in as manager.
> That's the script:
> import time
> return
> ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag
> '][ti me.localtime(time.time())[1]]
> And that's the traceback:
> Unauthorized
>
> .....
> File
> C:\PROGRA~1\Zope2_3\lib\python\Products\PythonScripts\PythonScript.py,
> line 336, in _exec
>     (Object: wochentag)
>     (Info: ({'script': <PythonScript instance at 0132C650>, 'context':
> <Folder  instance at 01328460>, 'container': <Folder instance at
> 01328460>,  'traverse_subpath': []}, (), {}, None))
>   File Script (Python), line 3, in wochentag
>     (Object: time)
>   File C:\PROGRA~1\Zope2_3\lib\python\Products\PythonScripts\Guarded.py,
> line  273, in __getattr__
>   File C:\PROGRA~1\Zope2_3\lib\python\Products\PythonScripts\Guarded.py,
> line  150, in __careful_getattr__
>     (Object: time)
>   File C:\PROGRA~1\Zope2_3\lib\python\AccessControl\SecurityManager.py,
> line  144, in validate
>   File
> C:\PROGRA~1\Zope2_3\lib\python\AccessControl\ZopeSecurityPolicy.py,  line
> 168, in validate
> Unauthorized: localtime
>
> What could be the reason??
> I've got no clue.
> Is it a windows problem...
> Thanks.
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )




-- 
    ---------------------------------------------------------------------
   -    Andreas Jung                     http://www.andreas-jung.com   -
  -   EMail: andreas at andreas-jung.com                              -
   -            "Life is too short to (re)write parsers"               -
    ---------------------------------------------------------------------