[Python-Dev] Anyone else seeing test_struct fail?
Tim Peters
tim@digicool.com
Mon, 18 Jun 2001 18:04:06 -0400
[Mark Favas]
> [Platform: Tru64 Unix, Compaq C compiler)
> The current CVS of 2.2a0 fails test_struct for me with:
>
> test test_struct failed -- pack('>i', -2147483649) did not raise error
>
> more extensively,
> trying std iI on -2147483649 == 0xffffffff7fffffff
> Traceback (most recent call last):
> File "Lib/test/test_struct.py", line 367, in ?
> t.run()
> File "Lib/test/test_struct.py", line 353, in run
> self.test_one(x)
> File "Lib/test/test_struct.py", line 269, in test_one
> any_err(pack, ">" + code, x)
> File "Lib/test/test_struct.py", line 38, in any_err
> raise TestFailed, "%s%s did not raise error" % (
> test_support.TestFailed: pack('>i', -2147483649) did not raise error
>
> A 64-bit platform issue?
In test_struct.py, please change this line (right after "class IntTester"):
BUGGY_RANGE_CHECK = "bBhHIL"
to
BUGGY_RANGE_CHECK = "bBhHiIlL"
and try again. I suspect you're bumping into a pre-existing bug that simply
wasn't checked before (and, yes, there's A Reason it *may* screw up on a
64-bit box but not a 32-bit one). Note that since in standard mode, "i" is
considered to be a 4-byte int regardless of platform, we really *should*
bitch about trying to pack -2147483649 under "i" (but we don't -- and in
general no codes except the new q/Q reliably bitch about out-of-range errors
in the standard modes).
> Also, the current imap.py causes "make test" (test___all__ and
> test_sundry) to fail with: "exceptions.TabError: inconsistent use of
> tabs and spaces in indentation (imaplib.py, line 576)" - untested
> checkin <grin>?
Leaving that to some loser who cares about whitespace <wink>.