[PyQt] Segmentation Fault in FileDialog

Ramiro Algozino algozino at gmail.com
Sun Dec 4 22:21:21 GMT 2011


Hello!

 I'm having an issue with a FileDialog, a getSaveFileName type in
particullar. I get a "Segmentation Fault" when I accept the dialog if
the file doesn't exist. When I overwrite an exisiting file the
segmentation doesn't occur.

This is happening in Fedora 16 (Gnome3) and I have an user report
saying that the same problem is present in Ubuntu 11.10.

This is the code snippet I'm using [0]:

    def saveCode(self):
        fn = QtGui.QFileDialog.getSaveFileName(
            self,
            self.trUtf8('Save QRCode'),
            filter=self.trUtf8('PNG Images (*.png);; All Files (*.*)'),
            #options=QtGui.QFileDialog.DontUseNativeDialog
            )

 I've found that if setting the option flag DontUseNativeDialog the
segmentation doesn't appear and everything work as expected. Also, the
problem is only present if I import the pynotify library.

 Not importing the PyNotify library I get this Warning when the file
doesn't exist:

(python:7829): Gtk-WARNING **: Unable to retrieve the file info for
`file:///home/ramiro/proyectos/qr-tools/borrame2.png': Error al
mostrar la información del estado del archivo
«/home/ramiro/proyectos/qr-tools/borrame2.png»: No existe el fichero o
el directorio.

¿Is this a PyQt / Qt problem?

Thank you very much!

[0] You can see the complete code here:
http://bazaar.launchpad.net/~qr-tools-developers/qr-tools/trunk/view/head:/qtqr.py
--
Ramiro Algozino
http://ramiroalgozino.com.ar/


More information about the PyQt mailing list