[PyQt] PyQt 3.18.1 qApp.translate() issues since sip 4.11.1 (at least)

Hans-Peter Jansen hpj at urpla.net
Thu Oct 7 19:53:51 BST 2010


On Thursday 07 October 2010, 13:14:45 Phil Thompson wrote:
> On Wed, 6 Oct 2010 14:33:29 +0200, "Hans-Peter Jansen"
> > today, I noticed, that there's an ugly issue, resulting in such
> tracebacks:
> >
> > As you can see, qApp is always involved, translate() most of the
> > time, too. The real ugliness comes from not being reproducible, the
> > same code happens to run perfectly well on the next try, and I was
> > not able to create a minimum example, yet.
>
> Don't worry about an example that always fails - one that fails
> sometimes will probably do.

Okay, here we go. It's bigger then I hoped, and does don't crash 
reliable. It behaves fine most of the time, and the issue happens at a 
random point, either immediately after start:

Traceback (most recent call last):
  File "./testapp.py", line 49, in <module>
    win = TestWin()
  File "testwin.py", line 15, in __init__
    TestWinBase.__init__(self, parent, name, fl)
  File "testwinbase.py", line 43, in __init__
    self.languageChange()
  File "testwinbase.py", line 50, in languageChange
    self.setCaption(self.__tr("TestWin"))
  File "testwinbase.py", line 61, in __tr
    return qApp.translate("TestWinBase",s,c)
RuntimeError: underlying C/C++ object has been deleted

or periodically during execution:

$ LANG=de_DE ./testapp.py 
Traceback (most recent call last):
  File "testwin.py", line 34, in statusTimeout
    qApp.mainWidget().statusBar().message(self.__tr(
RuntimeError: underlying C/C++ object has been deleted
Traceback (most recent call last):
  File "testwin.py", line 31, in statusTimeout
    qApp.mainWidget().staticMsg.setText(self.__tr("Running since: %1")
RuntimeError: underlying C/C++ object has been deleted
Traceback (most recent call last):
  File "testwin.py", line 31, in statusTimeout
    qApp.mainWidget().staticMsg.setText(self.__tr("Running since: %1")
RuntimeError: underlying C/C++ object has been deleted
Traceback (most recent call last):
  File "testwin.py", line 31, in statusTimeout
    qApp.mainWidget().staticMsg.setText(self.__tr("Running since: %1")
RuntimeError: underlying C/C++ object has been deleted

Interacting with the "do nothing" menu item seems to contribute to the 
problem, but again in elusive ways. This pretty much constitutes a 
heisenbug, that it is. It happened also in both the "de_DE" and the "C" 
locale, and it should appear within two dozen tries..

> > I do know for sure, that this doesn't happen with sip 4.10.1, hence
> > it's something, that crawled in between 4.10.1 and 4.11.1. Does this
> > ring a bell for you?
>
> There have been changes in an area where the only use case is qApp in
> PyQt3.

Could you point me to the commit ids of those?

Sorry for the fuzziness,
Pete

Python version: 2.6
sip version: 4.11.1
Qt3 version: 3.3.8b
PyQt3 version: 3.18.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testapp-0.0.1.tar.gz
Type: application/x-tgz
Size: 18302 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101007/d5026681/attachment-0001.bin>


More information about the PyQt mailing list