On 5/31/06, Bob Ippolito
On May 31, 2006, at 12:49 AM, Neal Norwitz wrote:
Bob,
There are a couple of things I don't understand about the new struct. Below is a test that fails.
$ ./python ./Lib/test/regrtest.py test_tarfile test_struct test_tarfile /home/pybot/test-trunk/build/Lib/struct.py:63: DeprecationWarning: 'l' format requires -2147483648 <= number <= 2147483647 return o.pack(*args) test_struct test test_struct failed -- pack('>l', -2147483649) did not raise error 1 test OK. 1 test failed: test_struct
####
I fixed the error message (the min value was off by one before). I think I fixed a few ssize_t issues too.
The remaining issues I know of are: * The warning only appears on 64-bit platforms. * The warning doesn't seem correct for 64-bit platforms (l is 8 bytes, not 4). * test_struct only fails if run after test_tarfile. * The msg from test_struct doesn't seem correct for 64-bit platforms.
I tracked the problem down to trying to write the gzip tar file. Can you fix this?
The warning is correct, and so is the size. Only native formats have native sizes; l and i are exactly 4 bytes on all platforms when using =, >, <, or !. That's what "std size and alignment" means.
Ah, you are correct. I see this is the behaviour in 2.4. Though I wouldn't call 4 bytes a standard size on a 64-bit platform.
Unfortunately I don't have a 64-bit platform easily accessible and I have no idea which test it is that's raising the warning. Could you isolate it?
I wasted sleep for that? Damn and I gotta get up early again tomorrow too. See the checkin for answer. Would someone augment the warnings module to make testing more reasonable? n