[issue9277] test_struct failure on ARM

Mark Dickinson report at bugs.python.org
Sun Jul 18 13:38:08 CEST 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Somewhere along the way native_table is used instead of lilendian_table,
> so np_bool is called.

Hmm.  This doesn't alleviate my confusion. :)

The relevant part of test_struct looks like:

    for prefix in tuple("<>!=")+('',):
        # other tests
        try:
            struct.pack(prefix + '?', ExplodingBool())
        except IOError:
            pass
        else:
            self.fail("Expected IOError: struct.pack(%r, "
                      "ExplodingBool())" % (prefix + '?'))

So the '<?' test should happen directly before the '>?' test.  But the '<?' test was apparently passing, while the '>?' one was failing.  I don't see how native_table is relevant here, but am probably missing something.

On the other hand, with the pre-patch code, we end up with a method that sets a Python error but then returns a return value that indicates no error happened, and all sorts of unpredictable things can happen at that point...

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9277>
_______________________________________


More information about the Python-bugs-list mailing list