[PyQt] pykde crash on debian etch / import kparts or khtml

jbd jbdenis at dental-on-line.fr
Fri Sep 28 15:56:14 BST 2007


I've got a small problem with an application i'm trying to port from 
sarge to etch. Here is the minimal application which mimics the problem.
It's a simple QDialog with a QPushButton which triggers a KDirLister and 
print the result on stdout. It works well as long as i don't import 
khtml or kparts.

I'm running a clean debian etch system :
kdelibs : 4:3.5.5a.dfsg.1-8
python-kde3 : 3.15.2+20060422-3
python-qt3 : 3.16-1.2

The same code sample runs well on debian sarge but crash on debian etch 
and ubuntu feisty. It seems that's i'm doing something wrong here.

Thank you for your help !

Here is the code sample :

# -*- coding: utf-8 -*-

import sys

from qt import QDialog, QPushButton, SIGNAL
from kdecore import KCmdLineArgs, KApplication, KURL
from kio import KDirLister

# Remove one or both of the comment to crash the application
#from khtml import *
#from kparts import * #

class TestCrash(QDialog):
     def __init__(self, parent=None):
         QDialog.__init__(self, parent)
         button = QPushButton("Run kdirlister", self)
         self._dirLister = KDirLister()
         self.connect(button, SIGNAL("clicked()"), self._openHome)
         self.connect(self._dirLister, SIGNAL("newItems(const 

     def _openHome(self):

     def _slotNewItems(self, items):
         print "="*50
         for item in items:
             print item.url().prettyURL()
         print "="*50

def main():
         KCmdLineArgs.init(sys.argv, "crash test", "crash test","crash 
         app = KApplication(True, True)

         widget = TestCrash()
         res = app.exec_loop()

         print "Return value", res

     except Exception, what:
         print "Exception catched:", str(what)

if __name__=="__main__":


More information about the PyQt mailing list