On Fri, Aug 7, 2009 at 14:55, Martijn Pieters <m...@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
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to