[PyQt] segmentation faults common when using QWebView

Brandon Craig Rhodes brandon at rhodesmill.org
Mon Nov 29 15:54:42 GMT 2010


I think that there is a bright future in using PyQt4 with a QWebView
object for writing basic web tests, and for web automation.  My early
experiments suggest that it is a much simpler and faster solution, when
one needs web page browsing with JavaScript enabled, than a heavyweight
technique like running and remotely controlling a separate browser
process.

But though my first few page loads and clicks went well, I quickly found
that sites of any complexity would cause my Python script to crash with
a segmentation fault.  Many of my early examples were non-deterministic
- the script would sometimes crash, but sometimes succeed - but I have
now found a test script which always crashes, and that therefore might
serve as a good example of this bug here on the mailing list.

The script is attached to this email.  Its output when I run it against
the PyQt4 shipped with Ubuntu Maverick is this:

$ python2.6 qtcrash.py
4.7.0
4.7.4
zsh: segmentation fault  python2.6 qtcrash.py

When I download and install the current PyQt4 snapshot instead, this is
the output:

$ ./v/bin/python2.6 qtcrash.py
4.7.0
snapshot-4.8.2-f509333f6b01
zsh: segmentation fault  ./v/bin/python2.6 qtcrash.py

Is anyone else able to reproduce this?  Where would I get started in
tracking down why this code causes PyQt4 to produce a segmentation
fault?  Thanks for any guidance!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtcrash.py
Type: text/x-python
Size: 1739 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101129/6d17dde3/attachment.py>
-------------- next part --------------

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon


More information about the PyQt mailing list