[PyKDE] A few snapshot-20051219 problems

Phil Thompson phil at riverbankcomputing.co.uk
Tue Dec 20 08:40:51 GMT 2005


On Tuesday 20 December 2005 7:27 am, Gerard Vermeulen wrote:
> (1) A typo:
>
> --- sip-snapshot-20051219/sipconfig.py.gv       2005-12-20
> 07:40:52.000000000 +0100 +++ sip-snapshot-20051219/sipconfig.py  2005-12-20
> 08:04:31.000000000 +0100 @@ -564,7 +564,7 @@
>              if self.config.qt_version >= 0x040000:
>                  # This is really just a help for PyQt's configure.py when
> it is # detecting what Qt modules are available.
> -                qtmods = self.config.pyqt_modules[:]
> +                qtmods = self.config.pyqt_modules.split()
>                  qtmods.extend(self._qt)
>
>                  for mod in qtmods:
> sip.patch lines 1-11/11 (END)

That's wrong. There is a problem but it's a bit more fundamental.

> (2) I think that it is really weird that the script below segfaults
>     (especially since it is so easy to workaround).
>     Sorry for reposting, but am I the only guy who has this problem?
>
> #!/usr/bin/env python
>
> crash = True
> # uncomment the next line and the script will not crash
> # crash = False
>
> import sys
> import sip
> sip.settracemask(0x3f)
> from PyQt4 import  QtGui
>
> def make():
>     demo = QtGui.QLabel('I did not crash')
>     if crash:
>         demo.show()
>     return demo
>
> # make()
>
> def main(args):
>     app = QtGui.QApplication(args)
>     demo = make()
>     if not crash:
>         demo.show()
>     app.exec_()
>
> # main()
>
> if __name__ == '__main__':
>     main(sys.argv)
> Label.py lines 1-30/30 (END)

Several people have reported a very similar problem - I'm collecting test 
cases at the moment. The problem has to do with the command line arguments. 
In Qt3 these are only used in the QApplication ctor, but in Qt4 they are 
saved and used in show(). I did have a bug where argc was on the stack and so 
was garbage by the time show() was called - this bug looks very similar.

Phil




More information about the PyQt mailing list