[PyQt] PyQt 4.5 crash
phil at riverbankcomputing.com
Sun Jun 14 14:48:42 BST 2009
On Sun, 14 Jun 2009 15:41:34 +0200, Arve Knudsen <arve.knudsen at gmail.com>
> On Sun, Jun 14, 2009 at 3:39 PM, Phil Thompson
> <phil at riverbankcomputing.com>wrote:
>> On Sun, 14 Jun 2009 13:09:42 +0200, Arve Knudsen
<arve.knudsen at gmail.com>
>> > Seems like I'm on a roll right now .. I have a case which crashes PyQt
>> > under debug-built Python 2.6 on Ubuntu 9.04 x86-64. The attached
>> > contains the case, and backtrace.txt gdb's backtrace output.
>> > The case is extracted from a unit test of mine, and I've simply pasted
>> > from a mock module which it depends on, so there's a lot of cruft in
>> > the
>> > file. What matters is the class "Test", and apparently what triggers
>> > the
>> > crash is its assignment of the variable "_qbase".
>> > It is possible that my QMock class confuses PyQt in some way, but I
>> > guess
>> > it
>> > shouldn't crash :)
>> It's not crashing, it's an assertion failure.
>> It's checking that an attribute with a particular special name is a list
>> and failing if not. In your test it is a MockCallable instance instead.
>> I could remove the assertion and just silently ignore anything that is
>> unexpected type - but I'm not sure if that breaks your mock object.
> OK, thanks for pointing this out. I could try to modify my Mock class to
> recognize and ignore special attributes like this.
I think I'll remove the assertion anyway - it's a bit of an extreme
response in this case.
More information about the PyQt