[ZO-Coll] [ZOC] 210/ 2 Reject "PyScript: Unable to return an item of an tuple"

Collector: NEW Zope.org (the ... zope-web at zope.org
Wed Aug 27 09:57:39 EDT 2003


Issue #210 Update (Reject) "PyScript: Unable to return an item of an tuple"
 Status Rejected, content/bug medium
To followup, visit:
  http://collector.zope.org/ZopeOrg/210

==============================================================
= Reject - Entry #2 by ajung on Aug 27, 2003 8:57 am

 Status: Pending => Rejected

sorry, wrong tracker
________________________________________
= Request - Entry #1 by ajung on Aug 27, 2003 8:55 am

The PyScript

import time

return time.localtime(time.mktime((2003, 2, 2, 0, 0, 0, 0, 0, 0)))[6]

raises

Error Type: Unauthorized
Error Value: You are not allowed to access '6' in this context

The import of 'time' is allowed through allow_module().
This behaviour is very odd since time.localtime()
returns a tuple and it does not make sense to forbid
the access to the items of a tuple. 

A workaround is to use tuple(time.localtime(....))[6]
This creates a new tuple from the old one....very wierd.
==============================================================




More information about the Zopeorg-collector mailing list