mrfibble and All,
"Edit: yes, self.data, that'll works.
This was a snippet from a class method, so fixed now. The point is you should use binascii.crc32(). I use that for crc32 of resource files, and works just fine.
Update: to be sure I just tested it and both zlib.crc32() and binascii.crc32() give the correct result. So maybe user error? See my code above for the correct syntax of the CRC32 line."
Yes indeed, both zlib.crc32() and binascii.crc32() yield the same CRC32 number. Unfortunately, both are not the number I recorded from the .rsc file before deleting the CRC32 line and its EXACT duplicate generated by running CheckCRC.exe on that edited file.
To muddy the issue, I noticed that Wikipedia claims that zlib CRC32 is a different flavor of a more mainstream CRC32 (see the table in the Wikipedia entry for "Cyclic redundancy check").
This is the kind of thing than can bruise a man's forehead, and being a good sport I'm trying my best to blame the user. So... I made a one line text file the content being "blah,blah" (no quotes and with one CRLF pair) and ran it through the three CRC32 decoders in question.
The results are...
zlib.crc32() and binascii.crc32() = ce5f6c51
CheckCRC.exe = 6134ae5a
This is troubling. Anyone care to duplicate this? BTW: I'm running Python 2.7 on WinXP SP2.
A very Happy Holiday to everyone!