Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PY3: "ZopeGuards" forgets to allow iteration over the result of "dict.{keys,values,items}" #89

Closed
d-maurer opened this issue Jul 11, 2019 · 0 comments · Fixed by #90
Closed
Labels

Comments

@d-maurer
Copy link
Contributor

Under Python 3, the nexts in the following code all result in an AccessControl.unauthorized.Unauthorized: You are not allowed to access 'a particular tuple' in this context:

from AccessControl.ZopeGuards import SafeIter, Containers

d={1:1, 2:2}
i=SafeIter(d.items())
next(i)
ik=SafeIter(d.keys())
next(ik)
iv=SafeIter(d.values())
next(iv)

This is the cause of zopefoundation/Products.PythonScripts#35.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant