[PyKDE] Working with empty QStrings

Boudewijn Rempt boud at rempt.xs4all.nl
Sun Jan 16 22:43:01 GMT 2000


I was playing with KFileDialog just now (again trying to get a really
good template for PyKDE applications), and I noticed that my app kept
crashing if I canceled the file open dialog.

It turns out that if you try to convert and empty (QString.isEmpty()=TRUE)
QString to a Python string you don't get "" nor None, but a segfault.
Would it be a good idea to have str(QString) where QString.isEmpty==TRUE
return None? Once you know the current behaviour it isn't a direct
problem, but anything that can cause a segfault is unpleasant, of
course.

Boudewijn Rempt  | http://www.xs4all.nl/~bsarempt





More information about the PyQt mailing list