[Zope-dev] Linux x86_64 [Was: Zope Tests: 3 OK, 5 Failed]
Martijn Pieters
mj at zopatista.com
Fri Aug 7 10:26:46 EDT 2009
On Fri, Aug 7, 2009 at 14:55, Martijn Pieters <mj at zopatista.com> wrote:
> The problem is caused by an acquisition wrapped object with a
> __getslice__ method get the wrong indices passed in when the end
> parameter is ommitted:
>
> data[start:]
>
> Image.Pdata classes have a __getslice__ method, and when data is
> acquisition wrapped, that method gets (start, -1) passed in on 64-bit
> platforms, while on my Macbook (start, sys.maxint) is passed in
> instead. Obviously this means that the slice returns not everything
> from 'start' to the end, but from 'start' until the one-but-last byte.
>
> However, as far as I can tell cAcquisition.c doesn't touch the start
> and end values. Anyone want to investigate why this goes wrong?
The following checkin fixed this particular problem:
http://svn.zope.org/Acquisition/trunk/src/Acquisition/_Acquisition.c?rev=102564&view=rev
The acquisition slice wrapper accepted Py_ssize_t arguments, but then
passed these of as C ints (format string 'i'). Changing the format
string to 'n' (Py_ssize_t) fixed *this particular case*. Likely more
such fixes must be made.
In any case, the HTTP range test no longer fails with this fix.
--
Martijn Pieters
More information about the Zope-Dev
mailing list