| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I got very confused recently when I had a security-proxied iterator
using this sort of pattern:
class Foo:
def __iter__(self):
return self
def __next__(self):
...
The value returned from `__iter__` is wrapped in a security proxy, and I
found that unless I used `PURE_PYTHON=1` I got a `ForbiddenAttribute`
exception trying to get the Python-2-style `next` method.
This probably ought to have been noticed and fixed before we dropped
support for Python 2, in which case a transition period of supporting
both method names would have made sense. Now that we only support
Python 3, I expect that any proxied objects that actually work as
iterators will have a `__next__` method (and perhaps a vestigial `next`
alias for compatibility), so I think we can just jump straight to only
supporting `__next__` for both the C case and the pure-Python case.
The C case is not actually being tested properly at the moment due to an
oversight around the exact handling of the `PURE_PYTHON` environment
variable, but fixing that will require coordinated changes to both
`zope.security` and `zope.proxy`. I'll deal with that separately.
|
| |
|
| |
|
|
|
| |
* Drop support for Python 2.7, 3.5, 3.6.
|
|
|
|
|
|
| |
Add a regression test for CFLAGS not having -Ofast, which is known to
break things. See https://github.com/zopefoundation/meta/pull/155 for
reference.
|
| |
|
| |
|
|\
| |
| | |
Fix default checker for method-wrapper on Python 3
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The default checker for `method-wrapper` objects such as `().__repr__`
and `{}.__repr__` was previously set by setting the default checker
`type(().__getslice__)`, which only worked on Python 2. Use a different
exemplar for this type which works on both Python 2 and 3.
Fixes #75.
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I renamed the tests (that's why their name ends with `2`) there where methods
with the same names around line 1600.
The other tests assure that a TypeError is raised when calling
`pow(x, y, proxy)` because "a PyProxy cannot lie about its type".
Interestingly the deleted tests did not fail on CPython but the tests expecting
the TypeError were locally successful, too, but not at GHA – that's strange.
I am restoring here the status before my renaming of the tests: The now deleted
tests did not run because of the name clash.
|
|
|
|
| |
Add support for Python 3.9.
|
|
|
|
| |
Fixes #71
|
|
|
|
| |
Fixes https://github.com/zopefoundation/zope.interface/issues/141
|
|
|
|
|
|
|
|
| |
Dict item iterators use a special type (builtins.dict_itemiterator) on
recent versions of PyPy3.
Fixes zope.security.interfaces.ForbiddenAttribute: ('__next__',
<dict_itemiterator object at 0x00007f7c9c107320>)
|
| |
|
|
|
|
| |
Fixes #55
|
|
|
|
|
|
| |
implements it
This facilitates adding adapter registrations for the system user.
|
|
|
|
|
|
|
|
|
| |
Just like the C implementation. Note that ``__str__`` is checked for
both implementations on both Python 2 and 3, but if there is no
``__unicode__`` method defined, Python 2's automatic fallback to
``__str__`` is **not** checked when ``unicode`` is called.
Add tests for these cases.
|
|
|
|
|
|
|
|
|
|
| |
And test this. This applies to both the class and the ZCML directive.
Also adjust IPermission to use NativeStringLine for ``id``, since
that's what ZCML has always been creating (it uses an Id, which
subclasses NativeStringLine), and what's typically written in source
code. Test that the permissions created from ZCML are valid with this
change.
|
|
|
|
|
|
| |
where it was a i18n messageid).
TIL that sphinx.ext.doctest has IGNORE_EXCEPTION_DETAIL set by default.
|
|
|
|
|
|
|
|
| |
And suggest workarounds, in a prominent new section about proxy troubles.
Link to this from everywhere we talk about proxies.
Fixes #26
|
|
|
|
|
|
| |
It's not doctested so it isn't fully guaranteed to be correct, but it
was relying on conpects that don't exist anymore (simpleinteraction,
and the ISecurityPolicy having the checkPermission() method).
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
And use it consistently throughout this package.
On Python 2, sometimes we were comparing the string with unicode and
sometimes with str. Now its consistent.
This is a start to addressing #6
|
|
|
|
|
|
| |
Also run all remaining tests on all Python versions.
Trivial trailing/keyword arg whitespace cleanups.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
- The implementation of __getattribute__/__getattr__ now behaves like
C and will not call a target's version of those functions more than
once if they raise an AttributeError.
|
| |
|
| |
|
|
|
|
| |
zope.location is a hard test dependency, no need for conditional logic.
|
|
|
|
|
| |
- Modern assert methods
- Unify some py2/py3 tests that just depended on a method name.
|
|
|
|
|
|
| |
- Modern assert methods
- Whitespace cleanup
- A whole test class was being skipped because of a duplicate name.
|
|
|
|
|
|
| |
- Use dict comprehensions
- Use moddern self.assertIs
- Unify external imports
|
| |
|
| |
|
| |
|
|
|
|
| |
We have hard test dependencies, we don't need to be conditional.
|
|
|
|
|
|
| |
Add an explicit test for this case.
Fixes #19.
|
|\
| |
| | |
call PyObject_GC_UnTrack() in tp_dealloc()
|