Author martin.panter
Recipients docs@python, gregory.p.smith, martin.panter, serhiy.storchaka
Date 2015-03-20.22:52:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426891930.16.0.787380379608.issue22341@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Gregory, I think the three functions have been fixed since Python 3.0. It looks like you changed them in revisions 6a7fa8421902 (zlib module) and 132cf3a79126 (crc32 functions). Looking at the 3.0 branch, all three functions use PyLong_FromUnsignedLong(), but in the 2.7 branch, they use PyInt_FromLong(). This is tested in test_zlib.ChecksumTestCase.test_crc32_adler32_unsigned(). See also my changes to test_penguins() in the patch here for further testing. There is no explicit testing of binascii.crc32() unsignedness, but it is implicitly tested by test_same_as_binascii_crc32(), because the expected CRC is beyond the positive 32 bit signed limit.

I am happy to put back the suggestion of masking for backwards compatibility if you really think it is necessary. But since it only involves Python < 3.0 compatibility, I thought it would be okay to remove it; see my original post. The documentation is often pretty good about noting when Python 3 behaviours changed, but you usually have to look elsewhere to see the differences from Python 2.
History
Date User Action Args
2015-03-20 22:52:10martin.pantersetrecipients: + martin.panter, gregory.p.smith, docs@python, serhiy.storchaka
2015-03-20 22:52:10martin.pantersetmessageid: <1426891930.16.0.787380379608.issue22341@psf.upfronthosting.co.za>
2015-03-20 22:52:10martin.panterlinkissue22341 messages
2015-03-20 22:52:09martin.pantercreate