[Zope-dev] Restricted Python not handling slices correctly

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Jun 5 12:53:16 EDT 2008


Hi everyone,

I am starting to use Restricted Python a lot and I found the following problem 
with slicing:

>>> from zope.security import checker
>>> l = [1, 2]
>>> l[-3:]
[1, 2]
>>> lp = checker.ProxyFactory(l)
>>> lp[-3:]
[2]

The problem is that -3 gets converted to 1 somewhere, but it should be a 
negative number signalizing the slice to start at the beginning of the 
sequence.

The problem exists both in Python 2.4 and 2.5 and affects both Zope 2 and 3, 
since both Zopes use the RestrictedPython package.

I suspect that the problem lies with the new slicing syntax introduced in 
Python 2.4. I am willing to fix the bug, but I would need some guidance and 
goodwill from the gods of RestrictedPython. Anyone?

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. "Zope Stephan Richter"


More information about the Zope-Dev mailing list