Daniel wrote:
> In the line:
>
> return struct.pack('>I',self.value)
>
>  self.value is a signed (32-bit) integer, but according to
> http://docs.python.org/lib/module-struct.html, the capital 'I' should be
> used for unsigned ints. The warning goes away if a lower-case 'i' is used
> instead:
>
> return struct.pack('>i',self.value)

This assumes that self.value should be signed. A problem might arise if it
should really be unsigned.

self.value is assigned from _crc32, which calls zlib.crc32.
According to pydoc, "The returned checksum is an integer."
According to intuition, a checksum should not be negative (?).

I'll have to look closer at this.

//Stefan




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to