[Zope-dev] Linux x86_64 [Was: Zope Tests: 3 OK, 5 Failed]
Martijn Pieters
mj at zopatista.com
Fri Aug 7 09:55:56 EDT 2009
On Mon, Aug 3, 2009 at 08:04, Martijn Pieters <mj at zopatista.com> wrote:
>> AssertionError: Incorrect Content-Length is set! Expected 20425,
>> got 20426.
>>
>> I don't grok the range support code at all: probably Martijn Pieters is
>> the only person in the world who does. The tests are quite obscure to
>> me, so I can't diagnose even whether the failure is a testing artifact
>> or a real bug.
>
> Here's my response to Tres; for some reason my mail reader didn't
> include zope-dev. I can add now that I'll be at a sprint this weekend
> where I'll probably have time to take a look myself:
I have found the problem, but do not understand where exactly the error occurs.
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?
Here is the simple test case:
from Acquisition import Implicit
class Root(Implicit):
pass
class Slicer(Implicit):
def __getslice__(self, start, end):
return [start, end]
root = Root()
slicer = Slicer().__of__(root)
print slicer[1:]
Run this as bin/zopepy acquisition.py and verify that [1, -1] is
printed on 64-bit platforms as opposed to [1, 2147483647] on 32-bit
platforms.
--
Martijn Pieters
More information about the Zope-Dev
mailing list