[PyKDE] "import khtml" causes weird problem

D Bera dbera.web at gmail.com
Thu Feb 9 17:03:41 GMT 2006


> It could be a problem with KURL::List - there are two 'filePreview'
> functions:
>
> namespace KIO
> {
>    KIO::PreviewJob* filePreview (KURL::List, ...)
>    KIO::PreviewJob* filePreview (KFileList, ...)
> }
>
> where KFileList is a mapped type of QPtrList<KFileItem>. I haven't looked
> at that (the second function) yet, beyond one attempt where I ran into a
> problem in the KFileItem ctor where the C++ code is trying to figure out
> the mime type of the file and I ran into a segfault somewhere in the Qt
> unicode processing code. The second function is basically just a call to
> the KIO::PreviewJob ctor; the first function converts the KURL::List to a
> KFileList and the calls the KIO::PreviewJob ctor.

Yeah!
[debajyoti at dbera yabipy]$ python
Python 2.4.1 (#2, Aug 25 2005, 18:20:57)
[GCC 4.0.1 (4.0.1-2mdk for Mandriva Linux release 2006.0)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from qt import QString
>>> from kio import *
>>> from kdecore import *
>>> s = QString ('image/jpeg')
>>> u = KURL ('/home/debajyoti/out')
>>> import stat
>>> m = stat.S_IFREG
>>> i = KFileItem (u, s, m)
Segmentation fault

gdb stacktrace:
(gdb) bt
#0  0xb764929d in KInstance::dirs () from /usr/lib/libkdecore.so.4
#1  0xb7649322 in KGlobal::dirs () from /usr/lib/libkdecore.so.4
#2  0xb765af66 in KSycoca::openDatabase () from /usr/lib/libkdecore.so.4
#3  0xb769cf26 in KSycoca::KSycoca () from /usr/lib/libkdecore.so.4
#4  0xb769cfd7 in KSycoca::self () from /usr/lib/libkdecore.so.4
#5  0xb769d1dc in KSycocaFactory::KSycocaFactory$base () 
from /usr/lib/libkdecore.so.4
#6  0x426258f8 in KServiceTypeFactory::KServiceTypeFactory ()
   from /usr/lib/libkio.so.4
#7  0x42625af9 in KServiceTypeFactory::self () from /usr/lib/libkio.so.4
#8  0x42640012 in KMimeType::mimeType () from /usr/lib/libkio.so.4
#9  0x4264a552 in KFileItem::KFileItem$base () from /usr/lib/libkio.so.4
#10 0xb785cbea in initkio () from /usr/lib/python2.4/site-packages/kio.so
#11 0xb785f3a6 in initkio () from /usr/lib/python2.4/site-packages/kio.so
#12 0xb797b7e2 in initsip () from /usr/lib/python2.4/site-packages/sip.so
#13 0x41efd4aa in PyType_IsSubtype () from /usr/lib/libpython2.4.so.1.0
#14 0xb72e7eec in ?? ()
#15 0xb72e998c in ?? ()
#16 0x00000000 in ?? ()
(gdb)


I was thinking of building PyQt. Now I will hold till someone figures out the 
black magic happening between python, sip and qt/kde.

-- 
--------------------------------------------------------
Debajyoti Bera @ http://dbera.blogspot.com
beagle / KDE fan
Mandriva / Inspiron-1100 user




More information about the PyQt mailing list