Mailing List Archive

zope.security failure [WAS Re: zope-tests - FAILED: 59]
> On Jun 4, 2016, at 07:40, Marius Gedminas <marius@gedmin.as> wrote:
>
>> [43] FAILED winbot / zope.security_py_340_win64
>> https://mail.zope.org/pipermail/zope-tests/2016-June/095171.html
>
> Unexpected 64-bitness:
>
> - <security proxied builtins.object instance at 0x0000000000C88610>
> ? --------
> + <security proxied builtins.object instance at 0x00C88610>
>
> Probably because it tries to distinguish 32- and 64-bit Pythons by inspecting
> the size of ctypes.long, forgetting that on 64-bit Windows a C 'long' is
> 32-bits still. A similar bug was recently fixed in, uh, ZODB? persistent?
> zope.interface? I don't recall.

I suspect you're thinking of https://github.com/zopefoundation/persistent/issues/38. There it turned out the bug was that the C code was simply returning the wrong type for __hash__ on Py3 (and getting away with it on non-64-bit-Windows).

Here (https://github.com/zopefoundation/zope.security/blame/master/src/zope/security/tests/test_proxy.py#L187), it looks like there's simply no accounting for pointer size at all on windows (the length of the address repr is hardcoded to 8 digits when the platform is 'win32': https://github.com/zopefoundation/zope.security/commit/e1d5f7cf375ccdfb8f6207c2bf813ca64c1d7bda).

I worked on the persistent bug, but because the error ended up being in C code, I never had to figure out how best to distinguish the two 'win32' cases in Python...but since this fails in ProxyCTests but passes in ProxyPyTests maybe this is a similar bug in the C extension?

Jason
_______________________________________________
Zope-Dev maillist - Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )