[PyQt] Lingering exception
me at the-compiler.org
Wed May 7 15:10:56 BST 2014
I faced a very interesting issue with my code, which only seems to
happen on Ubuntu (not Archlinux/Windows 7), with Python 3.3.2, PyQt
5.0.1 and Qt 5.0.2 (though my versions on Arch/Windows might be
In my source at  I get this traceback:
Traceback (most recent call last):
File "./qutebrowser/keyinput/modeman.py", line 231, in eventFilter
if self.mode is None:
AttributeError: 'ModeManager' object has no attribute 'mode'
Now mode is a simple @property:
"""Read-only property for the current mode."""
if not self._mode_stack:
self._mode_stack is defined in __init__ so it certainly always exists.
After discovering  I catched the AttributeError inside the
property, and got this exception in the "return self._mode_stack[-1]"
AttributeError: _Progress object has no attribute 'QWidget'
(_Progress is defined at ). It seems to be a lingering exception,
as doing this before the return fixes it:
According to the helpful folks in #python, PyQt either didn't check
for exceptions when it should have, or it didn't call PyExc_Clear()
after handling one.
I'm pretty certain I never do anything like _Progress.QWidget in
my Python code, so even that exception doesn't make much sense to me.
It only happens when starting the application for half a second or so,
after that it seems fine. ModeManager is an eventFilter on
If you want to experiment yourself:
git clone git://the-compiler.org/qutebrowser/
git checkout 14873285e662ddca685b565368b9e8466c9a316b
(After that commit I work around the error).
If a trimmed down example would help, please let me know. If it works
without one I'd be happy as it'd be quite some work to trim the code
down I'd guess.
Thanks a lot,
() ascii ribbon campaign - stop html mail www.asciiribbon.org
/\ www.the-compiler.org | I love long mails http://email.is-not-s.ms/
If *I* had a hammer, there'd be no more folk singers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: not available
More information about the PyQt